org.aselect.server.processor
Class AttributesMulti

java.lang.Object
  extended by org.aselect.server.processor.AttributesMulti

public class AttributesMulti
extends java.lang.Object

A collection of NMVPairs. Duplicate names are not allowed.

Description:
A collection of NMVPairs. Duplicate names are not allowed. They will be stored as a list under the key. Attributes can be encoded as a URLEncoded string.

Concurrency issues:
-

Author:
Alfa & Ariss

Constructor Summary
AttributesMulti()
          Create an empty AttributesMulti
Description:
Initializes the attributes.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-
AttributesMulti(java.util.Hashtable htAttributes)
          Create a AttributesMulti object from a Hashtable (containing Strings and Vectors).
AttributesMulti(java.lang.String urlEncoded)
          Create a new AttributesMulti, based on a URL encoded name/value string.
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
          Add a new name, value pair to the list of attributes.
 void addAttributes(java.lang.String name, java.util.Vector values)
          Add a new NVPair to the list of attributes.
 java.lang.String getAttribute(java.lang.String name)
          Get the attribute by name (will only return the first one if it is a multivalued attribute.)

Concurrency issues:
-

Preconditions:
-

Postconditions:
-
 java.util.List getAttributes(java.lang.String name)
          Get a list of attributes corresponding to the name.
 void remove(java.lang.String key)
          Remove attribute from the list.
 java.lang.String toEncodedString()
          URLEncode the attributes.
 java.util.Hashtable toHashtable()
          Create a hashtable (mixed with Vectors and String) based on this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributesMulti

public AttributesMulti()
Create an empty AttributesMulti
Description:
Initializes the attributes.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-


AttributesMulti

public AttributesMulti(java.lang.String urlEncoded)
                throws ASelectException
Create a new AttributesMulti, based on a URL encoded name/value string.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
urlEncoded - URL encoded string with attributes
Throws:
ASelectException - if creation fails

AttributesMulti

public AttributesMulti(java.util.Hashtable htAttributes)
Create a AttributesMulti object from a Hashtable (containing Strings and Vectors).

Description:
Instantiates a new object with the same values as the Hashtable.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
htAttributes - A Hashtable to create the object from.
Method Detail

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
Add a new name, value pair to the list of attributes. If the name already exists, it will be added to the name.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
name - The name of the pair
value - The value of the pair.

addAttributes

public void addAttributes(java.lang.String name,
                          java.util.Vector values)
Add a new NVPair to the list of attributes.

Description:
Add a new NVPair to the list of attributes.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
name - The name of the attribute
values - The values to add to the attribute.

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Get the attribute by name (will only return the first one if it is a multivalued attribute.)

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
name - The name of the attribute to retrieve.
Returns:
The attribute value (will only return the first one if it is a multivalued attribute).

getAttributes

public java.util.List getAttributes(java.lang.String name)
Get a list of attributes corresponding to the name.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
name - The name of the attribute to retrieve.
Returns:
The list of values;

remove

public void remove(java.lang.String key)
Remove attribute from the list.


Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
key - The attribute to remove.

toHashtable

public java.util.Hashtable toHashtable()
Create a hashtable (mixed with Vectors and String) based on this object.

Description:
Create a hashtable (mixed with Vectors and String) based on this object.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
The hashtable containing the attributes.

toEncodedString

public java.lang.String toEncodedString()
URLEncode the attributes.
Description:
URLEncode the attributes which are present in this object.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
The encoded string.


Copyright © 2008 SURFnet BV. All Rights Reserved.