uk.org.ogsadai.sessions.impl
Class DynamicSessionAttribute

java.lang.Object
  |
  +--uk.org.ogsadai.sessions.impl.DynamicSessionAttribute
All Implemented Interfaces:
SessionAttribute

public class DynamicSessionAttribute
extends java.lang.Object
implements SessionAttribute

A dynamic session attribute is a session attribute with a value that can still be changed after creation.

Author:
The OGSA-DAI Project Team
See Also:
SessionAttribute

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private  javax.xml.namespace.QName mName
           
private  java.lang.Object mValue
           
 
Constructor Summary
DynamicSessionAttribute(javax.xml.namespace.QName name, java.lang.Object value)
          Constructs a dynamic session attribute with the specified name and value.
 
Method Summary
 javax.xml.namespace.QName getName()
          Gets the name of the session attribute.
 java.lang.Object getValue()
          Gets the value of the session attribute.
 boolean isChangable()
          Returns true if the setValue method is implemented, or otherwise false.
 void setValue(java.lang.Object value)
          Sets the value of the attribute.
 java.lang.String toString()
          Returns an XML string describing the attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

mName

private final javax.xml.namespace.QName mName

mValue

private java.lang.Object mValue
Constructor Detail

DynamicSessionAttribute

public DynamicSessionAttribute(javax.xml.namespace.QName name,
                               java.lang.Object value)
Constructs a dynamic session attribute with the specified name and value.

Parameters:
name - The qualified name of the session attribute.
value - The value of the session attribute.
Throws:
java.lang.IllegalArgumentException - If the name or value is null.
Method Detail

getName

public javax.xml.namespace.QName getName()
Description copied from interface: SessionAttribute
Gets the name of the session attribute.

Specified by:
getName in interface SessionAttribute
Returns:
the qualified name which must not be null

getValue

public java.lang.Object getValue()
Description copied from interface: SessionAttribute
Gets the value of the session attribute.

Specified by:
getValue in interface SessionAttribute
Returns:
the value object which may be null.

setValue

public void setValue(java.lang.Object value)
Description copied from interface: SessionAttribute
Sets the value of the attribute.

This method is optional. If it is not supported then an UnsupportedOperationException should be raised and the isChangable() method should return false.

Specified by:
setValue in interface SessionAttribute
Parameters:
value - The session attribute value which may be null.

isChangable

public boolean isChangable()
Description copied from interface: SessionAttribute
Returns true if the setValue method is implemented, or otherwise false.

Specified by:
isChangable in interface SessionAttribute
Returns:
changable value.

toString

public java.lang.String toString()
Returns an XML string describing the attribute.

This takes the following form:

 <dynamicSessionAttribute>
   <name>AttributeName</name>
   <value>AtributeValue</value>
 </dynamicSessionAttribute>
 
Where the attribute name and value are the result of applying toString to the corresponding objects, then replacing any XML reserved characters with their encoded equivalents.

Overrides:
toString in class java.lang.Object