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 );
| Constructor and Description |
|---|
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
|
| Modifier and Type | Method and Description |
|---|---|
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() |
java.lang.String |
getModPropertyValue(java.lang.String propName)
Returns an LDIFRecord that represents this ModPropertySet
|
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
|
public ModPropertySet()
public ModPropertySet(int chgType)
public ModPropertySet(javax.naming.directory.Attributes attrs,
int chgType)
attrs - JNDI Attributes object representing the collection
of attributeschgType - int representing the change typepublic final boolean isEmpty()
public final int size()
public final java.lang.String[] getAttributeNames()
public final java.lang.String getModPropertyValue(java.lang.String propName)
public final java.lang.String[] getModPropertyValues(java.lang.String propName)
public final int getChangeType()
public void addProperty(java.lang.String attrName,
java.lang.String attrValue)
LDIF.ATTRIBUTE_CHANGE_TYPE_ADD attrName - the attribute nameattrValue - the attribute valuepublic void addProperty(int chgType,
java.lang.String attrName,
java.lang.String attrValue)
chgType - use one of LDIF.ATTRIBUTE_CHANGE_TYPE_ADD.
LDIF.ATTRIBUTE_CHANGE_TYPE_REPLACE, or LDIF.ATTRIBUTE_CHANGE_TYPE_DELETE.attrName - the attribute nameattrValue - the attribute valuepublic void addProperty(int chgType,
java.lang.String attrName,
java.lang.String[] attrValueList)
chgType - use one of LDIF.ATTRIBUTE_CHANGE_TYPE_ADD.
LDIF.ATTRIBUTE_CHANGE_TYPE_REPLACE, or LDIF.ATTRIBUTE_CHANGE_TYPE_DELETE.attrName - the attribute nameattrValueList - a String[] containing the attribute valuespublic void addProperty(int chgType,
java.lang.String attrName,
byte[] byteArray)
chgType - use one of LDIF.ATTRIBUTE_CHANGE_TYPE_ADD.
LDIF.ATTRIBUTE_CHANGE_TYPE_REPLACE, or LDIF.ATTRIBUTE_CHANGE_TYPE_DELETE.attrName - the attribute namebyteArray - value of the attribute as raw bytespublic void addProperty(int chgType,
LDIFAttribute lattr)
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 modificationpublic void addProperty(int chgType,
javax.naming.directory.Attribute attr)
chgType - - ADD Attributeattr - - JNDI Attributepublic void deleteProperty(java.lang.String attrName)
attrName - name of attribute to be removedpublic java.lang.Object clone()
clone in class java.lang.Object