Class ReplicationAttributeStore
- java.lang.Object
-
- org.apache.catalina.session.StoreBase
-
- org.glassfish.web.ha.session.management.HAStoreBase
-
- org.glassfish.web.ha.session.management.ReplicationStore
-
- org.glassfish.web.ha.session.management.ReplicationAttributeStore
-
public class ReplicationAttributeStore extends ReplicationStore
- Author:
- Larry White, Rajiv Mordani
-
-
Field Summary
-
Fields inherited from class org.glassfish.web.ha.session.management.HAStoreBase
_debug, _logLevel, applicationId, clusterId, ioUtils
-
Fields inherited from class org.apache.catalina.session.StoreBase
debug, info, lifecycle, manager, started, storeName, support
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description ReplicationAttributeStore(JavaEEIOUtils ioUtils)
Creates a new instance of ReplicationAttributeStore
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doSave(Session session)
Save the specified Session into this Store.void
doValveSave(Session session)
Save the specified Session into this Store.protected Object
getAttributeValue(byte[] state)
Given a byte[] containing session data, return a session objectprotected Object
getAttributeValueCollection(byte[] state)
Given a byte[] containing session data, return a session objectprotected byte[]
getByteArray(Object attributeValue)
Create an byte[] for the session that we can then pass to the HA Store.protected byte[]
getByteArrayFromCollection(Collection entries)
Create an byte[] for the session that we can then pass to the HA Store.Session
getSession(CompositeMetadata metadata)
Session
load(String id, String version)
Load and return the Session associated with the specified session identifier from this Store, without removing it.protected void
loadAttributes(ModifiedAttributeHASession modifiedAttributeSession, Collection attributeList)
Given a session, load its attributesvoid
save(Session session)
Save the specified Session into this Store.void
valveSave(Session session)
Save the specified Session into this Store.-
Methods inherited from class org.glassfish.web.ha.session.management.ReplicationStore
cleanup, clear, doRemove, getApplicationId, getSession, getSessions, getSize, getUniqueId, isReplicationCompressionEnabled, keys, load, processExpires, removeExpiredSessions, removeSynchronized, setSessions, stop, updateLastAccessTime
-
Methods inherited from class org.glassfish.web.ha.session.management.HAStoreBase
debug, getByteArray, getByteArray, getClusterId, getClusterIdFromConfig, remove, setLogLevel
-
Methods inherited from class org.apache.catalina.session.StoreBase
addLifecycleListener, addPropertyChangeListener, doProcessExpires, findLifecycleListeners, getDebug, getInfo, getManager, getStoreName, log, readSession, removeFromStoreCache, removeLifecycleListener, removePropertyChangeListener, setDebug, setManager, start, writeSession
-
-
-
-
Constructor Detail
-
ReplicationAttributeStore
public ReplicationAttributeStore(JavaEEIOUtils ioUtils)
Creates a new instance of ReplicationAttributeStore
-
-
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.- Overrides:
valveSave
in classReplicationStore
- Parameters:
session
- Session to be saved- Throws:
IOException
- if an input/output error occurs
-
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.- Specified by:
save
in interfaceStore
- Overrides:
save
in classReplicationStore
- 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.- Overrides:
doValveSave
in classReplicationStore
- Parameters:
session
- Session to be saved- Throws:
IOException
- if an input/output error occurs
-
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.- Overrides:
doSave
in classReplicationStore
- Parameters:
session
- Session to be saved- Throws:
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, returnnull
.- Overrides:
load
in classReplicationStore
- Parameters:
id
- Session identifier of the session to loadversion
- The requested session version- Throws:
ClassNotFoundException
- if a deserialization error occursIOException
- if an input/output error occurs
-
getSession
public Session getSession(CompositeMetadata metadata) throws IOException
- Throws:
IOException
-
getByteArray
protected byte[] getByteArray(Object attributeValue) throws IOException
Create an byte[] for the session that we can then pass to the HA Store.- Parameters:
attributeValue
- The attribute value we are serializing- Throws:
IOException
-
getAttributeValue
protected Object getAttributeValue(byte[] state) throws IOException, ClassNotFoundException
Given a byte[] containing session data, return a session object- Parameters:
state
- The byte[] with the session attribute data- Returns:
- A newly created object for the given session attribute data
- Throws:
IOException
ClassNotFoundException
-
getByteArrayFromCollection
protected byte[] getByteArrayFromCollection(Collection entries) throws IOException
Create an byte[] for the session that we can then pass to the HA Store.- Parameters:
entries
- The Collection of entries we are serializing- Throws:
IOException
-
getAttributeValueCollection
protected Object getAttributeValueCollection(byte[] state) throws IOException, ClassNotFoundException
Given a byte[] containing session data, return a session object- Parameters:
state
- The byte[] with the session attribute data- Returns:
- A newly created object for the given session attribute data
- Throws:
IOException
ClassNotFoundException
-
loadAttributes
protected void loadAttributes(ModifiedAttributeHASession modifiedAttributeSession, Collection attributeList)
Given a session, load its attributes- Parameters:
modifiedAttributeSession
- The session (header info only) having its attributes loadedattributeList
- The Listlist of loaded attributes
-
-