|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.entry.Entry
public class Entry
The Entry class is a container for attributes and their values. The Entry class is widely used in the IBM Tivoli Directory Integrator. In the scripting environment you use the Entry and Attribute classes by accessing the object's methods.
JavaScript Example
// List all attributes and their values var conn = connector.getNextEntry(); var attrnames = conn.getAttributeNames(); for ( i = 0; i < attrnames.length; i++ ) { var attr = conn.getAttribute ( attrnames[i] ); task.logmsg( "Attribute: name = " + attr.getName() + ", #values = " + attr.size() ); for ( j = 0; j < attr.size(); j++ ) { task.logmsg( " Value " + j + ": " + attr.getValue ( j ) ); } }
Field Summary | |
---|---|
static char |
OP_ADD
The Entry contains an entry which is supposed to be added |
static String |
OP_ADD2
|
static char |
OP_DEL
The Entry contains an entry which is supposed to be removed |
static String |
OP_DEL2
|
static char |
OP_GEN
The Entry contains an entry with no explicit knowledge of operation |
static String |
OP_GEN2
|
static char |
OP_MOD
The Entry contains an entry which is supposed to be modified |
static String |
OP_MOD2
|
static char |
OP_UNCHANGED
The Entry contains an entry which is unchanged |
static String |
OP_UNCHANGED2
|
Constructor Summary | |
---|---|
Entry()
Construct a new generic Entry |
|
Entry(Hashtable table)
Construct a new generic Entry, with data given by the provided Hashtable. |
Method Summary | |
---|---|
void |
addAttributeValue(Object name,
Object value)
Adds a value to an attribute. |
void |
addAttributeValue(Object name,
Object value,
int op)
Adds a value to an attribute. |
Entry |
clone(Entry entry)
Returns an Entry object which is a clone of the Entry parameter. |
Attribute |
get(Object p1)
Returns the Attribute object for a named attribute. |
Attribute |
getAttribute(Object p1)
Returns the Attribute object for a named attribute. |
Collection |
getAttributeCollection()
Returns a java.util.Collection containing attribute names in this entry. |
String[] |
getAttributeNames()
Returns an array of strings containing attribute names in this entry. |
Object |
getObject(Object p1)
Returns the first value in an attribute as an object. |
char |
getOp()
Returns the operation field of this entry. |
String |
getOperation()
Returns the operation field of this Entry. |
Object |
getProperty(Object propertyName)
Returns a property value. |
String[] |
getPropertyNames()
Returns a string array of the property names contained in this entry. |
String |
getString(Object p1)
Returns the first value in an attribute as a String. |
boolean |
hasProperty(String propertyName)
Returns true if a property named by the propertyName parameter has a value. |
void |
merge(Entry e)
Convenience method that calls merge ( e, false ). |
void |
merge(Entry e,
boolean mergevalues)
Merges in the attributes and their values from another entry. |
void |
mergeAttributeValue(Attribute attr)
Merges in the values from an attribute. |
void |
mergeAttributeValue(Object name,
AttributeInterface attr)
Merges the values in one attribute with the values from another attribute. |
Attribute |
newAttribute(String name)
Returns an Attribute object from this Entry's list of attributes. |
Attribute |
newAttribute(String name,
char oper)
Returns an Attribute object from this entry's list of attributes. |
void |
removeAllAttributes()
Removes all attributes from this Entry. |
void |
removeAttribute(Object p1)
Removes an attribute from this Entry's list of attribute. |
void |
set(AttributeInterface attr)
Deprecated. Use setAttribute instead |
void |
setAttribute(AttributeInterface attr)
Adds or replaces an attribute in this Entry's list of attributes. |
void |
setAttribute(Object name,
Object value)
Adds or replaces an attribute in this Entry's list of attributes. |
void |
setAttribute(Object name,
Object value,
boolean protect)
Adds or replaces an attribute in this Entry's list of attributes. |
void |
setOp(char operation)
Sets the operation code for this Entry. |
void |
setOperation(String operation)
Sets the operation code for this Entry. |
void |
setProperty(Object propertyName,
Object propertyValue)
Sets/replaces a property. |
int |
size()
Returns the number of attributes present in this entry. |
String |
toDeltaString()
Returns a string representation of this entry, including delta information. |
String |
toString()
Returns a string representation of this entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char OP_ADD
public static final String OP_ADD2
public static final char OP_MOD
public static final String OP_MOD2
public static final char OP_DEL
public static final String OP_DEL2
public static final char OP_UNCHANGED
public static final String OP_UNCHANGED2
public static final char OP_GEN
public static final String OP_GEN2
Constructor Detail |
---|
public Entry()
public Entry(Hashtable table)
table
- - a Hashtable representation of theMethod Detail |
---|
public Entry clone(Entry entry)
entry
- The Entry object to clone
public char getOp()
public void setOp(char operation)
operation
- The operation codepublic String getOperation()
public void setOperation(String operation)
operation
- The operation code as a Stringpublic void set(AttributeInterface attr)
attr
- An Attribute objectpublic void setAttribute(AttributeInterface attr)
attr
- An Attribute objectpublic void setAttribute(Object name, Object value)
name
- The attribute namevalue
- The attribute value. If this parameter is null, then the attribute is removed.public void setAttribute(Object name, Object value, boolean protect)
name
- The attribute namevalue
- The attribute value. If this parameter is null, then the attribute is removed.protect
- If this parameter is true, do not dump the Attribute values in log filespublic Attribute newAttribute(String name)
name
- The attribute name to create/return
public Attribute newAttribute(String name, char oper)
name
- The attribute name to create/returnoper
- The new Attribute's operation code. Only used if creating a new Attribute.
public void addAttributeValue(Object name, Object value)
name
- The attribute namevalue
- The value to appendpublic void addAttributeValue(Object name, Object value, int op)
name
- The attribute namevalue
- The value to appendop
- The attribute value operation, AV_UNCHANGED = 0, AV_ADD = 1, AV_DELETE = 2public void mergeAttributeValue(Object name, AttributeInterface attr)
name
- The name of the attribute into which values are mergedattr
- The attribute (e.g. entry.getAttribute("xxx")) from which values are collectedpublic void mergeAttributeValue(Attribute attr)
attr
- The attribute (e.g. entry.getAttribute("xxx")) from which we get the name and valuespublic Attribute get(Object p1)
p1
- The attribute name
public Attribute getAttribute(Object p1)
p1
- The attribute name
public String[] getAttributeNames()
public Collection getAttributeCollection()
public String getString(Object p1)
p1
- The attribute name
public Object getObject(Object p1)
p1
- The attribute name
public void removeAttribute(Object p1)
p1
- The name of the attribute to removepublic void removeAllAttributes()
public int size()
public String toString()
toString
in class Object
public String toDeltaString()
public Object getProperty(Object propertyName)
propertyName
- The name of the property
public void setProperty(Object propertyName, Object propertyValue)
propertyName
- The name of the propertypropertyValue
- The named property's valuepublic boolean hasProperty(String propertyName)
public String[] getPropertyNames()
public void merge(Entry e)
e
- The entry from which attributes are collectedpublic void merge(Entry e, boolean mergevalues)
Example: This entry contains these attributes Name Values a 1 b 1, 2 The other entry contains these attributes Name Values b 3 c 4 After the merge, mergevalues=FALSE, this entry will contain Name Values a 1 b 3 c 4 After the merge, mergevalues=TRUE, this entry will contain Name Values a 1 b 1, 2, 3 c 4
e
- The entry from which attributes are collectedmergevalues
- if false replace values, if true add values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |