Class SessionAttributeMetadata

  • All Implemented Interfaces:
    Serializable

    public final class SessionAttributeMetadata
    extends Object
    implements Serializable
    AttributeMetadata contains the metadata of an attribute that is part of an Http Session. When a container decides to save a session it passes an instance of CompositeMetaData which contains a collection of AttributeMetadata.

    The attribute in question could have been deleted, or modified or could be a new attribute inside the HttpSession. getOperation() tells exactly what operation needs to be performed for this attribute

    The attribute state/data itself can be obtained with getState(). Since an attribute is part of a session, the attributes must be deleted when the session is removed. The CompositeMetadata contains the last access time and inactive timeout for the session.

    See Also:
    CompositeMetadata, Serialized Form
    • Constructor Detail

      • SessionAttributeMetadata

        public SessionAttributeMetadata​(String attributeName,
                                        SessionAttributeMetadata.Operation opcode,
                                        byte[] data)
        Construct an AtributeMetadata
        Parameters:
        attributeName - the attribute name
        opcode - The operation to be performed on the AttrbuteMetadata
        data - The attribute data
    • Method Detail

      • getAttributeName

        public String getAttributeName()
        Returns name of the attribute
        Returns:
        attribute name
      • getOperation

        public SessionAttributeMetadata.Operation getOperation()
        Get the operation to be performed on the attribute.
        Returns:
        the operation to be performed on this attribute
      • getState

        public byte[] getState()
        Get the attribute data
        Returns:
        the data
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object