Class NameStoringHandler
java.lang.Object
de.aristaflow.adept2.base.security.callbackhandler.NameStoringHandler
- All Implemented Interfaces:
AFCallbackHandler
A wrapping callback handler storing the name provided to a
NameCallback. This allows for correct name-based delay.
Otherwise an attack would be possible by not providing the name directly but
only via the callback handler.- Author:
- Ulrich Kreher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe name provided to aNameCallback.protected final AFCallbackHandlerThe callback handler for all callbacks. -
Constructor Summary
ConstructorsConstructorDescriptionNameStoringHandler(AFCallbackHandler wrapped) Creates a callback handler storing the name provided to aNameCallbackby the wrappedAFCallbackHandler. -
Method Summary
Modifier and TypeMethodDescriptiongetName()Gets the name that has been provided to aNameCallbackornullin case there has not been aNameCallback.Callback[]This method is similar toCallbackHandler.handle(Callback[])but returns the provided callbacks back to the caller.
-
Field Details
-
name
The name provided to aNameCallback. -
wrapped
The callback handler for all callbacks.
-
-
Constructor Details
-
NameStoringHandler
Creates a callback handler storing the name provided to aNameCallbackby the wrappedAFCallbackHandler.- Parameters:
wrapped- TheAFCallbackHandlerto which all callbacks will be forwarded. This must not benull.
-
-
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.
-
getName
Gets the name that has been provided to aNameCallbackornullin case there has not been aNameCallback.- Returns:
- The name that has been provided to a
NameCallbackornullin case there has not been aNameCallback.
-