uk.org.ogsadai.sessions.impl
Class StaticSessionAttribute

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

public class StaticSessionAttribute
extends java.lang.Object
implements SessionAttribute

A static session attribute is a session attribute with a value that cannot be changed after creation.

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

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  javax.xml.namespace.QName mName
          Name of the attribute
private  java.lang.Object mValue
          Value of the attribute
 
Constructor Summary
StaticSessionAttribute(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
Copyright statement

See Also:
Constant Field Values

mName

private final javax.xml.namespace.QName mName
Name of the attribute


mValue

private final java.lang.Object mValue
Value of the attribute

Constructor Detail

StaticSessionAttribute

public StaticSessionAttribute(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:

 <staticSessionAttribute>
   <name>AttributeName</name>
   <value>AtributeValue</value>
 </staticSessionAttribute>
 
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