Class AttributeBuilder
java.lang.Object
org.identityconnectors.framework.common.objects.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).- Since:
- 1.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd each of the specified objects as a values for the attribute that is being built.addValue
(Collection<?> obj) Adds each object in the collection as a value for the attribute that is being built.build()
static Attribute
Creates a attribute with the specified name and anull
value.static Attribute
Creates anAttribute
with the name and the values provided.static Attribute
build
(String name, Collection<?> obj) Creates anAttribute
with the name and the values provided.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
(long date) Builds an operational attribute that represents the date and time to disable an object on a target system or application.static Attribute
buildDisableDate
(Date 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
(long date) Builds an operational attribute that represents the date and time to enable an object on a target system or application.static Attribute
buildEnableDate
(Date date) Builds an operational attribute that represents the date and time to enable an object 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
buildLastLoginDate
(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
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
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
(long dateTime) Builds an operational attribute that represents the date/time that a password will expire on a target system or application.static Attribute
buildPasswordExpirationDate
(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
buildPasswordExpired
(boolean value) Builds an operational attribute that represents whether the password of an object is expired on a target system or application.Clearsvalue
to recycle thisAttributeBuilder
.getName()
Get the name of the attribute that is being built.getValue()
Return any current value of the attribute that is being built.Set the name of the attribute that is being built.
-
Constructor Details
-
AttributeBuilder
public AttributeBuilder()
-
-
Method Details
-
build
Creates a attribute with the specified name and anull
value.- Parameters:
name
- unique name of the attribute.- Returns:
- instance of
Attribute
with anull
value.
-
build
Creates anAttribute
with the name and the values provided.- Parameters:
name
- unique name of the attribute.args
- variable number of arguments that are used as values for the attribute.- Returns:
- instance of
Attribute
with the specified name and a value that includes the arguments provided.
-
build
Creates anAttribute
with the name and the values provided.- Parameters:
name
- unique name of the attribute.obj
- a collection of objects that are used as values for the attribute.- Returns:
- instance of
Attribute
with the specified name and a value that includes the arguments provided.
-
getName
Get the name of the attribute that is being built.- Returns:
- The name of the attribute.
-
setName
Set the name of the attribute that is being built.- Throws:
IllegalArgumentException
- if the name parameter is blank.
-
clearValue
Clearsvalue
to recycle thisAttributeBuilder
. -
getValue
Return any current value of the attribute that is being built.- Returns:
- any current value of the attribute that is being built.
-
addValue
Add each of the specified objects as a values for the attribute that is being built.- Parameters:
objs
- the values to add- Throws:
NullPointerException
- if any of the values is null.
-
addValue
Adds each object in the collection as a value for the attribute that is being built.- Parameters:
obj
- the values to add- Throws:
NullPointerException
- if any of the values is null.
-
build
- Returns:
- a new attribute with the name and any values that have been provided to the builder.
- Throws:
IllegalArgumentException
- if no name has been provided.
-
buildPasswordExpirationDate
Builds an operational attribute that represents the date and time that a password will expire on a target system or application.- Parameters:
dateTime
- UTC time in milliseconds.- Returns:
- an
Attribute
with the pre-defined name for password expiration date.
-
buildPasswordExpirationDate
Builds an operational attribute that represents the date/time that a password will expire on a target system or application.- Parameters:
dateTime
- UTC time in milliseconds.- Returns:
- an
Attribute
with the pre-defined name for password expiration date.
-
buildPassword
Builds an operational attribute that represents the password of an object on a target system or application.- Parameters:
password
- the string that represents a password.- Returns:
- an
Attribute
with the predefined name for password.
-
buildPassword
Builds an operational attribute that represents the password of an object on a target system or application.The caller is responsible for clearing out the array of characters.
- Parameters:
password
- the characters that represent a password.- Returns:
- an
Attribute
with the predefined name for password.
-
buildCurrentPassword
Builds an operational attribute that represents the current password of an object on a target system or application.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.
- Parameters:
password
- the string that represents a password.- Returns:
- an
Attribute
with the predefined name for current password.
-
buildCurrentPassword
Builds an operational attribute that represents the current password of an object on a target system or application.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.
- Parameters:
password
- the characters that represent a password.- Returns:
- an
Attribute
with the predefined name for current password.
-
buildEnabled
Builds an operational attribute that represents whether object is enabled on a target system or application.- Use this attribute with
CreateApiOp
orUpdateApiOp
to enable or disable an object. - Read this attribute from
GetApiOp
to determine whether an object currently is enabled or disabled. - Use this attribute with
SearchApiOp
to select objects that are enabled or to select objects that are disabled.
- Parameters:
value
- true indicates the object is enabled; otherwise false.- Returns:
- an
Attribute
with the predefined name for enabled.
- Use this attribute with
-
buildEnableDate
Builds an operational attribute that represents the date and time to enable an object on a target system or application.- Use this attribute with
CreateApiOp
orUpdateApiOp
to set a date and time to enable an object. - Read this attribute from
GetApiOp
to determine when an object will be enabled. - Use this attribute with
SearchApiOp
to select objects that are scheduled to be enabled at a certain date and time.
- Parameters:
date
- The date and time to enable a particular object.- Returns:
- an
Attribute
with the predefined name for enable date.
- Use this attribute with
-
buildEnableDate
Builds an operational attribute that represents the date and time to enable an object on a target system or application. The date-and-time parameter is UTC in milliseconds.- Use this attribute with
CreateApiOp
orUpdateApiOp
to set a date and time to enable an object. - Read this attribute from
GetApiOp
to determine when an object will be enabled. - Use this attribute with
SearchApiOp
to select objects that are scheduled to be enabled at a certain date and time.
- Parameters:
date
- The date and time (UTC in milliseconds) to enable a particular object.- Returns:
- an
Attribute
with the predefined name for enable date.
- Use this attribute with
-
buildDisableDate
Builds an operational attribute that represents the date and time to disable an object on a target system or application.- Use this attribute with
CreateApiOp
orUpdateApiOp
to set a date and time to disable an object. - Read this attribute from
GetApiOp
to determine when an object will be disabled. - Use this attribute with
SearchApiOp
to select objects that are scheduled to be disabled at a certain date and time.
- Parameters:
date
- The date and time to disable a particular object.- Returns:
- an
Attribute
with the predefined name for disable date.
- Use this attribute with
-
buildDisableDate
Builds an operational attribute that represents the date and time to disable an object on a target system or application. The date-and-time parameter is UTC in milliseconds.- Use this attribute with
CreateApiOp
orUpdateApiOp
to set a date and time to disable an object. - Read this attribute from
GetApiOp
to determine when an object will be disabled. - Use this attribute with
SearchApiOp
to select objects that are scheduled to be disabled at a certain date and time.
- Parameters:
date
- The date and time (UTC in milliseconds) to disable a particular object.- Returns:
- an
Attribute
with the predefined name for disable date.
- Use this attribute with
-
buildLockOut
Builds an operational attribute that represents whether an object is locked out on a target system or application.- Read this attribute from
GetApiOp
to determine whether an object is currently locked out. - Use this attribute with
UpdateApiOp
to clear the lock-out status of an object (or to set the lock-out status of an object). - Use this attribute with
SearchApiOp
to select objects that are currently locked out (or to select objects that are not currently locked out).
- Parameters:
lock
- true if the object is locked out; otherwise false.- Returns:
- an
Attribute
with the predefined name for lockout state.
- Read this attribute from
-
buildPasswordExpired
Builds an operational attribute that represents whether the password of an object is expired on a target system or application.- Read this attribute from
GetApiOp
to determine whether the password of an object is currently expired. - Use this attribute with
UpdateApiOp
to expire the password of an object (or to clear the expired status of the password of an object). - Use this attribute with
SearchApiOp
to select objects that have passwords that are currently expired (or to select objects that have passwords that are not currently expired).
- Parameters:
value
- from the API true expires and from the SPI its shows its either expired or not.- Returns:
- an
Attribute
with the predefined name for password expiration state.
- Read this attribute from
-
buildLastLoginDate
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.- Parameters:
date
- The date and time of the last login.- Returns:
- an
Attribute
with the predefined name for password expiration state.
-
buildLastLoginDate
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.The time parameter is UTC in milliseconds.
- Parameters:
date
- The date and time (UTC in milliseconds) of the last login.- Returns:
- an
Attribute
with the predefined name for password expiration state.
-
buildLastPasswordChangeDate
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.- Parameters:
date
- The date and time that the password was most recently changed.- Returns:
- an
Attribute
with the predefined name for password expiration state.
-
buildLastPasswordChangeDate
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.The time parameter is UTC in milliseconds.
- Parameters:
date
- The date and time that the password was most recently changed.- Returns:
- an
Attribute
with the predefined name for password expiration state.
-
buildPasswordChangeInterval
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.The value for this attribute is expressed in milliseconds.
- Parameters:
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.- Returns:
- an
Attribute
with the predefined name for password expiration state.
-