Class ReplicationStore

    • Constructor Detail

      • ReplicationStore

        public ReplicationStore​(JavaEEIOUtils ioUtils)
        Creates a new instance of ReplicationStore
    • Method Detail

      • valveSave

        public void valveSave​(Session session)
                       throws IOException
        Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.
        Parameters:
        session - Session to be saved
        Throws:
        IOException - if an input/output error occurs
      • doValveSave

        public void doValveSave​(Session session)
                         throws IOException
        Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.
        Parameters:
        session - Session to be saved
        Throws:
        IOException - if an input/output error occurs
      • cleanup

        public void cleanup()
      • getSessions

        public BaseCache getSessions()
      • setSessions

        public void setSessions​(BaseCache sesstable)
      • stop

        public void stop()
        Description copied from class: StoreBase
        Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component.
        Specified by:
        stop in interface Lifecycle
        Overrides:
        stop in class StoreBase
      • save

        public void save​(Session session)
                  throws IOException
        Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.
        Parameters:
        session - Session to be saved
        Throws:
        IOException - if an input/output error occurs
      • isReplicationCompressionEnabled

        protected boolean isReplicationCompressionEnabled()
      • doSave

        public void doSave​(Session session)
                    throws IOException
        Save the specified Session into this Store. Any previously saved information for the associated session identifier is replaced.
        Parameters:
        session - Session to be saved
        Throws:
        IOException - if an input/output error occurs
      • clear

        public void clear()
                   throws IOException
        Clear sessions
        Throws:
        IOException - if an input/output error occurs
      • doRemove

        public void doRemove​(String id)
                      throws IOException
        Remove the Session with the specified session identifier from this Store, if present. If no such Session is present, this method takes no action.
        Overrides:
        doRemove in class HAStoreBase
        Parameters:
        id - Session identifier of the Session to be removed
        Throws:
        IOException - if an input/output error occurs
      • removeSynchronized

        public void removeSynchronized​(String id)
                                throws IOException
        Remove the Session with the specified session identifier from this Store, if present. If no such Session is present, this method takes no action.
        Overrides:
        removeSynchronized in class HAStoreBase
        Parameters:
        id - Session identifier of the Session to be removed
        Throws:
        IOException - if an input/output error occurs
      • processExpires

        public void processExpires()
        Called by our background reaper thread to remove expired sessions in the replica - this can be done on the same instance - i.e. each instance will do its own
        Overrides:
        processExpires in class StoreBase
      • removeExpiredSessions

        public int removeExpiredSessions()
        This method deletes all the sessions corresponding to the "appId" that should be expired
        Returns:
        number of removed sessions
      • load

        public Session load​(String id)
                     throws ClassNotFoundException,
                            IOException
        Load and return the Session associated with the specified session identifier from this Store, without removing it. If there is no such stored Session, return null.
        Parameters:
        id - Session identifier of the session to load
        Throws:
        ClassNotFoundException - if a deserialization error occurs
        IOException - if an input/output error occurs
      • load

        public Session load​(String id,
                            String version)
                     throws ClassNotFoundException,
                            IOException
        Description copied from class: StoreBase
        Load and return the Session associated with the specified session identifier from this Store, without removing it. If there is no such stored Session, return null.
        Overrides:
        load in class StoreBase
        Parameters:
        id - Session identifier of the session to load
        version - The requested session version
        Throws:
        ClassNotFoundException - if a deserialization error occurs
        IOException - if an input/output error occurs
      • updateLastAccessTime

        public void updateLastAccessTime​(Session session)
                                  throws IOException
        update the lastaccess time of the specified Session into this Store.
        Parameters:
        session - Session to be saved
        Throws:
        IOException - if an input/output error occurs
      • keys

        public String[] keys()
                      throws IOException
        Return an array containing the session identifiers of all Sessions currently saved in this Store. If there are no such Sessions, a zero-length array is returned.
        Throws:
        IOException - if an input/output error occurred
      • getUniqueId

        protected long getUniqueId()