org.pf.directory.ldap
Class LDAPDirEntry

java.lang.Object
  extended by org.pf.directory.MultiValueAttributes
      extended by org.pf.directory.DirectoryObject
          extended by org.pf.directory.ldap.LDAPDirEntry
All Implemented Interfaces:
AttributeReadAccess
Direct Known Subclasses:
LDAPDirEntryContainer

public class LDAPDirEntry
extends DirectoryObject

Represents an object from a LDAP directory

Version:
1.1
Author:
M.Duchrow

Field Summary
static java.lang.String ATTRNAME_CREATE_TIMESTAMP
           
static java.lang.String ATTRNAME_CREATORS_NAME
           
static java.lang.String ATTRNAME_MODIFIERS_NAME
           
static java.lang.String ATTRNAME_MODIFY_TIMESTAMP
           
static java.lang.String ATTRNAME_NAMING_CONTEXTS
           
static java.lang.String ATTRNAME_SUBSCHEMA_SUBENTRY
           
 
Constructor Summary
LDAPDirEntry(DistinguishedName dn)
          Initialize the new instance with its distinguished name.
LDAPDirEntry(LDAPDirEntry dirObject)
          Initialize the new instance with the given entry data.
LDAPDirEntry(java.lang.String dn)
          Initialize the new instance with its dn.
 
Method Summary
 java.lang.String getCreateTimestamp()
          Returns the creation timestamp of this object
 DistinguishedName getDistinguishedName()
          Returns the distinguished name of this object
 java.lang.String getDN()
          Returns the distinguished name of this object.
 java.lang.String getModifyTimestamp()
          Returns the modification timestamp of this object
 boolean isContainer()
          Returns true if this entry is a container object that can contain other entries as children.
 void setAttribute(java.lang.String attrName, java.lang.String attrValue)
          Sets the attribute with the given name to the given value.
 void setCreateTimestamp(java.lang.String timestamp)
          Sets the creation timestamp of this object to the given value.
 void setModifyTimestamp(java.lang.String timestamp)
          Sets the modification timestamp of this object to the given value.
 java.lang.String toString()
          Returns a string representation of this object
 void updateFrom(MultiValueAttributes attributes)
          Add the given attributes to this LDAP entry
 void updateModifyTimestamp()
          Sets the modification timestamp to the current date/time
 void updateTimestamps()
          Sets the creation and modification timestamps to the current date/time
 
Methods inherited from class org.pf.directory.DirectoryObject
equals, getID, hashCode, matches
 
Methods inherited from class org.pf.directory.MultiValueAttributes
addAttribute, addValue, addValue, getAttribute, getAttributeAsString, getAttributeAsStringArray, getAttributeNames, getAttributeValue, getCopyOfAttributes, getMetaData, getValue, getValues, hasAttribute, isEmpty, removeAttribute, removeValue, setMetaData, size
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRNAME_CREATE_TIMESTAMP

public static final java.lang.String ATTRNAME_CREATE_TIMESTAMP
See Also:
Constant Field Values

ATTRNAME_MODIFY_TIMESTAMP

public static final java.lang.String ATTRNAME_MODIFY_TIMESTAMP
See Also:
Constant Field Values

ATTRNAME_CREATORS_NAME

public static final java.lang.String ATTRNAME_CREATORS_NAME
See Also:
Constant Field Values

ATTRNAME_MODIFIERS_NAME

public static final java.lang.String ATTRNAME_MODIFIERS_NAME
See Also:
Constant Field Values

ATTRNAME_SUBSCHEMA_SUBENTRY

public static final java.lang.String ATTRNAME_SUBSCHEMA_SUBENTRY
See Also:
Constant Field Values

ATTRNAME_NAMING_CONTEXTS

public static final java.lang.String ATTRNAME_NAMING_CONTEXTS
See Also:
Constant Field Values
Constructor Detail

LDAPDirEntry

public LDAPDirEntry(java.lang.String dn)
Initialize the new instance with its dn.

Parameters:
dn - The distinguished name of the new object.

LDAPDirEntry

public LDAPDirEntry(DistinguishedName dn)
Initialize the new instance with its distinguished name.

Parameters:
dn - The distinguished name of the new object.

LDAPDirEntry

public LDAPDirEntry(LDAPDirEntry dirObject)
Initialize the new instance with the given entry data. Actually that means creating a copy.

Method Detail

getDistinguishedName

public DistinguishedName getDistinguishedName()
Returns the distinguished name of this object


getCreateTimestamp

public java.lang.String getCreateTimestamp()
Returns the creation timestamp of this object


getModifyTimestamp

public java.lang.String getModifyTimestamp()
Returns the modification timestamp of this object


setCreateTimestamp

public void setCreateTimestamp(java.lang.String timestamp)
Sets the creation timestamp of this object to the given value.

Parameters:
timestamp - A valid LDAP timestamp string of format "yyyyMMddHHmmssZ"

setModifyTimestamp

public void setModifyTimestamp(java.lang.String timestamp)
Sets the modification timestamp of this object to the given value.

Parameters:
timestamp - A valid LDAP timestamp string of format "yyyyMMddHHmmssZ"

updateTimestamps

public void updateTimestamps()
Sets the creation and modification timestamps to the current date/time


updateModifyTimestamp

public void updateModifyTimestamp()
Sets the modification timestamp to the current date/time


setAttribute

public void setAttribute(java.lang.String attrName,
                         java.lang.String attrValue)
Sets the attribute with the given name to the given value. If the attribute already exists its value will be replaced, otherwise the attribute gets created with the given value as initial value.

Parameters:
attrName - The name of the attribute to set
attrValue - The value to set

getDN

public java.lang.String getDN()
Returns the distinguished name of this object.


isContainer

public boolean isContainer()
Returns true if this entry is a container object that can contain other entries as children.

Here it always returns false. Subclasses must override this method to return true if appropriate.


updateFrom

public void updateFrom(MultiValueAttributes attributes)
Add the given attributes to this LDAP entry


toString

public java.lang.String toString()
Returns a string representation of this object

Overrides:
toString in class java.lang.Object