Class UniversalHandler
- java.lang.Object
-
- de.aristaflow.adept2.base.security.callbackhandler.UniversalHandler
-
- All Implemented Interfaces:
AFCallbackHandler
public class UniversalHandler extends Object implements AFCallbackHandler
This handler provides the means to handle all used callbacks, i. e.NameCallback
,PasswordCallback
,OrgPositionChoiceCallback
,AppNameCallback
, andUserSessionIDCallback
. All data is provided in the constructor of this handler. Which of these callbacks are handled depends on the provided data, e. g. when not providing a password. thePasswordCallback
will not be handled.
-
-
Constructor Summary
Constructors Modifier Constructor Description UniversalHandler(String userName, String password, long orgPosId, String appName, String userSessionId)
Creates a new handler forNameCallback
,PasswordCallback
,OrgPositionChoiceCallback
,AppNameCallback
andUserSessionIDCallback
.protected
UniversalHandler(String userName, String password, Long orgPosId, List<QualifiedAgent> orgPosIds, String appName, String userSessionId)
Creates a new handler forCallback
s appropriate for the designated parameters.UniversalHandler(String userName, String password, String appName, String userSessionId)
Creates a new handler forNameCallback
,PasswordCallback
,AppNameCallback
andUserSessionIDCallback
.UniversalHandler(String password, List<QualifiedAgent> orgPosIds, String appName, String userSessionId)
Creates a new handler forPasswordCallback
,OrgPositionChoiceCallback
,AppNameCallback
andUserSessionIDCallback
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Callback[]
handle(Callback[] callbacks)
This method is similar toCallbackHandler.handle(Callback[])
but returns the provided callbacks back to the caller.
-
-
-
Constructor Detail
-
UniversalHandler
public UniversalHandler(String userName, String password, String appName, String userSessionId)
Creates a new handler forNameCallback
,PasswordCallback
,AppNameCallback
andUserSessionIDCallback
.- Parameters:
userName
- The unique name of the user to log on. This must not benull
nor an empty/blank string. Note that this name is case-sensitive!password
- The password of the user to log on ornull
.appName
- The application name for which to log on ornull
.userSessionId
- The user session ID which to use for all provided agents ornull
.
-
UniversalHandler
public UniversalHandler(String userName, String password, long orgPosId, String appName, String userSessionId)
Creates a new handler forNameCallback
,PasswordCallback
,OrgPositionChoiceCallback
,AppNameCallback
andUserSessionIDCallback
.- Parameters:
userName
- The unique name of the user to log on. This must not benull
nor an empty/blank string. Note that this name is case-sensitive!password
- The password of the user to log on ornull
.orgPosId
- The ID of the org position of the agent who to log on ornull
.appName
- The application name for which to log on ornull
.userSessionId
- The user session ID which to use for the designated org position..
-
UniversalHandler
public UniversalHandler(String password, List<QualifiedAgent> orgPosIds, String appName, String userSessionId)
Creates a new handler forPasswordCallback
,OrgPositionChoiceCallback
,AppNameCallback
andUserSessionIDCallback
.- Parameters:
password
- The password of the user to log on ornull
.orgPosIds
- The IDs of the org positions of the agent who to log on ornull
.appName
- The application name for which to log on ornull
.userSessionId
- The user session ID which to use for the designated agents ornull
.
-
UniversalHandler
protected UniversalHandler(String userName, String password, Long orgPosId, List<QualifiedAgent> orgPosIds, String appName, String userSessionId)
Creates a new handler forCallback
s appropriate for the designated parameters.- Parameters:
userName
- The unique name of the user to log on. This must not benull
nor an empty/blank string except when a list of agents is provided.password
- The password of the user to log on ornull
.orgPosId
- The org position ID of the agent who to log on ornull
.orgPosIds
- The IDs of the org positions of the agent who to log on ornull
. If this is set,userName
andorgPosId
both have to benull
.appName
- The application name for which to log on ornull
.userSessionId
- The user session ID which to use for all provided agents ornull
.
-
-
Method Detail
-
handle
public Callback[] handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
Description copied from interface:AFCallbackHandler
This method is similar toCallbackHandler.handle(Callback[])
but returns the provided callbacks back to the caller. This allows for calling this method remotely. Note that all callbacks need to be serialisable.
When called remotely, the provided callbacks are copies of the server-side objects. When changing these objects, the changes are not reflected on server side. Therefore these objects (or rather copies of them) need to be returned.- Specified by:
handle
in interfaceAFCallbackHandler
- Parameters:
callbacks
- The callbacks to be handled by this callback handler.- Returns:
- All the callbacks that should be handled by this callback handler. Just return the complete array of callbacks. Do not skip any callbacks, for instance the ones that the callback handler did not handle!
- Throws:
IOException
- If an input or output error occurs, anIOException
will be thrown.UnsupportedCallbackException
- If the implementation of this method does not support one or more of the callbacks specified in thecallbacks
parameter, anUnsupportedCallbackException
will be thrown.
-
-