Oracle Internet Directory API Reference
10g(9.0.4)

B10423-01

oracle.ldap.util
Class ModPropertySet

java.lang.Object
  |
  +--oracle.ldap.util.ModPropertySet

public class ModPropertySet
extends java.lang.Object

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.

 
  // ctx is a valid DirContext
  // sub is a valid Subscriber
 
  ModPropertySet mps = new ModPropertySet();
  mps.addProperty( LDIF.ATTRIBUTE_CHANGE_TYPE_REPLACE,
                    "displayName", "new display name");
  sub.setProperties( ctx, mps ); 



Constructor Summary
ModPropertySet()
          Constructs an empty ModPropertySet.

 

Method Summary
 void addProperty(int chgType, LDIFAttribute lattr)
          Creates a modification item for a particular attribute specified by an LDIFAttribute
 void addProperty(int chgType, java.lang.String attrName, byte[] byteArray)
          Creates a modification item for a particular attribute.
 void addProperty(int chgType, java.lang.String attrName, java.lang.String attrValue)
          Creates a modification item in the ModPropertySet for a particular attribute.
 void addProperty(int chgType, java.lang.String attrName, java.lang.String[] attrValueList)
          Creates a modification item for a particular attribute.
 java.lang.String[] getAttributeNames()
          Returns an array of String containing the name of all the properties - all the attribute names contained in this ModPropertySet.
 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ModPropertySet

public ModPropertySet()
Constructs an empty ModPropertySet. By the default, the change type for this modification is set to LDIF.RECORD_CHANGE_TYPE_MODIFY.
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 contained in this ModPropertySet.
Returns:
a String array containing all the property names.

addProperty

public void addProperty(int chgType,
                        java.lang.String attrName,
                        java.lang.String attrValue)
Creates a modification item in the ModPropertySet 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 a modification item for a particular attribute. This allows more than one value to be defined 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

addProperty

public void addProperty(int chgType,
                        java.lang.String attrName,
                        byte[] byteArray)
Creates a 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 a modification item for a particular attribute specified by an 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

Oracle Internet Directory API Reference
10g(9.0.4)

B10423-01

Copyright © 2003, Oracle. All Rights Reserved.