amwebarsentitlementservice.container
Class AMWebARSContainer

java.lang.Object
  |
  +--amwebarsentitlementservice.container.AMWebARSContainer
All Implemented Interfaces:
java.io.Serializable

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

See Also:
Serialized Form

Field Summary
static java.lang.String CONTAINER_TYPE_ID_XML_NAME
           
static java.lang.String PAYLOAD_XML_NAME
           
 
Constructor Summary
AMWebARSContainer(org.jdom.Element xml_container)
          Constructor for AMWebARSContainer.
AMWebARSContainer(java.lang.String container_type_id)
          Constructor for AMWebARSContainer.
AMWebARSContainer(java.lang.String container_name, java.lang.String namespace)
          Constructor for AMWebARSContainer.
 
Method Summary
 void clearProperties()
          Removes all values from the Container's Properties.
 boolean equals(java.lang.Object other_object)
          Tests whether this AMWebARSContainer is equal to another.
 java.lang.String getContainerName()
          Gets the container_name.
 java.lang.String getContainerTypeID()
          Gets the container_type_id.
 long getDate()
          Gets the date.
 AMWebARSContainerDescriptor getDescriptor()
          Gets the descriptor.
 java.lang.String getNamespacePrefix()
          Gets the namespace_prefix
 org.jdom.Element getPayload()
          Gets the payload.
 java.lang.String getProperty(java.lang.String key)
          Returns a Property value of the container's properies.
 java.lang.String getProperty(java.lang.String key, java.lang.String default_val)
          Returns a Property value of the container's properies.
 Subject getSubject()
          Gets the subject.
 TimeInterval getValidityInterval()
          Gets the validity_interval.
 boolean isPayloadValid()
          Tests whether the container's payload is valid.
 boolean isValidAt(java.util.Date date)
          Tests whether the container is valid at the given date.
 boolean isValidAt(long date)
           
 java.util.Enumeration propertyNames()
          Returns an Enumeration of all keys of the Container's Properties.
 void setDate(long date)
          Sets the date.
 void setPayload(org.jdom.Element payload)
          Sets the payload.
 java.lang.Object setProperty(java.lang.String key, java.lang.String value)
          Sets a Property value.
 void setSubject(Subject subject)
          Sets the subject.
 void setValidityInterval(TimeInterval validity_interval)
          Sets the validity_interval.
 java.util.Properties toProperties()
          Generates an Properies object for this Container.
 java.lang.String toString()
          Generates the String representation of the container
 org.jdom.Element toXML()
          Translates the Container to XML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTAINER_TYPE_ID_XML_NAME

public static final java.lang.String CONTAINER_TYPE_ID_XML_NAME

PAYLOAD_XML_NAME

public static final java.lang.String PAYLOAD_XML_NAME
Constructor Detail

AMWebARSContainer

public AMWebARSContainer(java.lang.String container_type_id)
Constructor for AMWebARSContainer.

AMWebARSContainer

public AMWebARSContainer(java.lang.String container_name,
                         java.lang.String namespace)
Constructor for AMWebARSContainer.

AMWebARSContainer

public AMWebARSContainer(org.jdom.Element xml_container)
                  throws sun.io.MalformedInputException
Constructor for AMWebARSContainer.
Method Detail

getContainerTypeID

public java.lang.String getContainerTypeID()
Gets the container_type_id.
Returns:
Returns a String

getNamespacePrefix

public java.lang.String getNamespacePrefix()
Gets the namespace_prefix
Returns:
Returns a String

getContainerName

public java.lang.String getContainerName()
Gets the container_name.
Returns:
Returns a String

getDescriptor

public AMWebARSContainerDescriptor getDescriptor()
Gets the descriptor.
Returns:
Returns a AMWebARSContainerDescriptor

getPayload

public org.jdom.Element getPayload()
Gets the payload.
Returns:
Returns a Document

setPayload

public void setPayload(org.jdom.Element payload)
Sets the payload.
Parameters:
payload - The payload to set

getSubject

public Subject getSubject()
Gets the subject.
Returns:
Returns a Subject

setSubject

public void setSubject(Subject subject)
Sets the subject.
Parameters:
subject - The subject to set

getValidityInterval

public TimeInterval getValidityInterval()
Gets the validity_interval.
Returns:
Returns a TimeInterval

setValidityInterval

public void setValidityInterval(TimeInterval validity_interval)
Sets the validity_interval.
Parameters:
validity_interval - The validity_interval to set

isValidAt

public boolean isValidAt(java.util.Date date)
Tests whether the container is valid at the given date. If the container doesn't support such a simple validity mechanism it returns false.
Parameters:
date - current date
Returns:
boolean true if the container is at this time valid.
Throws:
NullPointerException - if null is given as parameter

isValidAt

public boolean isValidAt(long date)

isPayloadValid

public boolean isPayloadValid()
Tests whether the container's payload is valid. That means that the payload validates under the ContainerDescriptor's payload format.
Returns:
boolean true if the payload validates under the payload format

getDate

public long getDate()
Gets the date.
Returns:
Returns a Date

setDate

public void setDate(long date)
Sets the date.
Parameters:
date - The date to set

getProperty

public java.lang.String getProperty(java.lang.String key)
Returns a Property value of the container's properies.
Parameters:
key - of the property
Returns:
value of the property, null if it's not set.

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String default_val)
Returns a Property value of the container's properies.
Parameters:
key - of the property
Returns:
value of the property, returns the default_val if it's not set.

setProperty

public java.lang.Object setProperty(java.lang.String key,
                                    java.lang.String value)
Sets a Property value.
Parameters:
key - of the property that's set
value - to set the property to
Returns:
the value of the Hashtable set before

propertyNames

public java.util.Enumeration propertyNames()
Returns an Enumeration of all keys of the Container's Properties.
Returns:
Enumeration of keys

clearProperties

public void clearProperties()
Removes all values from the Container's Properties.

toProperties

public java.util.Properties toProperties()
Generates an Properies object for this Container.
Returns:
Properties object. This corresponds to an AttributeList on the AccessManagers side.

equals

public boolean equals(java.lang.Object other_object)
Tests whether this AMWebARSContainer is equal to another.
Overrides:
equals in class java.lang.Object
Returns:
boolean true if both obj are the same.

toString

public java.lang.String toString()
Generates the String representation of the container
Overrides:
toString in class java.lang.Object
Returns:
String

toXML

public org.jdom.Element toXML()
Translates the Container to XML
Returns:
XML Element of the Container