public class SessionResource extends Object
Constructor and Description |
---|
SessionResource()
Instantiates a new session resource.
|
Modifier and Type | Method and Description |
---|---|
APIResult |
addResource(LensSessionHandle sessionid,
String type,
String path)
Add a resource to the session to all LensServices running in this Lens server
|
APIResult |
closeSession(LensSessionHandle sessionid)
Close a Lens server session.
|
APIResult |
deleteResource(LensSessionHandle sessionid,
String type,
String path)
Delete a resource from sesssion from all the @{link LensService}s running in this Lens server
|
String |
getMessage()
API to know if session service is up and running
|
StringList |
getParams(LensSessionHandle sessionid,
boolean verbose,
String key)
Get a list of key=value parameters set for this session.
|
StringList |
listResources(LensSessionHandle sessionid,
String type)
Lists resources from the session for a given resource type.
|
LensSessionHandle |
openSession(String username,
String password,
String database,
LensConf sessionconf)
Create a new session with Lens server.
|
APIResult |
setParam(LensSessionHandle sessionid,
String key,
String value)
Set value for a parameter specified by key
|
public SessionResource() throws LensException
LensException
- the lens exceptionpublic String getMessage()
public LensSessionHandle openSession(String username, String password, String database, LensConf sessionconf) throws LensException
username
- User name of the Lens server userpassword
- Password of the Lens server userdatabase
- Set current database to the supplied value, if providedsessionconf
- Key-value properties which will be used to configure this sessionLensException
public APIResult closeSession(LensSessionHandle sessionid)
sessionid
- Session handle object of the session to be closedpublic APIResult addResource(LensSessionHandle sessionid, String type, String path)
The returned @{link APIResult} will have status SUCCEEDED only if the add operation was successful for all services running in this Lens server.
sessionid
- session handle objecttype
- The type of resource. Valid types are 'jar', 'file' and 'archive'path
- path of the resourceAPIResult
with state APIResult.Status.SUCCEEDED
, if add was successful. APIResult
with state
APIResult.Status.PARTIAL
, if add succeeded only for some services. APIResult
with state
APIResult.Status.FAILED
, if add has failedpublic StringList listResources(LensSessionHandle sessionid, String type)
sessionid
- session handle objecttype
- resource type. It can be jar, file or nullpublic APIResult deleteResource(LensSessionHandle sessionid, String type, String path)
Similar to addResource, this call is successful only if resource was deleted from all services.
sessionid
- session handle objecttype
- The type of resource. Valid types are 'jar', 'file' and 'archive'path
- path of the resource to be deletedAPIResult
with state APIResult.Status.SUCCEEDED
, if delete was successful. APIResult
with
state APIResult.Status.PARTIAL
, if delete succeeded only for some services. APIResult
with state
APIResult.Status.FAILED
, if delete has failedpublic StringList getParams(LensSessionHandle sessionid, boolean verbose, String key)
sessionid
- session handle objectverbose
- If true, all the parameters will be returned. If false, configuration parameters will be returnedkey
- if this is empty, output will contain all parameters and their values,
if it is non empty parameters will be filtered by keypublic APIResult setParam(LensSessionHandle sessionid, String key, String value)
sessionid
- session handle objectkey
- parameter keyvalue
- parameter valueCopyright © 2014–2016 Apache Software Foundation. All rights reserved.