|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.internet2.middleware.ldappc.synchronize.AttributeModifier
public class AttributeModifier
This is a synchronizer helper class for modifying LDAP attribute values. It is to be used in the following manner.
init(Attribute) passing null
. Otherwise call init(Attribute) passing an Attribute holding the current set
of values. store(String) passing the
value. The AttributeModifier determines whether or not the value is an existing value
that must remain or is a new value to be added to the attribute.getModifications() to generate an array of
ModificationItems that can be used to update the
directory. Applying these modifications will result in the attribute holding the
desired set of values.
The following assumptions apply when using an AttributeModifier.
| Nested Class Summary | |
|---|---|
class |
AttributeModifier.Values
Implements optional case ignoring set by backing it with a Map, mapping the possibly lowercased values to the actual values. |
| Constructor Summary | |
|---|---|
AttributeModifier(String attributeName)
Constructs an AttributeModifier for the attribute name. |
|
AttributeModifier(String attributeName,
boolean caseSensitive)
Constructs an AttributeModifier for the attribute name with the case
sensitivity for string comparisions set as given. |
|
AttributeModifier(String attributeName,
String noValue)
Constructs an AttributeModifier for the attribute name with the given
"no value" value. |
|
AttributeModifier(String attributeName,
String noValue,
boolean caseSensitive)
Constructs an AttributeModifier for the attribute name with the given
"no value" value and case sensitivity. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears all of the existing values to be added or deleted. |
Attribute |
getAdditions()
Returns an attribute with the values to be added. |
AttributeModifier.Values |
getAdds()
|
String |
getAttributeName()
Gets the attribute name. |
AttributeModifier.Values |
getDeletes()
|
List<org.openspml.v2.msg.spml.Modification> |
getDSMLModification()
|
ModificationItem[] |
getModifications()
Returns an array of modification items necessary to update attribute based on the state of this object. |
String |
getNoValue()
Gets the "no value" value. |
List<org.openspml.v2.msg.spml.Modification> |
getReferenceModification()
|
AttributeModifier.Values |
getRetainedValues()
|
void |
init()
Initializes this with an empty value set. |
void |
init(Attribute attribute)
Initializes this with the values from the given attribute. |
void |
init(Collection<String> collection)
Initializes this with the values from the given collection. |
void |
initDSML(org.openspml.v2.profiles.dsml.DSMLValue... dsmlValues)
|
void |
initReference(Collection<org.openspml.v2.msg.spmlref.Reference> references)
|
boolean |
isCaseSensitive()
Indicates whether or not the AttributeModifier is case sensitive when comparing attribute value strings. |
protected String |
makeComparisonString(String value)
If caseSensitive is true, return value, otherwise return lowercased value. |
void |
retainAll()
This method retains all of the current values. |
void |
setAttributeName(String attributeName)
Sets the attribute name. |
void |
setNoValue(String noValue)
Set the "no value" value. |
void |
store(Collection<org.openspml.v2.msg.spmlref.Reference> references)
|
void |
store(org.openspml.v2.profiles.dsml.DSMLValue[] dsmlValues)
|
void |
store(String attrValue)
Stores the attribute value. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AttributeModifier(String attributeName)
AttributeModifier for the attribute name. This
AttributeModifier is case insensitive and assumes the attribute is not required as
the "no value" is not defined.
attributeName - Name of the attribute
public AttributeModifier(String attributeName,
String noValue)
AttributeModifier for the attribute name with the given
"no value" value. This AttributeModifier is case insensitive.
attributeName - Name of the attributenoValue - "no value" value (null if the attribute is not required).
public AttributeModifier(String attributeName,
boolean caseSensitive)
AttributeModifier for the attribute name with the case
sensitivity for string comparisions set as given. it is assumed that the attribute is
not required as the "no value" is not defined.
attributeName - Name of the attributecaseSensitive - boolean indicating if attribute value comparisions are case sensitive.
public AttributeModifier(String attributeName,
String noValue,
boolean caseSensitive)
AttributeModifier for the attribute name with the given
"no value" value and case sensitivity.
attributeName - Name of the attributenoValue - "no value" value (null if the attribute is not required).caseSensitive - boolean indicating if attribute value comparisions are case sensitive.| Method Detail |
|---|
public String getAttributeName()
public void setAttributeName(String attributeName)
attributeName - the attribute name to setpublic String getNoValue()
null, this value is stored in the
attribute when the modifications identified here would result in the attribute having
no values.
public void setNoValue(String noValue)
null, this value is stored in the
attribute when the modifications identified here would result in the attribute having
no values.
noValue - "no value" string, or null if the attribute is not required to
have values.public boolean isCaseSensitive()
true if case sensitive, and false otherwisepublic void clear()
public void init()
public void init(Attribute attribute)
throws NamingException
attribute - Attribute
NamingException - thrown if an error occurs accessing the attribute values
InvalidAttributeValueException - thrown if a non-String value is encounteredpublic void init(Collection<String> collection)
collection - Initial valuespublic void initDSML(org.openspml.v2.profiles.dsml.DSMLValue... dsmlValues)
public void initReference(Collection<org.openspml.v2.msg.spmlref.Reference> references)
throws org.openspml.v2.util.Spml2Exception
org.openspml.v2.util.Spml2Exceptionpublic void store(String attrValue)
attrValue - Attribute value
NamingException - thrown if a naming exception occurspublic void store(org.openspml.v2.profiles.dsml.DSMLValue[] dsmlValues)
public void store(Collection<org.openspml.v2.msg.spmlref.Reference> references)
throws org.openspml.v2.util.Spml2Exception
org.openspml.v2.util.Spml2Exceptionpublic Attribute getAdditions()
public ModificationItem[] getModifications()
throws NamingException
NamingException - thrown if a naming error occurs
public List<org.openspml.v2.msg.spml.Modification> getDSMLModification()
throws org.openspml.v2.profiles.dsml.DSMLProfileException
org.openspml.v2.profiles.dsml.DSMLProfileException
public List<org.openspml.v2.msg.spml.Modification> getReferenceModification()
throws org.openspml.v2.util.Spml2Exception
org.openspml.v2.util.Spml2Exceptionpublic AttributeModifier.Values getAdds()
public AttributeModifier.Values getDeletes()
public void retainAll()
NamingException - thrown if a naming error occursprotected String makeComparisonString(String value)
value - string to convert.
public AttributeModifier.Values getRetainedValues()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||