Class SessionResource
- java.lang.Object
-
- org.forgerock.openam.core.rest.session.SessionResource
-
- All Implemented Interfaces:
org.forgerock.json.resource.CollectionResourceProvider
public class SessionResource extends Object implements org.forgerock.json.resource.CollectionResourceProvider
Represents Sessions that can queried via a REST interface. Currently describes a single entrypoint for this Resource, useful when querying Session Information:- Servers - Lists all servers that are known to OpenAM.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDELETE_PROPERTY_ACTION_IDstatic StringGET_IDLE_ACTION_IDstatic StringGET_MAX_IDLE_ACTION_IDstatic StringGET_MAX_SESSION_TIME_ACTION_IDstatic StringGET_MAX_SESSION_TIME_IDstatic StringGET_MAX_TIME_ACTION_IDDeprecated.use getTimeLeft instead.static StringGET_PROPERTY_ACTION_IDstatic StringGET_PROPERTY_NAMES_ACTION_IDstatic StringGET_TIME_LEFT_ACTION_IDstatic StringIS_ACTIVE_ACTION_IDstatic StringKEYWORD_ALLstatic StringKEYWORD_LISTstatic StringKEYWORD_PROPERTIESstatic StringKEYWORD_RESULTstatic StringKEYWORD_SERVER_IDstatic StringKEYWORD_SUCCESSstatic StringLOGOUT_ACTION_IDstatic StringSET_PROPERTY_ACTION_IDstatic StringTOKEN_IDstatic StringVALIDATE_ACTION_ID
-
Constructor Summary
Constructors Constructor Description SessionResource(SSOTokenManager ssoTokenManager, AuthUtilsWrapper authUtilsWrapper, SessionPropertyWhitelist sessionPropertyWhitelist, SessionResourceUtil sessionResourceUtil)Dependency Injection constructor allowing the SessionResource dependency to be provided.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.forgerock.util.promise.Promise<org.forgerock.json.resource.ActionResponse,org.forgerock.json.resource.ResourceException>actionCollection(org.forgerock.services.context.Context context, org.forgerock.json.resource.ActionRequest request)org.forgerock.util.promise.Promise<org.forgerock.json.resource.ActionResponse,org.forgerock.json.resource.ResourceException>actionInstance(org.forgerock.services.context.Context context, String tokenId, org.forgerock.json.resource.ActionRequest request)org.forgerock.util.promise.Promise<org.forgerock.json.resource.ResourceResponse,org.forgerock.json.resource.ResourceException>createInstance(org.forgerock.services.context.Context ctx, org.forgerock.json.resource.CreateRequest request)org.forgerock.util.promise.Promise<org.forgerock.json.resource.ResourceResponse,org.forgerock.json.resource.ResourceException>deleteInstance(org.forgerock.services.context.Context ctx, String resId, org.forgerock.json.resource.DeleteRequest request)Collection<String>getAllServerIds()Returns a collection of all Server ID that are known to the OpenAM instance.protected StringgetTokenIdFromCookie(org.forgerock.services.context.Context context, String cookieName)protected StringgetTokenIdFromHeader(org.forgerock.services.context.Context context, String cookieName)protected StringgetTokenIdFromUrlParam(org.forgerock.json.resource.ActionRequest request)org.forgerock.util.promise.Promise<org.forgerock.json.resource.ResourceResponse,org.forgerock.json.resource.ResourceException>patchInstance(org.forgerock.services.context.Context ctx, String resId, org.forgerock.json.resource.PatchRequest request)org.forgerock.util.promise.Promise<org.forgerock.json.resource.QueryResponse,org.forgerock.json.resource.ResourceException>queryCollection(org.forgerock.services.context.Context context, org.forgerock.json.resource.QueryRequest request, org.forgerock.json.resource.QueryResourceHandler handler)Queries the session resources using one of the predefined query filters.org.forgerock.util.promise.Promise<org.forgerock.json.resource.ResourceResponse,org.forgerock.json.resource.ResourceException>readInstance(org.forgerock.services.context.Context context, String id, org.forgerock.json.resource.ReadRequest request)Perform a read operation against a named session.org.forgerock.util.promise.Promise<org.forgerock.json.resource.ResourceResponse,org.forgerock.json.resource.ResourceException>updateInstance(org.forgerock.services.context.Context ctx, String resId, org.forgerock.json.resource.UpdateRequest request)
-
-
-
Field Detail
-
VALIDATE_ACTION_ID
public static final String VALIDATE_ACTION_ID
- See Also:
- Constant Field Values
-
LOGOUT_ACTION_ID
public static final String LOGOUT_ACTION_ID
- See Also:
- Constant Field Values
-
IS_ACTIVE_ACTION_ID
public static final String IS_ACTIVE_ACTION_ID
- See Also:
- Constant Field Values
-
GET_IDLE_ACTION_ID
public static final String GET_IDLE_ACTION_ID
- See Also:
- Constant Field Values
-
GET_MAX_IDLE_ACTION_ID
public static final String GET_MAX_IDLE_ACTION_ID
- See Also:
- Constant Field Values
-
GET_MAX_SESSION_TIME_ACTION_ID
public static final String GET_MAX_SESSION_TIME_ACTION_ID
- See Also:
- Constant Field Values
-
KEYWORD_PROPERTIES
public static final String KEYWORD_PROPERTIES
- See Also:
- Constant Field Values
-
KEYWORD_SUCCESS
public static final String KEYWORD_SUCCESS
- See Also:
- Constant Field Values
-
GET_MAX_TIME_ACTION_ID
@Deprecated public static final String GET_MAX_TIME_ACTION_ID
Deprecated.use getTimeLeft instead.- See Also:
- Constant Field Values
-
GET_MAX_SESSION_TIME_ID
public static final String GET_MAX_SESSION_TIME_ID
- See Also:
- Constant Field Values
-
GET_TIME_LEFT_ACTION_ID
public static final String GET_TIME_LEFT_ACTION_ID
- See Also:
- Constant Field Values
-
GET_PROPERTY_ACTION_ID
public static final String GET_PROPERTY_ACTION_ID
- See Also:
- Constant Field Values
-
SET_PROPERTY_ACTION_ID
public static final String SET_PROPERTY_ACTION_ID
- See Also:
- Constant Field Values
-
DELETE_PROPERTY_ACTION_ID
public static final String DELETE_PROPERTY_ACTION_ID
- See Also:
- Constant Field Values
-
GET_PROPERTY_NAMES_ACTION_ID
public static final String GET_PROPERTY_NAMES_ACTION_ID
- See Also:
- Constant Field Values
-
KEYWORD_RESULT
public static final String KEYWORD_RESULT
- See Also:
- Constant Field Values
-
KEYWORD_ALL
public static final String KEYWORD_ALL
- See Also:
- Constant Field Values
-
KEYWORD_LIST
public static final String KEYWORD_LIST
- See Also:
- Constant Field Values
-
KEYWORD_SERVER_ID
public static final String KEYWORD_SERVER_ID
- See Also:
- Constant Field Values
-
TOKEN_ID
public static final String TOKEN_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SessionResource
@Inject public SessionResource(SSOTokenManager ssoTokenManager, AuthUtilsWrapper authUtilsWrapper, SessionPropertyWhitelist sessionPropertyWhitelist, SessionResourceUtil sessionResourceUtil)
Dependency Injection constructor allowing the SessionResource dependency to be provided.- Parameters:
ssoTokenManager- An instance of the SSOTokenManager.authUtilsWrapper- An instance of AuthUtilsWrappersessionPropertyWhitelist- An instance of sessionPropertyWhitelist.sessionResourceUtil- An instance of the SessionResourceUtil.
-
-
Method Detail
-
getAllServerIds
public Collection<String> getAllServerIds()
Returns a collection of all Server ID that are known to the OpenAM instance.- Returns:
- A non null, possibly empty collection of server ids.
-
actionCollection
public org.forgerock.util.promise.Promise<org.forgerock.json.resource.ActionResponse,org.forgerock.json.resource.ResourceException> actionCollection(org.forgerock.services.context.Context context, org.forgerock.json.resource.ActionRequest request)Actions supported are:- Specified by:
actionCollectionin interfaceorg.forgerock.json.resource.CollectionResourceProvider- Parameters:
context-request-
-
getTokenIdFromUrlParam
protected String getTokenIdFromUrlParam(org.forgerock.json.resource.ActionRequest request)
-
getTokenIdFromCookie
protected String getTokenIdFromCookie(org.forgerock.services.context.Context context, String cookieName)
-
getTokenIdFromHeader
protected String getTokenIdFromHeader(org.forgerock.services.context.Context context, String cookieName)
-
actionInstance
public org.forgerock.util.promise.Promise<org.forgerock.json.resource.ActionResponse,org.forgerock.json.resource.ResourceException> actionInstance(org.forgerock.services.context.Context context, String tokenId, org.forgerock.json.resource.ActionRequest request)Actions supported are:- Specified by:
actionInstancein interfaceorg.forgerock.json.resource.CollectionResourceProvider- Parameters:
context-tokenId- The SSO Token Id.request-
-
queryCollection
public org.forgerock.util.promise.Promise<org.forgerock.json.resource.QueryResponse,org.forgerock.json.resource.ResourceException> queryCollection(org.forgerock.services.context.Context context, org.forgerock.json.resource.QueryRequest request, org.forgerock.json.resource.QueryResourceHandler handler)Queries the session resources using one of the predefined query filters. list - will list the available servers.The session listing queries of this version, all and [server-id], are no longer supported. They listed the sessions of a server, or of the whole deployment, through the session service RPC under the administrative token of the server: neither the realm the sessions belong to nor the caller took part in the query, so an administrator delegated a single realm was answered with the sessions of every realm of the deployment. Sessions are listed by version 2.0 of this resource instead, whose query filter names the realm to list, which is authorized against the caller. The RPC method these queries were built on has been removed as well, so they have not returned a session since.
- Specified by:
queryCollectionin interfaceorg.forgerock.json.resource.CollectionResourceProvider- Parameters:
context-request-handler-
-
readInstance
public org.forgerock.util.promise.Promise<org.forgerock.json.resource.ResourceResponse,org.forgerock.json.resource.ResourceException> readInstance(org.forgerock.services.context.Context context, String id, org.forgerock.json.resource.ReadRequest request)Perform a read operation against a named session.- Specified by:
readInstancein interfaceorg.forgerock.json.resource.CollectionResourceProvider
-
createInstance
public org.forgerock.util.promise.Promise<org.forgerock.json.resource.ResourceResponse,org.forgerock.json.resource.ResourceException> createInstance(org.forgerock.services.context.Context ctx, org.forgerock.json.resource.CreateRequest request)- Specified by:
createInstancein interfaceorg.forgerock.json.resource.CollectionResourceProvider
-
deleteInstance
public org.forgerock.util.promise.Promise<org.forgerock.json.resource.ResourceResponse,org.forgerock.json.resource.ResourceException> deleteInstance(org.forgerock.services.context.Context ctx, String resId, org.forgerock.json.resource.DeleteRequest request)- Specified by:
deleteInstancein interfaceorg.forgerock.json.resource.CollectionResourceProvider
-
patchInstance
public org.forgerock.util.promise.Promise<org.forgerock.json.resource.ResourceResponse,org.forgerock.json.resource.ResourceException> patchInstance(org.forgerock.services.context.Context ctx, String resId, org.forgerock.json.resource.PatchRequest request)- Specified by:
patchInstancein interfaceorg.forgerock.json.resource.CollectionResourceProvider
-
updateInstance
public org.forgerock.util.promise.Promise<org.forgerock.json.resource.ResourceResponse,org.forgerock.json.resource.ResourceException> updateInstance(org.forgerock.services.context.Context ctx, String resId, org.forgerock.json.resource.UpdateRequest request)- Specified by:
updateInstancein interfaceorg.forgerock.json.resource.CollectionResourceProvider
-
-