Class ServerSideStateHelper


  • public class ServerSideStateHelper
    extends StateHelper
    This StateHelper provides the functionality associated with server-side state saving, though in actuality, it is a hybrid between client and server.
    • Field Detail

      • STATEMANAGED_SERIAL_ID_KEY

        public static final String STATEMANAGED_SERIAL_ID_KEY
        Key to store the AtomicInteger used to generate unique state map keys.
      • LOGICAL_VIEW_MAP

        public static final String LOGICAL_VIEW_MAP
        The top level attribute name for storing the state structures within the session.
      • numberOfLogicalViews

        protected final Integer numberOfLogicalViews
        The number of logical views as configured by the user.
      • numberOfViews

        protected final Integer numberOfViews
        The number of views as configured by the user.
      • generateUniqueStateIds

        protected boolean generateUniqueStateIds
        Flag determining how server state IDs are generated.
      • random

        protected final SecureRandom random
        Used to generate unique server state IDs.
    • Constructor Detail

      • ServerSideStateHelper

        public ServerSideStateHelper()
        Construct a new ServerSideStateHelper instance.
    • Method Detail

      • getIntegerConfigValue

        protected Integer getIntegerConfigValue​(WebConfiguration.WebContextInitParameter param)

        Utility method for obtaining the Integer based configuration values used to change the behavior of the ServerSideStateHelper.

        Parameters:
        param - the paramter to parse
        Returns:
        the Integer representation of the parameter value
      • handleSaveState

        protected Object handleSaveState​(Object state)
        Parameters:
        state - the object returned from UIView.processSaveState
        Returns:
        If option SerializeServerState is true, serialize and return the state, otherwise, return state unchanged.
      • handleRestoreState

        protected Object handleRestoreState​(Object state)
        Parameters:
        state - the state as it was stored in the session
        Returns:
        an object that can be passed to UIViewRoot.processRestoreState. If option SerializeServerState true de-serialize the state prior to returning it, otherwise return state as is.