wt.federation
Class DirectoryAttributeHolder

java.lang.Object
  extended bywt.federation.DirectoryAttributeHolder
All Implemented Interfaces:
AttributeHolder, Externalizable, Serializable

public class DirectoryAttributeHolder
extends Object
implements AttributeHolder, Externalizable



Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  Hashtable directoryAttributes
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  Hashtable translationTable
           
 
Constructor Summary
DirectoryAttributeHolder()
          Constructor returning an instance holding no attributes and no translation table.
DirectoryAttributeHolder(Hashtable attributes, Hashtable translationTable)
          Constructor returning an instance initialized to hold a specified set of attributes and an attribute name translation table.
 
Method Summary
 void addValue(String attr_name, Object value)
          Adds value to attribute.
 Enumeration getAttrNames()
          Returns all names of the attributes held by the object.
 Hashtable getDirectoryAttributes()
          Gets the value of the attribute: directoryAttributes.
 Object getSingleValue(String attr_name)
          Return one value associated with the attribute name.
 Hashtable getTranslationTable()
          Gets the value of the attribute: translationTable.
 Enumeration getValues(String attr_name)
          Returns the values associated with a given attribute name.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(DirectoryAttributeHolder thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void removeAttribute(String attr_name)
          Removes an attribute from the object (with all its values).
 void removeValue(String attr_name, Object value)
          Removes a specific value from the attribute.
 void replaceValue(String attr_name, Object value)
          Replaces object for all the current values of the attribute.
 void setDirectoryAttributes(Hashtable a_DirectoryAttributes)
          Sets the value of the attribute: directoryAttributes.
 void setTranslationTable(Hashtable a_TranslationTable)
          Sets the value of the attribute: translationTable.
 void setValue(String attr_name, Object value)
          Replaces object for all the current values of the attribute.
 String toString()
          Creates string representation of the attribute holder.
private  String translateKey(String key)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

directoryAttributes

private Hashtable directoryAttributes

translationTable

private Hashtable translationTable

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values
Constructor Detail

DirectoryAttributeHolder

public DirectoryAttributeHolder()
Constructor returning an instance holding no attributes and no translation table.

Supported API: true


DirectoryAttributeHolder

public DirectoryAttributeHolder(Hashtable attributes,
                                Hashtable translationTable)
Constructor returning an instance initialized to hold a specified set of attributes and an attribute name translation table.

Supported API: true

Parameters:
attributes -
translationTable -
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(DirectoryAttributeHolder thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getDirectoryAttributes

public Hashtable getDirectoryAttributes()
Gets the value of the attribute: directoryAttributes.

Supported API: false

Returns:
Hashtable

setDirectoryAttributes

public void setDirectoryAttributes(Hashtable a_DirectoryAttributes)
                            throws WTPropertyVetoException
Sets the value of the attribute: directoryAttributes.

Supported API: false

Parameters:
a_DirectoryAttributes -
Throws:
WTPropertyVetoException

getTranslationTable

public Hashtable getTranslationTable()
Gets the value of the attribute: translationTable.

Supported API: false

Returns:
Hashtable

setTranslationTable

public void setTranslationTable(Hashtable a_TranslationTable)
                         throws WTPropertyVetoException
Sets the value of the attribute: translationTable.

Supported API: false

Parameters:
a_TranslationTable -
Throws:
WTPropertyVetoException

getValues

public Enumeration getValues(String attr_name)
                      throws WTException
Returns the values associated with a given attribute name.

Supported API: false

Specified by:
getValues in interface AttributeHolder
Parameters:
attr_name -
Returns:
Enumeration
Throws:
WTException

getSingleValue

public Object getSingleValue(String attr_name)
                      throws WTException
Return one value associated with the attribute name. Handy method if one knows that the attribute holds just a single value. Returns null if no value is associated with the attribute.

Supported API: false

Specified by:
getSingleValue in interface AttributeHolder
Parameters:
attr_name -
Returns:
Object
Throws:
WTException

getAttrNames

public Enumeration getAttrNames()
                         throws WTException
Returns all names of the attributes held by the object.

Supported API: false

Specified by:
getAttrNames in interface AttributeHolder
Returns:
Enumeration
Throws:
WTException

addValue

public void addValue(String attr_name,
                     Object value)
              throws WTException
Adds value to attribute. Creates attribute if this is the first time.

Supported API: false

Specified by:
addValue in interface AttributeHolder
Parameters:
attr_name -
value -
Throws:
WTException

setValue

public void setValue(String attr_name,
                     Object value)
              throws WTException
Replaces object for all the current values of the attribute.

Supported API: false

Specified by:
setValue in interface AttributeHolder
Parameters:
attr_name -
value -
Throws:
WTException

replaceValue

public void replaceValue(String attr_name,
                         Object value)
                  throws WTException
Replaces object for all the current values of the attribute.

Supported API: false

Specified by:
replaceValue in interface AttributeHolder
Parameters:
attr_name -
value -
Throws:
WTException

removeValue

public void removeValue(String attr_name,
                        Object value)
                 throws WTException
Removes a specific value from the attribute. If the value is the last one the attribute is removed as well.

Supported API: false

Specified by:
removeValue in interface AttributeHolder
Parameters:
attr_name -
value -
Throws:
WTException

removeAttribute

public void removeAttribute(String attr_name)
                     throws WTException
Removes an attribute from the object (with all its values).

Supported API: false

Specified by:
removeAttribute in interface AttributeHolder
Parameters:
attr_name -
Throws:
WTException

toString

public String toString()
Creates string representation of the attribute holder.

Supported API: false

Specified by:
toString in interface AttributeHolder
Returns:
String

translateKey

private String translateKey(String key)