Class CompositeMetadata

  • All Implemented Interfaces:
    Serializable, org.glassfish.ha.store.api.Storeable

    public final class CompositeMetadata
    extends 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 Detail

      • CompositeMetadata

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

        public CompositeMetadata​(long version,
                                 long lastAccessTime,
                                 long maxInactiveInterval,
                                 Collection<SessionAttributeMetadata> entries,
                                 byte[] state,
                                 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 String getStringExtraParam()
      • setStringExtraParam

        public void setStringExtraParam​(String stringExtraParam)
      • getEntries

        public 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 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​(OutputStream os)
                                   throws IOException
        Specified by:
        _storeable_writeState in interface org.glassfish.ha.store.api.Storeable
        Throws:
        IOException
      • _storeable_readState

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