scriptella.driver.ldap.ldif
Class Entry

java.lang.Object
  extended by scriptella.driver.ldap.ldif.Entry

public class Entry
extends java.lang.Object

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
static int ADD
          The possible change types
static int DELETE
           
static int MODDN
           
static int MODIFY
           
static int MODRDN
           
 
Constructor Summary
Entry()
           
 
Method Summary
 void addAttribute(javax.naming.directory.Attribute attr)
          Add an attribute to the entry
 void addAttribute(java.lang.String id, java.lang.Object value)
          Add an attribute to the entry
 void addModificationItem(int modOp, java.lang.String id, java.lang.Object value)
          Add a modification item
 javax.naming.directory.Attribute get(java.lang.String attributeId)
          Returns a attribute given it's id
 javax.naming.directory.Attributes getAttributes()
          Get the entry's attributes
 int getChangeType()
          Get the change type
 javax.naming.ldap.Control getControl()
           
 java.lang.String getDn()
           
 java.util.List<javax.naming.directory.ModificationItem> getModificationItems()
           
 java.lang.String getNewRdn()
           
 java.lang.String getNewSuperior()
           
 boolean isChangeAdd()
           
 boolean isChangeDelete()
           
 boolean isChangeModDn()
           
 boolean isChangeModify()
           
 boolean isChangeModRdn()
           
 boolean isDeleteOldRdn()
           
 boolean isEntry()
           
 void putAttribute(java.lang.String id, java.lang.Object value)
          Add an attribute value to an existing attribute
 void setChangeType(int changeType)
          Set the modification type
 void setChangeType(java.lang.String changeType)
          Set the change type
 void setControl(javax.naming.ldap.Control control)
          Add a control to the entry
 void setDeleteOldRdn(boolean deleteOldRdn)
          Set the flage deleteOldRdn
 void setDn(java.lang.String dn)
          Set the Distinguished Name
 void setNewRdn(java.lang.String newRdn)
          Set the new RDN
 void setNewSuperior(java.lang.String newSuperior)
          Set the new superior
 int size()
           
 java.lang.String toString()
          Return a String representing the Entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADD

public static final int ADD
The possible change types

See Also:
Constant Field Values

MODIFY

public static final int MODIFY
See Also:
Constant Field Values

MODDN

public static final int MODDN
See Also:
Constant Field Values

MODRDN

public static final int MODRDN
See Also:
Constant Field Values

DELETE

public static final int DELETE
See Also:
Constant Field Values
Constructor Detail

Entry

public Entry()
Method Detail

setDn

public void setDn(java.lang.String dn)
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

public void setChangeType(java.lang.String changeType)
Set the change type

Parameters:
changeType - The change type

addModificationItem

public void addModificationItem(int modOp,
                                java.lang.String id,
                                java.lang.Object value)
Add a modification item

Parameters:
modOp - The operation. One of : DirContext.ADD_ATTRIBUTE DirContext.REMOVE_ATTRIBUTE DirContext.REPLACE_ATTRIBUTE
id - The attribute's ID
value - The attribute's value

addAttribute

public void addAttribute(javax.naming.directory.Attribute attr)
Add an attribute to the entry

Parameters:
attr - The attribute to be added

addAttribute

public void addAttribute(java.lang.String id,
                         java.lang.Object value)
Add an attribute to the entry

Parameters:
id - The attribute ID
value - The attribute value

putAttribute

public void putAttribute(java.lang.String id,
                         java.lang.Object value)
Add an attribute value to an existing attribute

Parameters:
id - The attribute ID
value - 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

public java.util.List<javax.naming.directory.ModificationItem> getModificationItems()
Returns:
The list of modification items

getDn

public java.lang.String getDn()
Returns:
The entry Distinguished name

size

public int size()
Returns:
The number of entry modifications

get

public javax.naming.directory.Attribute get(java.lang.String attributeId)
Returns a attribute given it's id

Parameters:
attributeId - The attribute Id
Returns:
The attribute if it exists

getAttributes

public javax.naming.directory.Attributes 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

public java.lang.String getNewRdn()
Returns:
The new RDN

setNewRdn

public void setNewRdn(java.lang.String newRdn)
Set the new RDN

Parameters:
newRdn - The new RDN

getNewSuperior

public java.lang.String getNewSuperior()
Returns:
The new superior

setNewSuperior

public void setNewSuperior(java.lang.String newSuperior)
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

public javax.naming.ldap.Control getControl()
Returns:
The associated control, if any

setControl

public void setControl(javax.naming.ldap.Control control)
Add a control to the entry

Parameters:
control - The control

toString

public java.lang.String toString()
Return a String representing the Entry

Overrides:
toString in class java.lang.Object


Copyright © Copyright 2006-2009 The Scriptella Project Team.