Class PasswordHandler
java.lang.Object
de.aristaflow.adept2.base.security.callbackhandler.PasswordHandler
- All Implemented Interfaces:
AFCallbackHandler
A simple callback handler providing a password to the appropriate callback
(
PasswordCallback) if required. Optionally an additional
AFCallbackHandler can be provided to which all other
Callbacks will be forwarded. If this is not provided and another
callback is required, the callback handling will fail.- Author:
- Ulrich Kreher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AFCallbackHandlerThe callback handler for all other callbacks.protected final char[]The password to provide in aPasswordCallbackif required. -
Constructor Summary
ConstructorsConstructorDescriptionPasswordHandler(String password) Creates a callback handler providing the designated password to the appropriate callbacks.PasswordHandler(String password, AFCallbackHandler furtherHandling) Creates a callback handler providing the designated password to the appropriate callbacks. -
Method Summary
Modifier and TypeMethodDescriptionCallback[]This method is similar toCallbackHandler.handle(Callback[])but returns the provided callbacks back to the caller.
-
Field Details
-
password
protected final char[] passwordThe password to provide in aPasswordCallbackif required. -
furtherHandling
The callback handler for all other callbacks.
-
-
Constructor Details
-
PasswordHandler
Creates a callback handler providing the designated password to the appropriate callbacks. If anotherCallbackis required besides aPasswordCallback, callback handling will fail.- Parameters:
password- The password to provide in aPasswordCallbackif required.
-
PasswordHandler
Creates a callback handler providing the designated password to the appropriate callbacks. If anotherCallbackis required besides aPasswordCallback, these callbacks will be collected and provided to the designatedAFCallbackHandler.- Parameters:
password- The password to provide in aPasswordCallbackif required.furtherHandling- TheAFCallbackHandlerto which all other callbacks will be forwarded. This may benullwhich equalsPasswordHandler(String).
-
-
Method Details
-
handle
Description copied from interface:AFCallbackHandlerThis 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:
handlein 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:
UnsupportedCallbackException- If the implementation of this method does not support one or more of the callbacks specified in thecallbacksparameter, anUnsupportedCallbackExceptionwill be thrown.IOException- If an input or output error occurs, anIOExceptionwill be thrown.
-