|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.api.ldap.model.ldif.LdifEntry
public class LdifEntry
A entry to be populated by an ldif parser. We will have different kind of entries :
| Field Summary | |
|---|---|
static Modification[] |
EMPTY_MODS
Used in toArray() |
| Constructor Summary | |
|---|---|
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(String dn,
Object... strings)
Creates a LdifEntry using a list of strings representing the Ldif element |
|
| Method Summary | |
|---|---|
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 |
Modification[] |
getModificationArray()
Gets the modification items as an array. |
List<Modification> |
getModifications()
|
String |
getNewRdn()
|
String |
getNewSuperior()
|
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)
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Modification[] EMPTY_MODS
| Constructor Detail |
|---|
public LdifEntry()
public LdifEntry(Entry entry)
public LdifEntry(Dn dn,
Object... avas)
throws LdapInvalidAttributeValueException,
LdapLdifException
dn - The LdifEntry DNavas - The Ldif to convert to an LdifEntry
LdapInvalidAttributeValueException - If either the AttributeType or the associated value
is incorrect
LdapLdifException - If we get any other exception
public LdifEntry(String dn,
Object... strings)
throws LdapInvalidAttributeValueException,
LdapLdifException,
LdapInvalidDnException
dn - The LdifEntry DNavas - The Ldif attributes and values to convert to an LdifEntry
LdapInvalidDnException - If the Dn is invalid
LdapInvalidAttributeValueException - If either the AttributeType or the associated value
is incorrect
LdapLdifException - If we get any other exception| Method Detail |
|---|
public void setDn(Dn dn)
dn - The Distinguished Name
public void setDn(String dn)
throws LdapInvalidDnException
dn - The Distinguished Name
LdapInvalidDnException - 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 added
public void addModification(ModificationOperation modOp,
Attribute attr)
modOp - The operation. One of :
attr - The attribute to be added
public void addModification(ModificationOperation modOp,
String id,
Object value)
modOp - The modification operation value. One of :
id - The attribute's IDvalue - The attribute's value
public void addAttribute(Attribute attr)
throws LdapException
attr - The attribute to be added
LdapException - if something went wrong
public void addAttribute(String id,
Object... values)
throws LdapException
id - The attribute IDvalues - The attribute values
LdapException - if something went wrongpublic void removeAttribute(String... ids)
ids - The Attributes to remove
public void putAttribute(String id,
Object value)
throws LdapException
id - The attribute IDvalue - The attribute value
LdapException - if something went wrongpublic ChangeType getChangeType()
public List<Modification> getModifications()
public Modification[] getModificationArray()
public Dn getDn()
public int size()
public Attribute get(String attributeId)
attributeId - The attribute Id
public 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 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 OID
public void addControl(Control... controls)
controls - The added controls
public LdifEntry clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException - If there is some problem while cloning the instancepublic String toString()
toString in class Objectpublic int hashCode()
hashCode in class ObjectObject.hashCode()public boolean equals(Object o)
equals in class Object
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface Externalizablein - The stream from which the LdifEntry is read
IOException - If the stream can't be read
ClassNotFoundException - If the LdifEntry can't be createdExternalizable.readExternal(ObjectInput)
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface Externalizableout - The stream in which the ChangeLogEvent will be serialized.
IOException - If the serialization failExternalizable.readExternal(ObjectInput)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||