Package de.aristaflow.adept2.core.client
Class AddAttrSessionFactory
java.lang.Object
de.aristaflow.adept2.core.client.AddAttrSessionFactory
- All Implemented Interfaces:
ClientSessionFactory,Serializable
This class wraps a normal client session factory and adds specific additional
attributes to all created session tokens. Note that these attributes may
be overridden by additional attributes provided to the corresponding methods.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAddAttrSessionFactory(ClientSessionFactory csf, Map<String, String> additionalAttributes) Creates a newClientSessionFactorywhich adds the designated additional attributes to all created session tokens. -
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.booleanAn implementation ofObject.equals(Object)for various purpose.intAn implementation ofObject.hashCode()for various purpose.
-
Constructor Details
-
AddAttrSessionFactory
Creates a newClientSessionFactorywhich adds the designated additional attributes to all created session tokens.- Parameters:
csf- The client session factory used to create session tokens.additionalAttributes- The additional attributes added to every created session token (complemented by provided additional attributes if appropriate).
-
-
Method Details
-
getAuthenticatedAgent
Description copied from interface:ClientSessionFactoryGets theRichAgentwhich is authenticated for this client session factory.- Specified by:
getAuthenticatedAgentin interfaceClientSessionFactory- Returns:
- The
RichAgentauthenticated for this client session factory.
-
setClientURIs
Description copied from interface:ClientSessionFactorySets the URIs to be used when creating a session token without explicit URIs. This method has to be called before callingClientSessionFactory.getSessionToken()and it must not be called more than once! Further calls are ignored.
The array should be a copy of the original one.- Specified by:
setClientURIsin interfaceClientSessionFactory- Parameters:
clientURIs- The URIs of the client used if a component does not have its own URIs. This must not be null.
-
getSessionToken
Description copied from interface:ClientSessionFactoryCreates 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.- Specified by:
getSessionTokenin interfaceClientSessionFactory- 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
public SessionToken getSessionToken(URI[] callingComponent, Map<String, String> additionalAttributes) Description copied from interface:ClientSessionFactoryCreates 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.- Specified by:
getSessionTokenin interfaceClientSessionFactory- 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
Description copied from interface:ClientSessionFactoryCreates 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,
ClientSessionFactory.setClientURIs(URI[])has to be called. Otherwise anIllegalStateExceptionwill be thrown.- Specified by:
getSessionTokenin interfaceClientSessionFactory- Returns:
- A session token for the logged on user, the corresponding organisational position, security token and URIs of the corresponding client.
-
getSessionToken
Description copied from interface:ClientSessionFactoryCreates 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,
ClientSessionFactory.setClientURIs(URI[])has to be called. Otherwise anIllegalStateExceptionwill be thrown.- Specified by:
getSessionTokenin interfaceClientSessionFactory- 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.
-
subEquals
An implementation ofObject.equals(Object)for various purpose. Due to several reasons we do not want actually overrideObject.equals(Object).- Parameters:
obj- The object with which to compare.- Returns:
- Whether this is the same object as the designated one.
-
subHashCode
public int subHashCode()An implementation ofObject.hashCode()for various purpose. Due to several reasons we do not want actually overrideObject.hashCode().
The implementation conforms to the implementation ofsubEquals(Object)with respect toObject.equals(Object).- Returns:
- A hash code value for this object.
-