amwebarsentitlementservice.container
Class ContainerDescriptorTable

java.lang.Object
  |
  +--amwebarsentitlementservice.container.ContainerDescriptorTable

public class ContainerDescriptorTable
extends java.lang.Object


Field Summary
static java.lang.String DESCRIPTOR_TABLE_XML_NAME
           
 
Constructor Summary
protected ContainerDescriptorTable()
           
 
Method Summary
 void clear()
          Removes all elements of the ContainerDescriptorTable.
protected  java.lang.Object clone()
          It isn't permited to clone the object: The clone method throws the CloneNotSupportedException.
 boolean containsContainerDescriptor(AMWebARSContainerDescriptor container_descriptor)
          Tests whether a container_descriptor is contained in the ContainerDescriptorTable.
 boolean containsContainerDescriptorID(java.lang.String container_type_id)
          Tests whether a ContainerDescriptor with given container_type_id is contained in the ContainerDescriptorTable.
 java.util.Enumeration elements()
          Generates an Enumeration containing all AMWebARSContainerDescriptors of that table.
 boolean equals(java.lang.Object other_object)
          Tests whether this ContainerDescriptorTable is equal to another.
 void fromXML(org.jdom.Document xml_descriptor_table)
          Updates the ContainerDescriptorTable from an XML datastructure.
 AMWebARSContainerDescriptor getContainerDescriptor(java.lang.String container_type_id)
          Returns a container_descriptor of a given container_descriptor_id.
 AMWebARSContainerDescriptor getContainerDescriptor(java.lang.String container_name, java.lang.String namespace)
          Returns a container_descriptor of a given container_descriptor_id.
 java.lang.String[] getContainerTypeIDArray()
          Generates an array that contains all container type ids of the ContainerDescriptorTable.
static ContainerDescriptorTable getInstance()
          Returns the only instance of the ContainerDescriptorTable.
 boolean isEmpty()
          Tests whether this Table contains no ContainerDescriptors.
 void load(java.io.InputStream in)
          Loads the ContainerDescriptorTable from an input stream.
 AMWebARSContainerDescriptor registerContainerDescriptor(java.lang.String container_type_id)
          Registers a new ContainerDescriptor in the ContainerDescriptorTable.
 AMWebARSContainerDescriptor registerContainerDescriptor(java.lang.String container_name, java.lang.String namespace)
          Registers a new ContainerDescriptor in the ContainerDescriptorTable.
 AMWebARSContainerDescriptor removeContainerDescriptor(AMWebARSContainerDescriptor container_descriptor)
          Removes a ContainerDescriptor from the ContainerDescriptorTable.
 AMWebARSContainerDescriptor removeContainerDescriptor(java.lang.String container_type_id)
          Removes a ContainerDescriptor with given container_type_id from the ContainerDescriptorTable.
 int size()
          Returns the size of the table that means the number of container_descriptor stored in it.
 void store(java.io.OutputStream out)
          Stores the ContainerDescriptorTable into an output stream.
 java.lang.String toString()
           
 org.jdom.Document toXML()
          Translates the ContainerDescriptorTable to XML.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DESCRIPTOR_TABLE_XML_NAME

public static final java.lang.String DESCRIPTOR_TABLE_XML_NAME
Constructor Detail

ContainerDescriptorTable

protected ContainerDescriptorTable()
Method Detail

getInstance

public static ContainerDescriptorTable getInstance()
Returns the only instance of the ContainerDescriptorTable.
Returns:
only instance of ContainerDescriptorTable

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
It isn't permited to clone the object: The clone method throws the CloneNotSupportedException.
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException -  

getContainerDescriptor

public AMWebARSContainerDescriptor getContainerDescriptor(java.lang.String container_type_id)
                                                   throws java.util.NoSuchElementException
Returns a container_descriptor of a given container_descriptor_id. If the container_descriptor isn't found an exception is thrown.
Parameters:
container_descriptor_id - String ID of the container_descriptor
Returns:
container_descriptor of given id.
Throws:
java.util.NoSuchElementException - If the container_descriptor isn't found.
NullPointerException - If parameter is null.

getContainerDescriptor

public AMWebARSContainerDescriptor getContainerDescriptor(java.lang.String container_name,
                                                          java.lang.String namespace)
                                                   throws java.util.NoSuchElementException
Returns a container_descriptor of a given container_descriptor_id. If the container_descriptor isn't found an exception is thrown.
Parameters:
container_descriptor_id - String ID of the container_descriptor
Returns:
container_descriptor of given id.
Throws:
java.util.NoSuchElementException - If the container_descriptor isn't found.
NullPointerException - If parameter is null.

