|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lens.server.session.SessionResource
@Path(value="/session") public class SessionResource
Session resource api
This provides api for all things in session.
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
The Constant LOG. |
Constructor Summary | |
---|---|
SessionResource()
Instantiates a new session resource. |
Method Summary | |
---|---|
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 The parameters can be a hive variable or a configuration. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
public SessionResource() throws LensException
LensException
- the lens exceptionMethod Detail |
---|
@GET @Produces(value="text/plain") public String getMessage()
@POST @Consumes(value="multipart/form-data") @Produces(value={"application/json","application/xml","text/plain"}) public LensSessionHandle openSession(String username, String password, @DefaultValue(value="") String database, LensConf sessionconf)
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 session
@DELETE @Produces(value={"application/json","application/xml","text/plain"}) public APIResult closeSession(@QueryParam(value="sessionid") LensSessionHandle sessionid)
sessionid
- Session handle object of the session to be closed
@PUT @Path(value="resources/add") @Consumes(value="multipart/form-data") @Produces(value={"application/json","application/xml","text/plain"}) public 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 resource
APIResult
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 failed@GET @Path(value="resources/list") @Produces(value={"application/json","application/xml","text/plain"}) public StringList listResources(@QueryParam(value="sessionid") LensSessionHandle sessionid, @QueryParam(value="type") String type)
sessionid
- session handle objecttype
- resource type. It can be jar, file or null
@PUT @Path(value="resources/delete") @Consumes(value="multipart/form-data") @Produces(value={"application/json","application/xml","text/plain"}) public 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 deleted
APIResult
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 failed@GET @Path(value="params") @Produces(value={"application/json","application/xml","text/plain"}) public StringList getParams(@QueryParam(value="sessionid") LensSessionHandle sessionid, @DefaultValue(value="false")@QueryParam(value="verbose") boolean verbose, @DefaultValue(value="")@QueryParam(value="key") 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 key
@PUT @Path(value="params") @Produces(value={"application/json","application/xml","text/plain"}) public APIResult setParam(LensSessionHandle sessionid, String key, String value)
sessionid
- session handle objectkey
- parameter keyvalue
- parameter value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |