public class LensConnection extends Object implements AutoCloseable
Constructor and Description |
---|
LensConnection(LensConnectionParams params)
Construct a connection to lens server specified by connection parameters.
|
LensConnection(LensConnectionParams params,
LensSessionHandle sessionHandle)
Construct a connection to lens server specified by connection parameters with an already established session
|
Modifier and Type | Method and Description |
---|---|
APIResult |
addResourceToConnection(String type,
String resourcePath)
Adds the resource to connection.
|
APIResult |
attachDatabaseToSession()
Attach database to session.
|
javax.ws.rs.client.Client |
buildClient() |
void |
close()
Close the connection.
|
List<String> |
getConnectionParams() |
List<String> |
getConnectionParams(String key)
Gets the connection params.
|
Map<String,String> |
getConnectionParamsAsMap() |
LensConnectionParams |
getLensConnectionParams() |
javax.ws.rs.core.Response |
getLogs(String logFile)
get the logs for a given log file
|
javax.ws.rs.client.WebTarget |
getLogWebTarget() |
javax.ws.rs.client.WebTarget |
getLogWebTarget(javax.ws.rs.client.Client client) |
LensSessionHandle |
getSessionHandle()
The session handle.
|
boolean |
isOpen()
Check if the connection is opened.
|
List<String> |
listResourcesFromConnection(String type)
List resources from session
|
LensSessionHandle |
open(String password)
Open.
|
APIResult |
removeResourceFromConnection(String type,
String resourcePath)
Removes the resource from connection.
|
APIResult |
setConnectionParams(String key,
String value)
Sets the connection params.
|
String |
toString() |
public LensConnection(LensConnectionParams params)
params
- parameters to be used for creating a connectionpublic LensConnection(LensConnectionParams params, LensSessionHandle sessionHandle)
params
- parameters to be used for creating a connectionpublic boolean isOpen()
public javax.ws.rs.client.Client buildClient()
public javax.ws.rs.client.WebTarget getLogWebTarget()
public javax.ws.rs.client.WebTarget getLogWebTarget(javax.ws.rs.client.Client client)
public LensSessionHandle open(String password)
password
- the passwordpublic APIResult attachDatabaseToSession()
public void close()
close
in interface AutoCloseable
public APIResult addResourceToConnection(String type, String resourcePath)
type
- the typeresourcePath
- the resource pathpublic APIResult removeResourceFromConnection(String type, String resourcePath)
type
- the typeresourcePath
- the resource pathpublic List<String> listResourcesFromConnection(String type)
type
- type of resourcepublic javax.ws.rs.core.Response getLogs(String logFile)
logFile
- log segregationpublic APIResult setConnectionParams(String key, String value)
key
- the keyvalue
- the valuepublic List<String> getConnectionParams(String key)
key
- the keypublic LensConnectionParams getLensConnectionParams()
@Generated(value="lombok") public LensSessionHandle getSessionHandle()
Copyright © 2014–2018 Apache Software Foundation. All rights reserved.