|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectca.tnt.ldaputils.impl.LDAPEntryImpl
public class LDAPEntryImpl
LDAPObject implementing class. All inheriting classes should implement a getAttributeXAsString() type method, such as getMail(). But they may also need to implement a getAttributeXValues(), such as getMails(). So, it should simply be a plural of the attribute. If an object had getBusinessCategory() it could also have a getBusinessCategories(). The plural versions should ALWAYS return a "List" for consistancy.
Created : 14-Apr-2006 6:29:39 PM MST TODO : print out all attributes
| Field Summary | |
|---|---|
protected Attributes |
attributes
This contains all of the attributes for the object |
protected LdapName |
dn
|
protected boolean |
isNew
|
protected LinkedHashMap |
modificationItems
|
protected boolean |
modified
|
protected List |
objectClasses
|
| Fields inherited from interface ca.tnt.ldaputils.ILdapEntry |
|---|
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE |
| Constructor Summary | |
|---|---|
LDAPEntryImpl()
Calling this constructor implies that the object is brand new, and the save() method should act accordingly. |
|
LDAPEntryImpl(Attributes attributes,
LdapName dn)
Creates an LDAPObject that has all of the attributes and their values in the order in which they were found in LDAP. |
|
| Method Summary | |
|---|---|
ILdapEntry |
convertInstance(int type)
Converts this object to the given instance. |
boolean |
equals(Object obj)
|
List |
getAttributeValues(String attribute)
|
Attributes |
getBindAttributes()
|
String |
getCn()
|
String |
getCN()
|
String |
getDescription()
|
LdapName |
getDn()
|
List |
getObjectClasses()
Get's the types of objects this is. |
String |
getStringAttribute(Attributes attributes,
String attribute)
|
String |
getStringValue(String attribute)
|
protected boolean |
isObjectClass(String objectClass)
|
void |
modifyAttribute(int operation,
String attribute,
Object value)
Sets the given attribute right now, and does not delay. |
void |
modifyBatchAttribute(int operation,
String attribute,
Object value)
Please note, the preferred method is to call setXXXX() where XXXX is the attribute name, followed by save(). |
void |
modifyBatchAttributes()
Runs the batch modifications requested through the ILdapEntry.modifyBatchAttribute(int, String, Object) |
void |
save()
Because LDAP operations are expensive, we have a save method. |
void |
setCn(String cn)
|
void |
setDn(LdapName dn)
|
String |
toString()
|
protected void |
updateAttribute(String attrName)
Updates the specified attribute from LDAP. |
protected void |
updateObject()
Updates the attributes from LDAP. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean modified
protected boolean isNew
protected LdapName dn
protected List objectClasses
protected LinkedHashMap modificationItems
protected Attributes attributes
| Constructor Detail |
|---|
public LDAPEntryImpl(Attributes attributes,
LdapName dn)
throws NamingException
attributes - the LDAP attributes object as returned by the JNDI
APIs.dn - distinguished name of the object.
NamingException - when any errors occurpublic LDAPEntryImpl()
| Method Detail |
|---|
public boolean equals(Object obj)
equals in class Object
public ILdapEntry convertInstance(int type)
throws NamingException
convertInstance in interface ILdapEntrytype - the object type to convert to
NamingException - if conversion fails due to the proper objectClass
not being setup.public List getObjectClasses()
ILdapEntry
getObjectClasses in interface ILdapEntrypublic String getCN()
getCN in interface ILdapEntrypublic LdapName getDn()
getDn in interface ILdapEntrypublic String getDescription()
getDescription in interface ILdapEntry
public String getStringAttribute(Attributes attributes,
String attribute)
throws NamingException
NamingExceptionpublic List getAttributeValues(String attribute)
getAttributeValues in interface ILdapEntrypublic String getStringValue(String attribute)
getStringValue in interface ILdapEntry
public void modifyAttribute(int operation,
String attribute,
Object value)
ILdapEntry
modifyAttribute in interface ILdapEntryoperation - on of ADD_ATTRIBUTE, REPLACE_ATTRIBUTE,
REMOVE_ATTRIBUTEattribute - the name of the attributevalue - the value of the attributeADD_ATTRIBUTE,
REPLACE_ATTRIBUTE,
REMOVE_ATTRIBUTE
public void modifyBatchAttribute(int operation,
String attribute,
Object value)
ILdapEntry
modifyBatchAttribute in interface ILdapEntryoperation - one of ADD_ATTRIBUTE, REPLACE_ATTRIBUTE,
REMOVE_ATTRIBUTEattribute - the name of the attributevalue - the value of the attributeADD_ATTRIBUTE,
REPLACE_ATTRIBUTE,
REMOVE_ATTRIBUTEpublic void modifyBatchAttributes()
ILdapEntryILdapEntry.modifyBatchAttribute(int, String, Object)
modifyBatchAttributes in interface ILdapEntrypublic void save()
ILdapEntry
save in interface ILdapEntry
protected void updateAttribute(String attrName)
throws NamingException
attrName - the name of the attribute
NamingException - if any LDAP errors occur.
protected void updateObject()
throws NamingException
NamingException - - should be replaced with LdapNamingException?protected boolean isObjectClass(String objectClass)
public Attributes getBindAttributes()
getBindAttributes in interface ILdapEntrypublic void setDn(LdapName dn)
setDn in interface ILdapEntrypublic String getCn()
getCn in interface ILdapEntrypublic void setCn(String cn)
setCn in interface ILdapEntrypublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This documentation is part of the LDAP Persistence API (LPA).
Copyright Trenton D. Adams <lpa at trentonadams daught ca>
LPA is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
LPA is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with LPA. If not, see GNU Licenses.
See the COPYING file, in the git repository, for more information.