registerContainerDescriptor

public AMWebARSContainerDescriptor registerContainerDescriptor(java.lang.String container_type_id)
Registers a new ContainerDescriptor in the ContainerDescriptorTable. The instance is generated by the ContainerDescriptorTable.
Parameters:
container_type_id - String ID of the ContainerDescriptor that is registered.
Returns:
generated ContainerDescriptor
Throws:
NullPointerException - if parameter is null

registerContainerDescriptor

public AMWebARSContainerDescriptor registerContainerDescriptor(java.lang.String container_name,
                                                               java.lang.String namespace)
Registers a new ContainerDescriptor in the ContainerDescriptorTable. The instance is generated by the ContainerDescriptorTable.
Parameters:
container_name - String name of the ContainerDescriptor that is registered.
namespace - String namespace of the ContainerDescriptor
Returns:
generated ContainerDescriptor
Throws:
NullPointerException - if parameter is null

removeContainerDescriptor

public AMWebARSContainerDescriptor removeContainerDescriptor(java.lang.String container_type_id)
                                                      throws java.util.NoSuchElementException
Removes a ContainerDescriptor with given container_type_id from the ContainerDescriptorTable. The removed ContainerDescriptor is returned.
Parameters:
String - container_type_id of the ContainerDescriptor to be removed
Returns:
removed ContainerDescriptor
Throws:
java.util.NoSuchElementException - if the ContainerDescriptor isn't found
NullPointerException - if parameter is null

removeContainerDescriptor

public AMWebARSContainerDescriptor removeContainerDescriptor(AMWebARSContainerDescriptor container_descriptor)
                                                      throws java.util.NoSuchElementException
Removes a ContainerDescriptor from the ContainerDescriptorTable. The removed ContainerDescriptor is returned.
Parameters:
container_descriptor - ContainerDescriptor to be removed
Returns:
removed ContainerDescriptor
Throws:
java.util.NoSuchElementException - if the ContainerDescriptor isn't found
NullPointerException - if parameter is null

containsContainerDescriptor

public boolean containsContainerDescriptor(AMWebARSContainerDescriptor container_descriptor)
Tests whether a container_descriptor is contained in the ContainerDescriptorTable.
Parameters:
container_descriptor - ContainerDescriptor to be looked for.
Returns:
boolean true, if the ContainerDescriptorTable contains the ContainerDescriptor
Throws:
NullPointerException - if parameter is null

containsContainerDescriptorID

public boolean containsContainerDescriptorID(java.lang.String container_type_id)
Tests whether a ContainerDescriptor with given container_type_id is contained in the ContainerDescriptorTable.
Parameters:
container_type_id - String ID of the ContainerDescriptor to be looked for.
Returns:
boolean true, if the ContainerDescriptorTable contains the ContainerDescriptor
Throws:
NullPointerException - if parameter is null

elements

public java.util.Enumeration elements()
Generates an Enumeration containing all AMWebARSContainerDescriptors of that table.
Returns:
Enumeration of AMWebARSContainerDescriptors

getContainerTypeIDArray

public java.lang.String[] getContainerTypeIDArray()
Generates an array that contains all container type ids of the ContainerDescriptorTable.
Returns:
String[] with all containter type ids availbale.

size

public int size()
Returns the size of the table that means the number of container_descriptor stored in it.
Returns:
int number of container_descriptors

isEmpty

public boolean isEmpty()
Tests whether this Table contains no ContainerDescriptors.
Returns:
boolean true if the table is empty

clear

public void clear()
Removes all elements of the ContainerDescriptorTable.

equals

public boolean equals(java.lang.Object other_object)
Tests whether this ContainerDescriptorTable 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()
Overrides:
toString in class java.lang.Object

toXML

public org.jdom.Document toXML()
Translates the ContainerDescriptorTable to XML.
Returns:
XML Document of the ContainerDescriptorTable

fromXML

public void fromXML(org.jdom.Document xml_descriptor_table)
             throws sun.io.MalformedInputException
Updates the ContainerDescriptorTable from an XML datastructure. The content of the table is overwritten.
Parameters:
xml_descriptor_table - Document that describes the table.

load

public void load(java.io.InputStream in)
          throws java.io.IOException,
                 org.jdom.JDOMException
Loads the ContainerDescriptorTable from an input stream. The input stream has to point to a source in XML format.
Parameters:
in - InputStream

store

public void store(java.io.OutputStream out)
           throws java.io.IOException
Stores the ContainerDescriptorTable into an output stream.
Parameters:
out - OutputStream