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 LdifEntry object.
|
LdifEntry(Dn dn,
Object... avas)
Creates a LdifEntry using a list of strings representing the Ldif element
|
LdifEntry(Entry entry)
Creates a new LdifEntry object, storing an Entry
|
LdifEntry(SchemaManager schemaManager)
Creates a new schema aware LdifEntry object.
|
LdifEntry(String dn,
Object... strings)
Creates a LdifEntry using a list of strings representing the Ldif element
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(Attribute attr)
Add an attribute to the entry
|
void |
addAttribute(String id,
Object... values)
Add an attribute to the entry
|
void |
addControl(Control... controls)
Add a control to the entry
|
void |
addModification(Modification modification)
Add a modification item (used by modify operations)
|
void |
addModification(ModificationOperation modOp,
Attribute attr)
Add a modification item (used by modify operations)
|
void |
addModification(ModificationOperation modOp,
String id,
Object value)
Add a modification
|
LdifEntry |
clone()
Clone method
|
boolean |
equals(Object o) |
Attribute |
get(String attributeId)
Returns a attribute given it's id
|
ChangeType |
getChangeType()
Get the change type
|
LdifControl |
getControl(String oid) |
Map<String,LdifControl> |
getControls() |
Dn |
getDn() |
Entry |
getEntry()
Get the entry's entry
|
int |
getLengthBeforeParsing()
Returns the lengthBeforeParsing of the entry at the time of parsing.
|
Modification[] |
getModificationArray()
Gets the modification items as an array.
|
List<Modification> |
getModifications() |
String |
getNewRdn() |
String |
getNewSuperior() |
long |
getOffset() |
boolean |
hasControls() |
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
|
boolean |
isLdifChange() |
boolean |
isLdifContent() |
void |
putAttribute(String id,
Object value)
Add an attribute value to an existing attribute
|
void |
readExternal(ObjectInput in) |
void |
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 |
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 LdifEntry()
public LdifEntry(SchemaManager schemaManager)
public LdifEntry(Dn dn, Object... avas) throws LdapInvalidAttributeValueException, LdapLdifException
dn
- The LdifEntry DNavas
- The Ldif to convert to an LdifEntryLdapInvalidAttributeValueException
- If either the AttributeType or the associated value
is incorrectLdapLdifException
- If we get any other exceptionpublic LdifEntry(String dn, Object... strings) throws LdapInvalidAttributeValueException, LdapLdifException, LdapInvalidDnException
dn
- The LdifEntry DNavas
- The Ldif attributes and values to convert to an LdifEntryLdapInvalidDnException
- If the Dn is invalidLdapInvalidAttributeValueException
- If either the AttributeType or the associated value
is incorrectLdapLdifException
- If we get any other exceptionpublic void setDn(String dn) throws LdapInvalidDnException
dn
- The Distinguished NameLdapInvalidDnException
- If the Dn is invalidpublic void setChangeType(ChangeType changeType)
changeType
- The change typepublic void setChangeType(String changeType)
changeType
- The change typepublic void addModification(Modification modification)
modification
- The modification to be addedpublic void addModification(ModificationOperation modOp, Attribute attr)
modOp
- The operation. One of :
attr
- The attribute to be addedpublic void addModification(ModificationOperation modOp, String id, Object value)
modOp
- The modification operation value. One of :
id
- The attribute's IDvalue
- The attribute's valuepublic void addAttribute(Attribute attr) throws LdapException
attr
- The attribute to be addedLdapException
- if something went wrongpublic void addAttribute(String id, Object... values) throws LdapException
id
- The attribute IDvalues
- The attribute valuesLdapException
- if something went wrongpublic void removeAttribute(String... ids)
ids
- The Attributes to removepublic void putAttribute(String id, Object value) throws LdapException
id
- The attribute IDvalue
- The attribute valueLdapException
- if something went wrongpublic ChangeType getChangeType()
public List<Modification> getModifications()
public Modification[] getModificationArray()
public int size()
public Attribute get(String attributeId)
attributeId
- The attribute Idpublic boolean isDeleteOldRdn()
public void setDeleteOldRdn(boolean deleteOldRdn)
deleteOldRdn
- True if the old Rdn should be deletedpublic String getNewSuperior()
public void setNewSuperior(String newSuperior)
newSuperior
- The new Superiorpublic boolean isLdifContent()
public boolean isLdifChange()
public boolean isChangeAdd()
public boolean isChangeDelete()
public boolean isChangeModDn()
public boolean isChangeModRdn()
public boolean isChangeModify()
public boolean isEntry()
true
if the entry is addedpublic boolean hasControls()
public Map<String,LdifControl> getControls()
public LdifControl getControl(String oid)
oid
- The control's OIDpublic void addControl(Control... controls)
controls
- The added controlspublic LdifEntry clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- If there is some problem while cloning the instancepublic int getLengthBeforeParsing()
public long getOffset()
public int hashCode()
hashCode
in class Object
Object.hashCode()
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–2015 The Apache Software Foundation. All rights reserved.