Class StateCache<K,V> 
java.lang.Object
org.apache.myfaces.application.viewstate.StateCache<K,V> 
This class provides an interface to separate the state caching operations (saving/restoring)
 from the renderkit specific stuff that HtmlResponseStateManager should do.
- Author:
- Leonardo Uribe
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract Stringabstract KencodeSerializedState(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 StateTokenProcessorgetStateTokenProcessor(FacesContext context) abstract booleanisWriteStateAfterRenderViewRequired(FacesContext facesContext) Indicates if the call to ResponseStateManager.writeState should be done after the view is fully rendered.abstract VrestoreSerializedView(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 KsaveSerializedView(FacesContext facesContext, V serializedView) Put the state on the cache, to can be restored later.
- 
Constructor Details- 
StateCachepublic StateCache()
 
- 
- 
Method Details- 
saveSerializedViewPut the state on the cache, to can be restored later.- Parameters:
- facesContext-
- serializedView-
 
- 
restoreSerializedViewGet 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.- Parameters:
- facesContext-
- viewId- The viewId of the view to be restored
- viewState- A token usually retrieved from a call to ResponseStateManager.getState that will be used to identify or restore the state.
- Returns:
 
- 
encodeSerializedStateCalculate 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.- Parameters:
- facesContext-
- serializedView- The state that will be used to derive the token returned.
- Returns:
- A token (usually encoded on jakarta.faces.ViewState input hidden field) that will be passed to ResponseStateManager.writeState or ResponseStateManager.getViewState to be output to the client.
 
- 
isWriteStateAfterRenderViewRequiredIndicates if the call to ResponseStateManager.writeState should be done after the view is fully rendered. Usually this is required for client side state saving, but it is not for server side state saving, because ResponseStateManager.writeState could render a just a marker and then StateManager.saveState could be called, preventing use an additional buffer.- Parameters:
- facesContext-
- Returns:
 
- 
createCryptographicallyStrongTokenFromSession- Parameters:
- context-
- Returns:
- Since:
- 2.2
 
- 
getStateTokenProcessor
 
-