Skip navigation links

Oracle Internet Directory API Reference
11g Release 1 (11.1.1)

E10664-01


oracle.ldap.util
Class ModPropertySet

java.lang.Object
  extended by oracle.ldap.util.ModPropertySet

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ModPropertySet
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This class represents a set of attributes and their values used in a modification of any properties.

The ModPropertySet class is used in many of the setProperties() methods. It is used in User creation to define the attributes for a new user. It can also be used with Util.ldapModify() as a generic way to modify LDAP entries

For example, the following code modifies the "displayname" of the realm DN represented by the Subscriber object.


  DirContext ctx = a valid DirContext;
  Subscriber sub = a valid Subscriber;

  ModPropertySet mps = new ModPropertySet();
  mps.addProperty( LDIF.ATTRIBUTE_CHANGE_TYPE_REPLACE,
                    "displayName", "new display name");
  sub.setProperties( ctx, mps );
 
See Also:
Serialized Form

Constructor Summary
ModPropertySet()
          Creates an empty ModPropertySet.
ModPropertySet(javax.naming.directory.Attributes attrs, int chgType)
          Creates a ModPropertySet object from thw given set of attributes and the change type
ModPropertySet(int chgType)
          Creates an empty ModPropertySet with the specified change type

 

Method Summary
 void addProperty(int chgType, javax.naming.directory.Attribute attr)
          Creates a modification item for a particular attribute specified by JNDI Attribute class
 void addProperty(int chgType, LDIFAttribute lattr)
          Creates an modification item for a particular attribute specified by LDIFAttribute
 void addProperty(int chgType, java.lang.String attrName, byte[] byteArray)
          Creates an modification item for a particular attribute.
 void addProperty(int chgType, java.lang.String attrName, java.lang.String attrValue)
          Creates a modification item for a particular attribute.
 void addProperty(int chgType, java.lang.String attrName, java.lang.String[] attrValueList)
          Creates an modification item for a particular attribute.
 void addProperty(java.lang.String attrName, java.lang.String attrValue)
          Creates a modification item for a particular attribute with change type as LDIF.ATTRIBUTE_CHANGE_TYPE_ADD
 java.lang.Object clone()
          Clone the Mod Property Set
 void deleteProperty(java.lang.String attrName)
          Removes attribute specified by attrName from this ModPropertySet
 java.lang.String[] getAttributeNames()
          Returns an array of String containing the name of all the properties - all the attribute names returned with this particular search entry.
 int getChangeType()
           
 LDIFRecord getModProperty()
          Returns an LDIFRecord that represents this ModPropertySet
 java.lang.String getModPropertyValue(java.lang.String propName)
           
 java.lang.String[] getModPropertyValues(java.lang.String propName)
           
 boolean isEmpty()
          Returns true if the property set does not contain any properties; false otherwise
 int size()
          Returns the size of this property set - the number of returned attributes for this particular search result entry

 

Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ModPropertySet

public ModPropertySet()
Creates an empty ModPropertySet. By the default, the change type for this modification is set to LDIF.RECORD_CHANGE_TYPE_MODIFY.

ModPropertySet

public ModPropertySet(int chgType)
Creates an empty ModPropertySet with the specified change type

ModPropertySet

public ModPropertySet(javax.naming.directory.Attributes attrs,
                      int chgType)
Creates a ModPropertySet object from thw given set of attributes and the change type
Parameters:
attrs - JNDI Attributes object representing the collection of attributes
chgType - int representing the change type

Method Detail

isEmpty

public final boolean isEmpty()
Returns true if the property set does not contain any properties; false otherwise
Returns:
boolean indicating whether the property set is empty or not

size

public final int size()
Returns the size of this property set - the number of returned attributes for this particular search result entry
Returns:
an int indicating the number of properties belonging to this property set; it can return 0.

getAttributeNames

public final java.lang.String[] getAttributeNames()
Returns an array of String containing the name of all the properties - all the attribute names returned with this particular search entry.
Returns:
a String array containing all the property names.

getModProperty

public final LDIFRecord getModProperty()
Returns an LDIFRecord that represents this ModPropertySet

getModPropertyValue

public final java.lang.String getModPropertyValue(java.lang.String propName)

getModPropertyValues

public final java.lang.String[] getModPropertyValues(java.lang.String propName)

getChangeType

public final int getChangeType()

addProperty

public void addProperty(java.lang.String attrName,
                        java.lang.String attrValue)
Creates a modification item for a particular attribute with change type as LDIF.ATTRIBUTE_CHANGE_TYPE_ADD
Parameters:
attrName - the attribute name
attrValue - the attribute value

addProperty

public void addProperty(int chgType,
                        java.lang.String attrName,
                        java.lang.String attrValue)
Creates a modification item for a particular attribute.
Parameters:
chgType - use one of LDIF.ATTRIBUTE_CHANGE_TYPE_ADD. LDIF.ATTRIBUTE_CHANGE_TYPE_REPLACE, or LDIF.ATTRIBUTE_CHANGE_TYPE_DELETE.
attrName - the attribute name
attrValue - the attribute value

addProperty

public void addProperty(int chgType,
                        java.lang.String attrName,
                        java.lang.String[] attrValueList)
Creates an modification item for a particular attribute. The allows more than one value to be modified for a particular attribute.
Parameters:
chgType - use one of LDIF.ATTRIBUTE_CHANGE_TYPE_ADD. LDIF.ATTRIBUTE_CHANGE_TYPE_REPLACE, or LDIF.ATTRIBUTE_CHANGE_TYPE_DELETE.
attrName - the attribute name
attrValueList - a String[] containing the attribute values

addProperty

public void addProperty(int chgType,
                        java.lang.String attrName,
                        byte[] byteArray)
Creates an modification item for a particular attribute. This is used for byte-formatted value
Parameters:
chgType - use one of LDIF.ATTRIBUTE_CHANGE_TYPE_ADD. LDIF.ATTRIBUTE_CHANGE_TYPE_REPLACE, or LDIF.ATTRIBUTE_CHANGE_TYPE_DELETE.
attrName - the attribute name
byteArray - value of the attribute as raw bytes

addProperty

public void addProperty(int chgType,
                        LDIFAttribute lattr)
Creates an modification item for a particular attribute specified by LDIFAttribute
Parameters:
chgType - use one of LDIF.ATTRIBUTE_CHANGE_TYPE_ADD. LDIF.ATTRIBUTE_CHANGE_TYPE_REPLACE, or LDIF.ATTRIBUTE_CHANGE_TYPE_DELETE.
lattr - a valid LDIFAttribute containing the attribute and values for the modification

addProperty

public void addProperty(int chgType,
                        javax.naming.directory.Attribute attr)
Creates a modification item for a particular attribute specified by JNDI Attribute class
Parameters:
chgType - - ADD Attribute
attr - - JNDI Attribute

deleteProperty

public void deleteProperty(java.lang.String attrName)
Removes attribute specified by attrName from this ModPropertySet
Parameters:
attrName - name of attribute to be removed

clone

public java.lang.Object clone()
Clone the Mod Property Set
Overrides:
clone in class java.lang.Object

Skip navigation links

Oracle Internet Directory API Reference
11g Release 1 (11.1.1)

E10664-01


Copyright © 1999, 2009 Oracle. All Rights Reserved.