|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.infoengine.util.LdapEntry
Represents an entry within an LDAP directory.
Instances of this class can only be instantiated through their corresponding LdapDirectory implementation.
LdapDirectory
Field Summary | |
private Vector |
createdDns
|
private Vector |
deletedAttrs
|
private LdapDirectory |
directory
|
private String |
dn
|
private Group |
entry
|
private static Hashtable |
namingAttributes
|
private static Hashtable |
objectClasses
|
Constructor Summary | |
protected |
LdapEntry()
Constructs an empty LdapEntry object. |
(package private) |
LdapEntry(LdapDirectory d)
Constructs an empty LdapEntry object tied an LdapDirectory implementation. |
protected |
LdapEntry(LdapDirectory d,
Group g)
Constructs an LdapEntry object associated with an LdapDirectory and containing the information with Group. |
Method Summary | |
void |
addAttributeValue(String name,
String value)
Adds an attribute value to a multi-valued attribute. |
void |
addObjectClass(String oc)
Adds an objectClass to this entry. |
void |
create()
Creates this entry. |
void |
createDn()
Creates this entry and all missing parents. |
void |
delete()
Deletes this entry. |
boolean |
differs()
Checks to see if this object is different from the LDAP entry it represents. |
static Element |
dn2element(String dn)
|
static Element |
dn2element(String dn,
Hashtable objClasses,
Hashtable nmgAttributes)
|
boolean |
exists()
Checks to see if the underlying LDAP directory contains the entry for this entry's DN. |
protected static Group |
find(LdapDirectory directory,
String scope,
String filter)
Finds an entry using an LdapDirectory from the root with a scope and filter. |
protected static Group |
find(LdapDirectory directory,
String base,
String scope,
String filter)
Finds an entry using an LdapDirectory from a search base with a scope and filter. |
protected static Group |
find(Url u)
Performs a search using a Url. |
String[] |
getAttributeNames()
Gets a list of this object's current attribute names. |
String |
getAttributeValue(String attrName)
Gets the value for an attribute name. |
String[] |
getAttributeValues(String attrName)
Gets a list of attribute values for an attribute name. |
String[] |
getCreatedDns()
Gets parent DNs created as a result of createDn() . |
String |
getDn()
Gets the DN of this entry. |
protected Element |
getElement()
Gets the underlying I*E element that contains this entry's LDAP data. |
(package private) static LdapEntry |
getEntry(LdapDirectory directory,
String dn)
Gets an LdapEntry by DN. |
LdapDirectory |
getLdapDirectory()
Gets the LdapDirectory this LdapEntry belongs to. |
String[] |
getObjectClasses()
Gets the current list of objectClasses for this entry. |
boolean |
hasChildren()
Checks to see if this entry contains other entries. |
protected Group |
lookup()
Looks up this entry by DN. |
protected static Group |
lookup(LdapDirectory directory,
String dn)
Looks up a single entry by DN. |
boolean |
refresh()
Reloads this entry from the underlying LDAP directory. |
void |
setAttributeValue(String name,
String value)
Sets an attribute value. |
void |
setDn(String dn)
Sets the DN of this entry |
protected void |
setElement(Element e)
Sets the underlying I*E element that contains this entry's LDAP data. |
protected void |
setLdapDirectory(LdapDirectory d)
Sets this object's LdapDirectory object. |
String |
toString()
Returns a String representation of this entry. |
void |
update()
Updates this entry. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private LdapDirectory directory
private String dn
private Group entry
private Vector createdDns
private Vector deletedAttrs
private static Hashtable objectClasses
private static Hashtable namingAttributes
Constructor Detail |
protected LdapEntry()
LdapEntry(LdapDirectory d)
d
- The LdapDirectory.protected LdapEntry(LdapDirectory d, Group g)
d
- The LdapDirectory.g
- The I*E Group containing the entry's information.Method Detail |
public LdapDirectory getLdapDirectory()
LdapDirectory
protected void setLdapDirectory(LdapDirectory d)
d
- The LdapDirectory.LdapDirectory
public String getDn()
public void setDn(String dn)
dn
- The DN.protected Element getElement()
protected void setElement(Element e)
e
- The I*E Element.public void setAttributeValue(String name, String value)
For example setAttributeValue ( "sn", "Johnson" );
To remove an attribute value pass null
for the value.
To actually apply changes the update() method must be called.
name
- The attribute name.value
- The attribute value.update()
public void addAttributeValue(String name, String value)
For example addAttributeValue ( "ptcProperty", "name=value" );
If the attribute has not been set yet then the attribute will be added. To actually apply changes the update() method must be called.
name
- The attribute name.value
- The attribute value.update()
public String[] getAttributeNames()
public String[] getAttributeValues(String attrName)
attrName
- The attribute name.
getAttributeNames()
public String getAttributeValue(String attrName)
attrName
- The attribute name.
public String[] getObjectClasses()
public void addObjectClass(String oc)
oc
- The objectClass to add.public boolean refresh()
update()
will be lost.
public boolean exists()
public boolean hasChildren()
public boolean differs()
This method will return true if:
public void create() throws IEException
IEException
public void createDn() throws IEException
Missing parent entries can only be one of:
IEException
getCreatedDns()
public String[] getCreatedDns()
createDn()
.
createDn()
public void delete() throws IEException
IEException
public void update() throws IEException
IEException
protected static Group find(LdapDirectory directory, String scope, String filter)
directory
- The LdapDirectory.scope
- The search scope.filter
- The search filter.
protected static Group find(LdapDirectory directory, String base, String scope, String filter)
directory
- The LdapDirectory.base
- The search base.scope
- The search scope.filter
- The search filter.
protected static Group find(Url u)
u
- The Url.
protected static Group lookup(LdapDirectory directory, String dn)
directory
- The directory.dn
- The DN to lookup.
protected Group lookup()
static LdapEntry getEntry(LdapDirectory directory, String dn)
directory
- The LdapDirectorydn
- The entry to lookup
public String toString()
Form is LDIF without support for binary or UTF-8.
public static Element dn2element(String dn) throws IEException
dn
- The dn
IEException
public static Element dn2element(String dn, Hashtable objClasses, Hashtable nmgAttributes) throws IEException
dn
- The dnobjClasses
- Hashtable of naming attribute to objectClass. e.g. cn -> top, ptcSubtree
nmgAttributes
- Hashtable of naming attribute to naming attribute(s). e.g. cn -> cn,sn
IEException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |