FileDocCategorySizeDatePackage
AttributeMetadata.javaAPI DocGlassfish v2 API5014Fri May 04 22:35:26 BST 2007com.sun.appserv.ha.spi

AttributeMetadata

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

Fields Summary
private String
attributeName
private Operation
opcode
private byte[]
data
Constructors Summary
public AttributeMetadata(String attributeName, Operation opcode, byte[] data)
Construct an AtributeMetadata

param
attributeName the attribute name
param
opcode The operation to be performed on the AttrbuteMetadata
param
data The attribute data

        this.attributeName = attributeName;
        this.opcode = opcode;
        this.data = data;
    
Methods Summary
public booleanequals(java.lang.Object obj)

        if(this == obj) {
            return true;
        }
        if(!(obj instanceof AttributeMetadata) || obj == null) {
            return false;
        }
        AttributeMetadata otherAttributeMetadata = (AttributeMetadata)obj;
        if(getAttributeName() == null) {
            if(otherAttributeMetadata.getAttributeName() == null) { 
                return true;
            } else {
                return false;
            }
        } else {
            if(otherAttributeMetadata.getAttributeName() == null) { 
                return false;
            } else {
                return getAttributeName().equalsIgnoreCase(otherAttributeMetadata.getAttributeName());
            }          
        }                
    
public java.lang.StringgetAttributeName()
Returns name of the attribute

return
attribute name

        return attributeName;
    
public com.sun.appserv.ha.spi.AttributeMetadata$OperationgetOperation()
Get the operation to be performed on the attribute.

return
the operation to be performed on this attribute

        return opcode;
    
public byte[]getState()
Get the attribute data

return
the data

        return data;
    
public inthashCode()

        int hash = 1;
        hash = hash * 31
                + (attributeName == null ? 0 : attributeName.hashCode());
        return hash;