public abstract class StateCache<K,V> extends Object
Modifier and Type | Field and Description |
---|---|
static String |
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_LENGTH_PARAM
Set the default length of the random key used for the csrf session token.
|
static int |
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_LENGTH_PARAM_DEFAULT |
static String |
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_PARAM
Defines how to generate the csrf session token.
|
static String |
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_PARAM_DEFAULT |
static String |
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_RANDOM |
static String |
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM |
static String |
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_ALGORITM_PARAM
Sets the random algorithm to initialize the secure random id generator.
|
static String |
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_CLASS_PARAM
Sets the random class to initialize the secure random id generator.
|
static String |
RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_PROVIDER_PARAM
Sets the random provider to initialize the secure random id generator.
|
Constructor and Description |
---|
StateCache() |
Modifier and Type | Method and Description |
---|---|
abstract String |
createCryptographicallyStrongTokenFromSession(FacesContext context) |
abstract K |
encodeSerializedState(FacesContext facesContext,
Object serializedView)
Calculate the token to be used if server side state saving, or encode the view and return the
viewState that can be used by the underlying ResponseStateManager to write the state.
|
abstract boolean |
isWriteStateAfterRenderViewRequired(FacesContext facesContext)
Indicates if the call to ResponseStateManager.writeState should be done after the view is fully rendered.
|
abstract V |
restoreSerializedView(FacesContext facesContext,
String viewId,
K viewState)
Get the state from the cache is server side state saving is used,
or decode it from the passed viewState param if client side is used.
|
abstract K |
saveSerializedView(FacesContext facesContext,
V serializedView)
Put the state on the cache, to can be restored later.
|
@JSFWebConfigParam(since="2.2.0", expectedValues="secureRandom, random", defaultValue="none", group="state") public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_PARAM
public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_PARAM_DEFAULT
public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM
public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_RANDOM
@JSFWebConfigParam(since="2.2.0", defaultValue="16", group="state") public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_LENGTH_PARAM
public static final int RANDOM_KEY_IN_CSRF_SESSION_TOKEN_LENGTH_PARAM_DEFAULT
@JSFWebConfigParam(since="2.2.0", group="state") public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_CLASS_PARAM
@JSFWebConfigParam(since="2.2.0", group="state") public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_PROVIDER_PARAM
@JSFWebConfigParam(since="2.2.0", defaultValue="SHA1PRNG", group="state") public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM_ALGORITM_PARAM
public abstract K saveSerializedView(FacesContext facesContext, V serializedView)
facesContext
- serializedView
- public abstract V restoreSerializedView(FacesContext facesContext, String viewId, K viewState)
facesContext
- viewId
- The viewId of the view to be restoredviewState
- A token usually retrieved from a call to ResponseStateManager.getState that will be
used to identify or restore the state.public abstract K encodeSerializedState(FacesContext facesContext, Object serializedView)
facesContext
- state
- The state that will be used to derive the token returned.public abstract boolean isWriteStateAfterRenderViewRequired(FacesContext facesContext)
facesContext
- public abstract String createCryptographicallyStrongTokenFromSession(FacesContext context)
context
- Copyright © 2020 The Apache Software Foundation. All rights reserved.