Package scriptella.driver.ldap.ldif
Class Entry
java.lang.Object
scriptella.driver.ldap.ldif.Entry
A entry to be populated by an ldif parser.
We will have different kind of entries : - added entries - deleted entries -
modified entries - RDN modified entries - DN modified entries
- Author:
- Apache Directory Project
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String id, Object value) Add an attribute to the entryvoidaddAttribute(Attribute attr) Add an attribute to the entryvoidaddModificationItem(int modOp, String id, Object value) Add a modification itemReturns a attribute given it's idGet the entry's attributesintGet the change typegetDn()booleanbooleanbooleanbooleanbooleanbooleanbooleanisEntry()voidputAttribute(String id, Object value) Add an attribute value to an existing attributevoidsetChangeType(int changeType) Set the modification typevoidsetChangeType(String changeType) Set the change typevoidsetControl(Control control) Add a control to the entryvoidsetDeleteOldRdn(boolean deleteOldRdn) Set the flage deleteOldRdnvoidSet the Distinguished NamevoidSet the new RDNvoidsetNewSuperior(String newSuperior) Set the new superiorintsize()toString()Return a String representing the Entry
-
Field Details
-
ADD
public static final int ADDThe possible change types- See Also:
-
MODIFY
public static final int MODIFY- See Also:
-
MODDN
public static final int MODDN- See Also:
-
MODRDN
public static final int MODRDN- See Also:
-
DELETE
public static final int DELETE- See Also:
-
-
Constructor Details
-
Entry
public Entry()
-
-
Method Details
-
setDn
Set the Distinguished Name- Parameters:
dn- The Distinguished Name
-
setChangeType
public void setChangeType(int changeType) Set the modification type- Parameters:
changeType- The change type
-
setChangeType
Set the change type- Parameters:
changeType- The change type
-
addModificationItem
Add a modification item- Parameters:
modOp- The operation. One of : DirContext.ADD_ATTRIBUTE DirContext.REMOVE_ATTRIBUTE DirContext.REPLACE_ATTRIBUTEid- The attribute's IDvalue- The attribute's value
-
addAttribute
Add an attribute to the entry- Parameters:
attr- The attribute to be added
-
addAttribute
Add an attribute to the entry- Parameters:
id- The attribute IDvalue- The attribute value
-
putAttribute
Add an attribute value to an existing attribute- Parameters:
id- The attribute IDvalue- The attribute value
-
getChangeType
public int getChangeType()Get the change type- Returns:
- The change type. One of : ADD = 0; MODIFY = 1; MODDN = 2; MODRDN = 3; DELETE = 4;
-
getModificationItems
- Returns:
- The list of modification items
-
getDn
- Returns:
- The entry Distinguished name
-
size
public int size()- Returns:
- The number of entry modifications
-
get
Returns a attribute given it's id- Parameters:
attributeId- The attribute Id- Returns:
- The attribute if it exists
-
getAttributes
Get the entry's attributes- Returns:
- An Attributes
-
isDeleteOldRdn
public boolean isDeleteOldRdn()- Returns:
- True, if the old RDN should be deleted.
-
setDeleteOldRdn
public void setDeleteOldRdn(boolean deleteOldRdn) Set the flage deleteOldRdn- Parameters:
deleteOldRdn- True if the old RDN should be deleted
-
getNewRdn
- Returns:
- The new RDN
-
setNewRdn
Set the new RDN- Parameters:
newRdn- The new RDN
-
getNewSuperior
- Returns:
- The new superior
-
setNewSuperior
Set the new superior- Parameters:
newSuperior- The new Superior
-
isChangeAdd
public boolean isChangeAdd()- Returns:
- True if the entry is an ADD entry
-
isChangeDelete
public boolean isChangeDelete()- Returns:
- True if the entry is a DELETE entry
-
isChangeModDn
public boolean isChangeModDn()- Returns:
- True if the entry is a MODDN entry
-
isChangeModRdn
public boolean isChangeModRdn()- Returns:
- True if the entry is a MODRDN entry
-
isChangeModify
public boolean isChangeModify()- Returns:
- True if the entry is a MODIFY entry
-
isEntry
public boolean isEntry() -
getControl
- Returns:
- The associated control, if any
-
setControl
Add a control to the entry- Parameters:
control- The control
-
toString
Return a String representing the Entry
-