Package org.opensaml.storage.impl.client
Class LoadClientStorageServices
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.profile.action.AbstractProfileAction
-
- org.opensaml.storage.impl.client.LoadClientStorageServices
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction
public class LoadClientStorageServices extends AbstractProfileAction
An action that loads any number ofClientStorageServiceinstances from a POST submission or cookies as applicable.
-
-
Field Summary
Fields Modifier and Type Field Description private ClientStorageLoadContextclientStorageLoadCtxContext to drive storage load.static StringEXCEPTION_FORM_FIELDName of local storage form field containing value read.private org.slf4j.LoggerlogClass logger.private Map<String,ClientStorageService>storageServicesThe storage service instances to load.static StringSUCCESS_FORM_FIELDName of local storage form field signaling success/failure of a read operation.static StringSUPPORT_FORM_FIELDName of local storage form field containing local storage support indicator.private booleanuseLocalStorageWhether to allow for data loaded from local storage and submitted via POST.static StringVALUE_FORM_FIELDName of local storage form field containing value read.
-
Constructor Summary
Constructors Constructor Description LoadClientStorageServices()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(ProfileRequestContext profileRequestContext)protected booleandoPreExecute(ProfileRequestContext profileRequestContext)private voidloadFromCookie(ClientStorageService storageService, ClientStorageService.ClientStorageSource source)Load the specified storage service from a cookie.private voidloadFromLocalStorage(ClientStorageService storageService)Load the specified storage service from local storage data supplied in the POST.voidsetStorageServices(Collection<ClientStorageService> services)Set theClientStorageServiceinstances to check for loading.voidsetUseLocalStorage(boolean flag)Set whether to allow for data loaded from local storage and submitted via POST.-
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
SUPPORT_FORM_FIELD
@Nonnull @NotEmpty public static final String SUPPORT_FORM_FIELD
Name of local storage form field containing local storage support indicator.- See Also:
- Constant Field Values
-
SUCCESS_FORM_FIELD
@Nonnull @NotEmpty public static final String SUCCESS_FORM_FIELD
Name of local storage form field signaling success/failure of a read operation.- See Also:
- Constant Field Values
-
VALUE_FORM_FIELD
@Nonnull @NotEmpty public static final String VALUE_FORM_FIELD
Name of local storage form field containing value read.- See Also:
- Constant Field Values
-
EXCEPTION_FORM_FIELD
@Nonnull @NotEmpty public static final String EXCEPTION_FORM_FIELD
Name of local storage form field containing value read.- See Also:
- Constant Field Values
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
useLocalStorage
private boolean useLocalStorage
Whether to allow for data loaded from local storage and submitted via POST.
-
storageServices
@Nonnull @NonnullElements private Map<String,ClientStorageService> storageServices
The storage service instances to load.
-
clientStorageLoadCtx
@Nullable private ClientStorageLoadContext clientStorageLoadCtx
Context to drive storage load.
-
-
Method Detail
-
setUseLocalStorage
public void setUseLocalStorage(boolean flag)
Set whether to allow for data loaded from local storage and submitted via POST.- Parameters:
flag- flag to set
-
setStorageServices
public void setStorageServices(@Nonnull @NonnullElements Collection<ClientStorageService> services)
Set theClientStorageServiceinstances to check for loading.- Parameters:
services- instances to check for loading
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractProfileAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
loadFromCookie
private void loadFromCookie(@Nonnull ClientStorageService storageService, @Nonnull ClientStorageService.ClientStorageSource source)Load the specified storage service from a cookie.- Parameters:
storageService- service to loadsource- source to apply to load operation
-
loadFromLocalStorage
private void loadFromLocalStorage(@Nonnull ClientStorageService storageService)Load the specified storage service from local storage data supplied in the POST.- Parameters:
storageService- service to load
-
-