org.glassfish.web.ha.session.management
Class CompositeMetadata

java.lang.Object
  extended by org.glassfish.web.ha.session.management.CompositeMetadata
All Implemented Interfaces:
java.io.Serializable, org.glassfish.ha.store.api.Storeable

public final class CompositeMetadata
extends java.lang.Object
implements org.glassfish.ha.store.api.Storeable

A class to hold a collection of children SessionAttributeMetadata. This class is used mainly to store a collection of AttributeMetaData that are part of a WebSession. The metadata about the web session itself can be obtained directly from the CompositeMetadata itself, while the metadata of its attributes can be obtained from the individual SessionAttributeMetadata that is part of the collection returned by getEntries().

See Also:
Serialized Form

Constructor Summary
CompositeMetadata()
          Every Storeable must have a public no arg constructor
CompositeMetadata(long version, long lastAccessTime, long maxInactiveInterval, java.util.Collection<SessionAttributeMetadata> entries, byte[] state, java.lang.String stringExtraParam)
          Construct a CompositeMetadata object
 
Method Summary
 java.lang.String[] _storeable_getAttributeNames()
           
 boolean[] _storeable_getDirtyStatus()
           
 long _storeable_getLastAccessTime()
           
 long _storeable_getMaxIdleTime()
           
 long _storeable_getVersion()
           
 void _storeable_readState(java.io.InputStream is)
           
 void _storeable_setLastAccessTime(long lastAccessTime)
           
 void _storeable_setMaxIdleTime(long maxInactiveInterval)
           
 void _storeable_setVersion(long version)
           
 void _storeable_writeState(java.io.OutputStream os)
           
 java.util.Collection<SessionAttributeMetadata> getEntries()
          Returns a collection of Metadata (or its subclass).
 java.util.Map<java.lang.String,byte[]> getSessionAttributes()
           
 byte[] getState()
           
 java.lang.String getStringExtraParam()
           
 long getVersion()
           
 void setState(byte[] state)
           
 void setStringExtraParam(java.lang.String stringExtraParam)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeMetadata

public CompositeMetadata()
Every Storeable must have a public no arg constructor


CompositeMetadata

public CompositeMetadata(long version,
                         long lastAccessTime,
                         long maxInactiveInterval,
                         java.util.Collection<SessionAttributeMetadata> entries,
                         byte[] state,
                         java.lang.String stringExtraParam)
Construct a CompositeMetadata object

Parameters:
version - The version of the data. A freshly created state has a version == 0
lastAccessTime - the last access time of the state. This must be used in conjunction with getMaxInactiveInterval to determine if the state is idle enough to be removed.
maxInactiveInterval - the maximum time that this state can be idle in the store before it can be removed.
entries - the SessionAttributeMetadata that are part of this Metadata
Method Detail

getState

public byte[] getState()

setState

public void setState(byte[] state)

getStringExtraParam

public java.lang.String getStringExtraParam()

setStringExtraParam

public void setStringExtraParam(java.lang.String stringExtraParam)

getSessionAttributes

public java.util.Map<java.lang.String,byte[]> getSessionAttributes()

getEntries

public java.util.Collection<SessionAttributeMetadata> getEntries()
Returns a collection of Metadata (or its subclass). Note that though it is possible to have a compositeMetadata itself as part of this collection, typically they contain only AttributeMetaData

Returns:
a collection of SessionAttributeMetadata

getVersion

public long getVersion()

_storeable_getVersion

public long _storeable_getVersion()
Specified by:
_storeable_getVersion in interface org.glassfish.ha.store.api.Storeable

_storeable_setVersion

public void _storeable_setVersion(long version)
Specified by:
_storeable_setVersion in interface org.glassfish.ha.store.api.Storeable

_storeable_getLastAccessTime

public long _storeable_getLastAccessTime()
Specified by:
_storeable_getLastAccessTime in interface org.glassfish.ha.store.api.Storeable

_storeable_setLastAccessTime

public void _storeable_setLastAccessTime(long lastAccessTime)
Specified by:
_storeable_setLastAccessTime in interface org.glassfish.ha.store.api.Storeable

_storeable_getMaxIdleTime

public long _storeable_getMaxIdleTime()
Specified by:
_storeable_getMaxIdleTime in interface org.glassfish.ha.store.api.Storeable

_storeable_setMaxIdleTime

public void _storeable_setMaxIdleTime(long maxInactiveInterval)
Specified by:
_storeable_setMaxIdleTime in interface org.glassfish.ha.store.api.Storeable

_storeable_getAttributeNames

public java.lang.String[] _storeable_getAttributeNames()
Specified by:
_storeable_getAttributeNames in interface org.glassfish.ha.store.api.Storeable

_storeable_getDirtyStatus

public boolean[] _storeable_getDirtyStatus()
Specified by:
_storeable_getDirtyStatus in interface org.glassfish.ha.store.api.Storeable

_storeable_writeState

public void _storeable_writeState(java.io.OutputStream os)
                           throws java.io.IOException
Specified by:
_storeable_writeState in interface org.glassfish.ha.store.api.Storeable
Throws:
java.io.IOException

_storeable_readState

public void _storeable_readState(java.io.InputStream is)
                          throws java.io.IOException
Specified by:
_storeable_readState in interface org.glassfish.ha.store.api.Storeable
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2012 GlassFish Community. All Rights Reserved.