Interface ClientSessionFactory
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AddAttrSessionFactory
A client session factory provides the user with a token needed for calling
the ADEPT2-API. The session contains a security token identifying the user as
well as an identification (URI) of the component using the session token.
They may have additional, session-specific attributes, for instance to use in
a web context. Session tokens must only be used for one method call.
This factory encapsulates the security (and user) information. A special URI of the calling component may be provided when creating a new session token. Otherwise the URIs have to be set before retrieving a session token.
This factory encapsulates the security (and user) information. A special URI of the calling component may be provided when creating a new session token. Otherwise the URIs have to be set before retrieving a session token.
While a session token is used like a transaction in a database management system, a session factory corresponds to a user session, for instance in a web browser. A session factory is retrieved when logging on and may be used until logging off. Every request or a combination or requests belonging together in one transaction are performed with the same session token of the provided session factory (user session).
- Author:
- Ulrich Kreher
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longGenerated ID for serialisation. -
Method Summary
Modifier and TypeMethodDescriptionGets theRichAgentwhich is authenticated for this client session factory.Creates a new (top-level) session token which is needed for calling the ADEPT2-API.getSessionToken(URI[] callingComponent) Creates a new (top-level) session token which is needed for calling the ADEPT2-API.getSessionToken(URI[] callingComponent, Map<String, String> additionalAttributes) Creates a new (top-level) session token which is needed for calling the ADEPT2-API.getSessionToken(Map<String, String> additionalAttributes) Creates a new (top-level) session token which is needed for calling the ADEPT2-API.voidsetClientURIs(URI[] clientURIs) Sets the URIs to be used when creating a session token without explicit URIs.
-
Field Details
-
serialVersionUID
static final long serialVersionUIDGenerated ID for serialisation.- See Also:
-
-
Method Details
-
getAuthenticatedAgent
RichAgent getAuthenticatedAgent()Gets theRichAgentwhich is authenticated for this client session factory.- Returns:
- The
RichAgentauthenticated for this client session factory.
-
setClientURIs
Sets the URIs to be used when creating a session token without explicit URIs. This method has to be called before callinggetSessionToken()and it must not be called more than once! Further calls are ignored.
The array should be a copy of the original one.- Parameters:
clientURIs- The URIs of the client used if a component does not have its own URIs. This must not be null.
-
getSessionToken
Creates a new (top-level) session token which is needed for calling the ADEPT2-API. This method provides a session token containing the appropriate security token, the agent and organisational position ID. The calling component just has to submit a URI of itself.
This method has to be used by components having a own external communication interface.- Parameters:
callingComponent- The component initiating the requested session on the client side, identified by its communication protocol depended URIs.- Returns:
- A session token (signed) for the logged on user, the corresponding organisational position, security token and the designated component initiating the session.
-
getSessionToken
Creates a new (top-level) session token which is needed for calling the ADEPT2-API. This method provides a session token containing the appropriate security token, the agent and organisational position ID as well as the additional attributes. The calling component just has to submit a URI of itself.
This method has to be used by components having a own external communication interface.- Parameters:
callingComponent- The component initiating the requested session on the client side, identified by its communication protocol depended URIs.additionalAttributes- Additional attributes which are provided by the created session token. This may be null.- Returns:
- A session token for the logged on user, the corresponding organisational position, security token and the designated component initiating the session.
-
getSessionToken
SessionToken getSessionToken()Creates a new (top-level) session token which is needed for calling the ADEPT2-API. This method provides a session token containing the appropriate security token, the agent and organisational position ID and the URIs of the client.Before calling this method,
setClientURIs(URI[])has to be called. Otherwise anIllegalStateExceptionwill be thrown.- Returns:
- A session token for the logged on user, the corresponding organisational position, security token and URIs of the corresponding client.
- Throws:
IllegalStateException- If the URIs arenot set yetanIllegalStateExceptionwill be thrown.
-
getSessionToken
Creates a new (top-level) session token which is needed for calling the ADEPT2-API. This method provides a session token containing the appropriate security token, the agent and organisational position ID and the URIs of the client as well as the additional attributes.Before calling this method,
setClientURIs(URI[])has to be called. Otherwise anIllegalStateExceptionwill be thrown.- Parameters:
additionalAttributes- Additional attributes which are provided by the created session token. This may be null.- Returns:
- A session token for the logged on user, the corresponding organisational position, security token and URIs of the corresponding client.
- Throws:
IllegalStateException- If the URIs arenot set yetanIllegalStateExceptionwill be thrown.
-