public class LdifEntry extends Object implements Cloneable, Externalizable
Modifier and Type | Field and Description |
---|---|
static Modification[] |
EMPTY_MODS
Used in toArray()
|
Constructor and Description |
---|
LdifEntry()
Creates a new Entry object.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(EntryAttribute attr)
Add an attribute to the entry
|
void |
addAttribute(String id,
Object value)
Add an attribute to the entry
|
void |
addModificationItem(Modification modification)
Add a modification item (used by modify operations)
|
void |
addModificationItem(ModificationOperation modOp,
EntryAttribute attr)
Add a modification item (used by modify operations)
|
void |
addModificationItem(ModificationOperation modOp,
String id,
Object value)
Add a modification item
|
LdifEntry |
clone()
Clone method
|
boolean |
equals(Object o) |
EntryAttribute |
get(String attributeId)
Returns a attribute given it's id
|
ChangeType |
getChangeType()
Get the change type
|
Control |
getControl() |
DN |
getDn() |
Entry |
getEntry()
Get the entry's entry
|
List<Modification> |
getModificationItems() |
Modification[] |
getModificationItemsArray()
Gets the modification items as an array.
|
String |
getNewRdn() |
String |
getNewSuperior() |
int |
hashCode() |
boolean |
isChangeAdd() |
boolean |
isChangeDelete() |
boolean |
isChangeModDn() |
boolean |
isChangeModify() |
boolean |
isChangeModRdn() |
boolean |
isDeleteOldRdn() |
boolean |
isEntry()
Tells if the current entry is a added one
|
void |
putAttribute(String id,
Object value)
Add an attribute value to an existing attribute
|
void |
readExternal(ObjectInput in) |
List<EntryAttribute> |
removeAttribute(String... ids)
Remove a list of Attributes from the LdifEntry
|
void |
setChangeType(ChangeType changeType)
Set the modification type
|
void |
setChangeType(String changeType)
Set the change type
|
void |
setControl(Control control)
Add a control to the entry
|
void |
setDeleteOldRdn(boolean deleteOldRdn)
Set the flage deleteOldRdn
|
void |
setDn(DN dn)
Set the Distinguished Name
|
void |
setDn(String dn)
Set the Distinguished Name
|
void |
setNewRdn(String newRdn)
Set the new RDN
|
void |
setNewSuperior(String newSuperior)
Set the new superior
|
int |
size() |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public static final Modification[] EMPTY_MODS
public void setDn(DN dn)
dn
- The Distinguished Namepublic void setDn(String dn) throws LdapInvalidDnException
dn
- The Distinguished NameLdapInvalidDnException
public void setChangeType(ChangeType changeType)
changeType
- The change typepublic void setChangeType(String changeType)
changeType
- The change typepublic void addModificationItem(Modification modification)
modification
- The modification to be addedpublic void addModificationItem(ModificationOperation modOp, EntryAttribute attr)
modOp
- The operation. One of :
- ModificationOperation.ADD_ATTRIBUTE
- ModificationOperation.REMOVE_ATTRIBUTE
- ModificationOperation.REPLACE_ATTRIBUTEattr
- The attribute to be addedpublic void addModificationItem(ModificationOperation modOp, String id, Object value)
modOp
- The operation. One of :
- ModificationOperation.ADD_ATTRIBUTE
- ModificationOperation.REMOVE_ATTRIBUTE
- ModificationOperation.REPLACE_ATTRIBUTEmodOp
- The modification operation valueid
- The attribute's IDvalue
- The attribute's valuepublic void addAttribute(EntryAttribute attr) throws LdapException
attr
- The attribute to be addedLdapException
public void addAttribute(String id, Object value) throws LdapException
id
- The attribute IDvalue
- The attribute valueLdapException
public List<EntryAttribute> removeAttribute(String... ids)
ids
- The Attributes to removepublic void putAttribute(String id, Object value) throws LdapException
id
- The attribute IDvalue
- The attribute valueLdapException
public ChangeType getChangeType()
public List<Modification> getModificationItems()
public Modification[] getModificationItemsArray()
public DN getDn()
public int size()
public EntryAttribute get(String attributeId)
attributeId
- The attribute Idpublic Entry getEntry()
public boolean isDeleteOldRdn()
public void setDeleteOldRdn(boolean deleteOldRdn)
deleteOldRdn
- True if the old RDN should be deletedpublic String getNewRdn()
public void setNewRdn(String newRdn)
newRdn
- The new RDNpublic String getNewSuperior()
public void setNewSuperior(String newSuperior)
newSuperior
- The new Superiorpublic boolean isChangeAdd()
public boolean isChangeDelete()
public boolean isChangeModDn()
public boolean isChangeModRdn()
public boolean isChangeModify()
public boolean isEntry()
true
if the entry is addedpublic Control getControl()
public void setControl(Control control)
control
- The controlpublic LdifEntry clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- If there is some problem while cloning the instancepublic String toString()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object o)
equals
in class Object
true
if both values are equalObject.equals(Object)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
in
- The stream from which the LdifEntry is readIOException
- If the stream can't be readClassNotFoundException
- If the LdifEntry can't be createdExternalizable.readExternal(ObjectInput)
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- The stream in which the ChangeLogEvent will be serialized.IOException
- If the serialization failExternalizable#readExternal(ObjectInput)
Copyright © 2003–2013 The Apache Software Foundation. All rights reserved.