com.ca.commons.naming
Class DXEntry

java.lang.Object
  |
  +--com.ca.commons.naming.DXAttributes
        |
        +--com.ca.commons.naming.DXEntry
All Implemented Interfaces:
javax.naming.directory.Attributes, java.lang.Cloneable, java.io.Serializable

public class DXEntry
extends DXAttributes

This class is a wrapper for DXAttributes, that includes knowledge of the DN of the attributes set.

See Also:
Serialized Form

Field Summary
static int NEW
          This status constant implies that the entry is a new entry, that has not yet been written to the directory.
static int NEW_WRITTEN
          This status constant implies that the entry is a new entry, that has just been written to the directory, but may not yet have been added to the tree or re-displayed by the editor.
static int NORMAL
          This status constant implies that the entry is a 'normal' directory entry.
 
Constructor Summary
DXEntry()
          Constructors simply chain to DXAttributes...
DXEntry(javax.naming.directory.Attribute a)
           
DXEntry(javax.naming.directory.Attributes a)
           
DXEntry(javax.naming.directory.Attributes a, DN dn)
           
DXEntry(DN dn)
           
DXEntry(DXEntry copyMe)
           
DXEntry(java.util.Hashtable newAtts)
           
DXEntry(javax.naming.NamingEnumeration newAtts)
           
 
Method Summary
 DN getDN()
          Returns the DN of this entry, or an empty DN if none has been set.
 RDN getRDN()
          Returns the Entry's RDN.
 int getStatus()
          Returns the status of the entry as a status constant.
 java.lang.String getString(java.lang.String id)
          Utility class intended for recovering the value of a single value attribute as a string.
 java.lang.String getStringStatus()
          Returns the status of the entry as a readable string.
 boolean isNewEntry()
          Returns whether the entry is new, (or just written to the directory), or whether it already existed in the directory.
 javax.naming.directory.Attribute put(javax.naming.directory.Attribute attr)
          Intercept a DN being passed as an attribute (as might happen reading an ldif file);
 void putDN(DN dn)
          Add a DN directly, without using an attribute.
 void setDN(DN dn)
           
 void setStatus(int entryStatus)
          This is used to set what stage of the 'new entry' life cycle an entry is in - one of 'NORMAL', 'NEW', or 'NEW_WRITTEN'.
 java.lang.String toString()
          Provides a string representation of the entry, as a set of attributes preceeded by a header of form 'entry = '
 
Methods inherited from class com.ca.commons.naming.DXAttributes
attributesEqual, clone, emptyAtt, equals, equals, expandAllAttributes, get, getAdditionSet, getAll, getAllNonNull, getAllObjectClasses, getAllObjectClasses, getAsNonNullAttributes, getDeletionSet, getID, getIDs, getldapName, getMandatory, getObjectClassName, getOptional, getOrderedOCs, getParentObjectClasses, getReplacementSet, getSchema, hasOIDs, isCaseIgnored, print, print, printAttributeList, printAttributes, put, put, registerOID, remove, removeEmptyAttributes, setAllObjectClasses, setDefaultSchema, size, sortOCByDepth, toIDStringArray
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NORMAL

public static final int NORMAL
This status constant implies that the entry is a 'normal' directory entry.

See Also:
Constant Field Values

NEW

public static final int NEW
This status constant implies that the entry is a new entry, that has not yet been written to the directory.

See Also:
Constant Field Values

NEW_WRITTEN

public static final int NEW_WRITTEN
This status constant implies that the entry is a new entry, that has just been written to the directory, but may not yet have been added to the tree or re-displayed by the editor.

See Also:
Constant Field Values
Constructor Detail

DXEntry

public DXEntry()
Constructors simply chain to DXAttributes... (except for two which allow for a DN as well...)


DXEntry

public DXEntry(DN dn)

DXEntry

public DXEntry(javax.naming.directory.Attribute a)

DXEntry

public DXEntry(javax.naming.directory.Attributes a)

DXEntry

public DXEntry(javax.naming.directory.Attributes a,
               DN dn)

DXEntry

public DXEntry(java.util.Hashtable newAtts)

DXEntry

public DXEntry(javax.naming.NamingEnumeration newAtts)

DXEntry

public DXEntry(DXEntry copyMe)
Method Detail

put

public javax.naming.directory.Attribute put(javax.naming.directory.Attribute attr)
Intercept a DN being passed as an attribute (as might happen reading an ldif file);

Specified by:
put in interface javax.naming.directory.Attributes
Overrides:
put in class DXAttributes
Parameters:
attr - the attribute to add
Returns:
the previous attribute (if any) with this key.

setStatus

public void setStatus(int entryStatus)
This is used to set what stage of the 'new entry' life cycle an entry is in - one of 'NORMAL', 'NEW', or 'NEW_WRITTEN'. Almost all entries are 'NORMAL'. When an entry has just been created by an entry editor, it is 'NEW'. When it has just been written to the directory, it becomes 'NEW_WRITTEN'.

Parameters:
entryStatus - The status of the entry as a constant (one of {NORMAL, NEW, NEW_WRITTEN} ).

getStatus

public int getStatus()
Returns the status of the entry as a status constant. See status constants for more info.

Returns:
entry status as one of {NORMAL, NEW, NEW_WRITTEN}.

getStringStatus

public java.lang.String getStringStatus()
Returns the status of the entry as a readable string. See status constants for more info.

Returns:
entry status as one of "Normal", "New", or "Newly Written".

isNewEntry

public boolean isNewEntry()
Returns whether the entry is new, (or just written to the directory), or whether it already existed in the directory.

Returns:
true if entry status is NEW or NEW_WRITTEN.

putDN

public void putDN(DN dn)
Add a DN directly, without using an attribute.

Parameters:
dn - the distinguished name to add.

setDN

public void setDN(DN dn)

getDN

public DN getDN()
Returns the DN of this entry, or an empty DN if none has been set.

Returns:
the entry's distinguished name.

toString

public java.lang.String toString()
Provides a string representation of the entry, as a set of attributes preceeded by a header of form 'entry = '

Overrides:
toString in class DXAttributes

getString

public java.lang.String getString(java.lang.String id)
Utility class intended for recovering the value of a single value attribute as a string.

Parameters:
id - the attribute name
Returns:
the value of the attribute as a string.

getRDN

public RDN getRDN()
Returns the Entry's RDN.

Returns:
RDN the lowest RDN of the entry's DN - e.g. 'cn=fred' in 'cn=fred,ou=Frog Farmers,o=DemoCorp,c=au').