com.novell.service.session
Class SessionAttrs

java.lang.Object
  |
  +--com.novell.service.session.SessionAttrs

public class SessionAttrs
extends java.lang.Object
implements java.io.Serializable

Provides for a collection of session attribute objects (SessionAttr).


Constructor Summary
SessionAttrs()
          Construct a new instance of a SessionAttrs object.
 
Method Summary
 void add(SessionAttr attr)
          Adds a new session attribute (attr) to this set.
 void add(java.lang.String attrId, java.lang.Object value)
          Adds a new session attribute to this set identified by attrId and value parameters.
 int count()
          Returns the number of attributes in this set.
 SessionAttr get(java.lang.String attrId)
          Returns the session attribute with the given session attribute ID from this set.
 SessionAttrEnumerator getAttributes()
          Returns an enumeration of the attributes in this set.
 java.util.Enumeration getSessionAttrIds()
          Returns an enumeration of the IDs of the attributes in this set.
 java.lang.Object getValue(java.lang.String attrId)
          Returns the session attribute with the passed-in session attribute ID from this set.
 boolean matchesSubset(SessionAttrs subSet)
          Compares the passed-in attribute set with this SessionAttrs set.
 void merge(SessionAttrs attributeSet)
          Merges two SessionAttrs specified in the passed in attributeSet parameter.
 void modify(SessionAttr attr)
          Replaces the session attribute identified by the session attribute ID of attr, or adds the session attribute if it does not exist.
 void modify(SessionAttrs attributeSet)
          Replaces the attributes in this set by those in attributeSet, or adds any that do not exist.
 void modify(java.lang.String attrId, java.lang.Object value)
          Replaces the session attribute identified by attrId with value, or adds it if it does not exist.
 void remove(java.lang.String attrId)
          Removes from this set the session attribute specified in the passed in attrId parameter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SessionAttrs

public SessionAttrs()
             throws SessionException
Construct a new instance of a SessionAttrs object.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.
Method Detail

add

public void add(SessionAttr attr)
         throws SessionException
Adds a new session attribute (attr) to this set. If a session attribute already exists with the same ID as attr, the SessionAttrInUseException is throw.
Parameters:
attr - The new session attribute to add.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.

add

public void add(java.lang.String attrId,
                java.lang.Object value)
         throws SessionException
Adds a new session attribute to this set identified by attrId and value parameters. If a session attribute already exists with the same ID as attr, the SessionAttrInUseException is thrown.
Parameters:
attrId - The new attribute ID to add.
value - The new attribute value to add.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.
SessionAttrInUseException - Thrown if attrId already exists.

count

public int count()
          throws SessionException
Returns the number of attributes in this set.
Returns:
The number of attributes in the set.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.

get

public SessionAttr get(java.lang.String attrId)
                throws SessionException
Returns the session attribute with the given session attribute ID from this set. If no attrId matches, the SessionAttrNotFoundException is thrown.
Parameters:
attrId - The attribute ID to match.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.
SessionAttrNotFoundException - Thrown if no attrId matches.

getValue

public java.lang.Object getValue(java.lang.String attrId)
                          throws SessionException
Returns the session attribute with the passed-in session attribute ID from this set.
Returns:
An object containing the session attribute value.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.

getSessionAttrIds

public java.util.Enumeration getSessionAttrIds()
                                        throws SessionException
Returns an enumeration of the IDs of the attributes in this set.
Returns:
An Enumeration of attribute IDs.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.

getAttributes

public SessionAttrEnumerator getAttributes()
                                    throws SessionException
Returns an enumeration of the attributes in this set.
Returns:
An enumeration of the attributes in this set.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.

modify

public void modify(SessionAttr attr)
            throws SessionException
Replaces the session attribute identified by the session attribute ID of attr, or adds the session attribute if it does not exist.
Parameters:
attr - The session attribute to replace or add.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.

modify

public void modify(java.lang.String attrId,
                   java.lang.Object value)
            throws SessionException
Replaces the session attribute identified by attrId with value, or adds it if it does not exist.
Parameters:
attrId - The attribute ID to replace or add.
value - The attribute value to replace or add.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.

modify

public void modify(SessionAttrs attributeSet)
            throws SessionException
Replaces the attributes in this set by those in attributeSet, or adds any that do not exist.
Parameters:
attributeSet - The attribute set to use during replace/modify.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.

remove

public void remove(java.lang.String attrId)
            throws SessionException
Removes from this set the session attribute specified in the passed in attrId parameter. If the session attribute does not exist, the request is ignored.
Parameters:
attrId - The attribute ID to remove.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.

merge

public void merge(SessionAttrs attributeSet)
           throws SessionException
Merges two SessionAttrs specified in the passed in attributeSet parameter. SessionAttrs existing in both sets will not be merged, leaving the original SessionAttr.
Parameters:
attributeSet - The attribute set to merge.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.

matchesSubset

public boolean matchesSubset(SessionAttrs subSet)
                      throws SessionException
Compares the passed-in attribute set with this SessionAttrs set.
Parameters:
subSet - The attribute set to match.
Returns:
A boolean set to TRUE if the passed in attribute set is a subset of this set and all attributes match, otherwise set to FALSE.
Throws:
SessionException - A top-level exception thrown by Session objects. May be a subclass of SessionException.