|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.identityconnectors.framework.common.objects.AttributeBuilder
public final class AttributeBuilder
Simplifies constructing instances of Attribute
. A Connector
developer does not need to implement the Attribute
interface. The builder returns an instance of an implementation of Attribute
that overrides the methods equals()
, hashcode()
and toString()
to provide a uniform and robust class. This implementation is backed by an ArrayList
that contains the values and preserves the order of those values (in case the order of values is significant to the target system or application).
Constructor Summary | |
---|---|
AttributeBuilder() |
Method Summary | |
---|---|
AttributeBuilder |
addValue(java.util.Collection<?> obj) Adds each object in the collection as a value for the attribute that is being built. |
AttributeBuilder |
addValue(java.lang.Object... objs) Add each of the specified objects as a values for the attribute that is being built. |
Attribute |
build() |
static Attribute |
build(java.lang.String name) Creates a attribute with the specified name and a null value. |
static Attribute |
build(java.lang.String name, java.util.Collection<?> obj) Creates an Attribute with the name and the values provided. |
static Attribute |
build(java.lang.String name, java.lang.Object... args) Creates an Attribute with the name and the values provided. |
static Attribute |
buildCurrentAttributes(ObjectClass objectClass, java.util.Set<Attribute> attributes) Builds an operational attribute that represents current object values on the target system. |
static Attribute |
buildCurrentPassword(char[] password) Builds an operational attribute that represents the current password of an object on a target system or application. |
static Attribute |
buildCurrentPassword(GuardedString password) Builds an operational attribute that represents the current password of an object on a target system or application. |
static Attribute |
buildDisableDate(java.util.Date date) Builds an operational attribute that represents the date and time to disable an object on a target system or application. |
static Attribute |
buildDisableDate(long date) Builds an operational attribute that represents the date and time to disable an object on a target system or application. |
static Attribute |
buildEnabled(boolean value) Builds an operational attribute that represents whether object is enabled on a target system or application. |
static Attribute |
buildEnableDate(java.util.Date date) Builds an operational attribute that represents the date and time to enable an object on a target system or application. |
static Attribute |
buildEnableDate(long date) Builds an operational attribute that represents the date and time to enable an object on a target system or application. |
static Attribute |
buildLastLoginDate(java.util.Date date) Builds an pre-defined attribute that represents the date and time of the most recent login for an object (such as an account) on a target system or application. |
static Attribute |
buildLastLoginDate(long date) Builds an pre-defined attribute that represents the date and time of the most recent login for an object (such as an account) on a target system or application. |
static Attribute |
buildLastPasswordChangeDate(java.util.Date date) Builds an pre-defined attribute that represents the date and time that the password was most recently changed for an object (such as an account) on a target system or application. |
static Attribute |
buildLastPasswordChangeDate(long date) Builds an pre-defined attribute that represents the date and time that the password was most recently changed for an object (such as an account) on a target system or application. |
static Attribute |
buildLockOut(boolean lock) Builds an operational attribute that represents whether an object is locked out on a target system or application. |
static Attribute |
buildPassword(char[] password) Builds an operational attribute that represents the password of an object on a target system or application. |
static Attribute |
buildPassword(GuardedString password) Builds an operational attribute that represents the password of an object on a target system or application. |
static Attribute |
buildPasswordChangeInterval(long value) Builds an pre-defined attribute that represents how often the password must be changed for an object (such as an account) on a target system or application. |
static Attribute |
buildPasswordExpirationDate(java.util.Date dateTime) Builds an operational attribute that represents the date and time that a password will expire on a target system or application. |
static Attribute |
buildPasswordExpirationDate(long dateTime) Builds an operational attribute that represents the date/time that a password will expire on a target system or application. |
static Attribute |
buildPasswordExpired(boolean value) Builds an operational attribute that represents whether the password of an object is expired on a target system or application. |
java.lang.String |
getName() Get the name of the attribute that is being built. |
java.util.List<java.lang.Object> |
getValue() Return any current value of the attribute that is being built. |
AttributeBuilder |
setName(java.lang.String name) Set the name of the attribute that is being built. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributeBuilder()
Method Detail |
---|
public static Attribute build(java.lang.String name)
null
value.name
- unique name of the attribute.Attribute
with a null
value.public static Attribute build(java.lang.String name, java.lang.Object... args)
Attribute
with the name and the values provided.name
- unique name of the attribute.args
- variable number of arguments that are used as values for the attribute.Attribute
with the specified name and a value that includes the arguments provided.public static Attribute build(java.lang.String name, java.util.Collection<?> obj)
Attribute
with the name and the values provided.name
- unique name of the attribute.obj
- a collection of objects that are used as values for the attribute.Attribute
with the specified name and a value that includes the arguments provided.public java.lang.String getName()
public AttributeBuilder setName(java.lang.String name)
java.lang.IllegalArgumentException
- iff the name parameter is blank.public java.util.List<java.lang.Object> getValue()
public AttributeBuilder addValue(java.lang.Object... objs)
objs
- the values to addjava.lang.NullPointerException
- iff any of the values is null.public AttributeBuilder addValue(java.util.Collection<?> obj)
obj
- the values to addjava.lang.NullPointerException
- iff any of the values is null.public Attribute build()
java.lang.IllegalArgumentException
- if no name has been provided.public static Attribute buildPasswordExpirationDate(java.util.Date dateTime)
dateTime
- UTC time in milliseconds.Attribute
with the pre-defined name for password expiration date.public static Attribute buildPasswordExpirationDate(long dateTime)
dateTime
- UTC time in milliseconds.Attribute
with the pre-defined name for password expiration date.public static Attribute buildPassword(GuardedString password)
password
- the string that represents a password.Attribute
with the predefined name for password.public static Attribute buildPassword(char[] password)
The caller is responsible for clearing out the array of characters.
password
- the characters that represent a password.Attribute
with the predefined name for password.public static Attribute buildCurrentPassword(GuardedString password)
Passing the current password indicates the account owner (and not an administrator) is changing the password. The use case is that an administrator password change may not keep history or validate against policy.
password
- the string that represents a password.Attribute
with the predefined name for current password.public static Attribute buildCurrentPassword(char[] password)
Passing the current password indicates the account owner (and not an administrator) is changing the password. The use case is that an administrator password change may not keep history or validate against policy.
The caller is responsible for clearing out the array of characters.
password
- the characters that represent a password.Attribute
with the predefined name for current password.public static Attribute buildEnabled(boolean value)
CreateApiOp
or UpdateApiOp
to enable or disable an object.GetApiOp
to determine whether an object currently is enabled or disabled.SearchApiOp
to select objects that are enabled or to select objects that are disabled.value
- true indicates the object is enabled; otherwise false.Attribute
with the predefined name for enabled.public static Attribute buildEnableDate(java.util.Date date)
CreateApiOp
or UpdateApiOp
to set a date and time to enable an object.GetApiOp
to determine when an object will be enabled.SearchApiOp
to select objects that are scheduled to be enabled at a certain date and time.date
- The date and time to enable a particular object.Attribute
with the predefined name for enable date.public static Attribute buildEnableDate(long date)
CreateApiOp
or UpdateApiOp
to set a date and time to enable an object.GetApiOp
to determine when an object will be enabled.SearchApiOp
to select objects that are scheduled to be enabled at a certain date and time.date
- The date and time (UTC in milliseconds) to enable a particular object.Attribute
with the predefined name for enable date.public static Attribute buildDisableDate(java.util.Date date)
CreateApiOp
or UpdateApiOp
to set a date and time to disable an object.GetApiOp
to determine when an object will be disabled.SearchApiOp
to select objects that are scheduled to be disabled at a certain date and time.date
- The date and time to disable a particular object.Attribute
with the predefined name for disable date.public static Attribute buildDisableDate(long date)
CreateApiOp
or UpdateApiOp
to set a date and time to disable an object.GetApiOp
to determine when an object will be disabled.SearchApiOp
to select objects that are scheduled to be disabled at a certain date and time.date
- The date and time (UTC in milliseconds) to disable a particular object.Attribute
with the predefined name for disable date.public static Attribute buildLockOut(boolean lock)
GetApiOp
to determine whether an object is currently locked out.UpdateApiOp
to clear the lock-out status of an object (or to set the lock-out status of an object).SearchApiOp
to select objects that are currently locked out (or to select objects that are not currently locked out).lock
- true if the object is locked out; otherwise false.Attribute
with the predefined name for lockout state.public static Attribute buildPasswordExpired(boolean value)
GetApiOp
to determine whether the password of an object is currently expired.UpdateApiOp
to expire the password of an object (or to clear the expired status of the password of an object).SearchApiOp
to select objects that have passwords that are currently expired (or to select objects that have passwords that are not currently expired).value
- from the API true expires and from the SPI its shows its either expired or not.Attribute
with the predefined name for password expiration state.public static Attribute buildLastLoginDate(java.util.Date date)
date
- The date and time of the last login.Attribute
with the predefined name for password expiration state.public static Attribute buildLastLoginDate(long date)
The time parameter is UTC in milliseconds.
date
- The date and time (UTC in milliseconds) of the last login.Attribute
with the predefined name for password expiration state.public static Attribute buildLastPasswordChangeDate(java.util.Date date)
date
- The date and time that the password was most recently changed.Attribute
with the predefined name for password expiration state.public static Attribute buildLastPasswordChangeDate(long date)
The time parameter is UTC in milliseconds.
date
- The date and time that the password was most recently changed.Attribute
with the predefined name for password expiration state.public static Attribute buildPasswordChangeInterval(long value)
The value for this attribute is expressed in milliseconds.
value
- The number of milliseconds between the time that the password was most recently changed and the time when the password must be changed again.Attribute
with the predefined name for password expiration state.public static Attribute buildCurrentAttributes(ObjectClass objectClass, java.util.Set<Attribute> attributes)
Intended to be used with Update operation.
This is usable when the connector is not able to query the target system for current attributes (there might be some attributes which are not stored at target system) - or - to preserve query of the target system if the performance is the concern.
Note that current attributes are represented as attribute with one attribute value which is of type EmbeddedObject
.
objectClass
- ObjectClass of the current object.attributes
- Set of attributes representing the current attributes of the object on the target system.Attribute
with the predefined name.java.lang.IllegalArgumentException
- if objectClass
is nulljava.lang.NullPointerException
- if attributes
is null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |