Class StateCache<K,V>
- java.lang.Object
- 
- org.apache.myfaces.application.viewstate.StateCache<K,V>
 
- 
 public abstract class StateCache<K,V> extends Object 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 Constructor Description StateCache()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract StringcreateCryptographicallyStrongTokenFromSession(FacesContext context)abstract 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.
 
- 
- 
- 
Method Detail- 
saveSerializedViewpublic abstract K saveSerializedView(FacesContext facesContext, V serializedView) Put the state on the cache, to can be restored later.- Parameters:
- facesContext-
- serializedView-
 
 - 
restoreSerializedViewpublic 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.- 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:
 
 - 
encodeSerializedStatepublic 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.- 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.
 
 - 
isWriteStateAfterRenderViewRequiredpublic abstract boolean isWriteStateAfterRenderViewRequired(FacesContext facesContext) Indicates 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:
 
 - 
createCryptographicallyStrongTokenFromSessionpublic abstract String createCryptographicallyStrongTokenFromSession(FacesContext context) - Parameters:
- context-
- Returns:
- Since:
- 2.2
 
 - 
getStateTokenProcessorpublic abstract StateTokenProcessor getStateTokenProcessor(FacesContext context) 
 
- 
 
-