Modifier and Type | Method and Description |
---|---|
static Set<Attribute> |
addUid(Set<Attribute> attrs,
Uid uid)
Returns a mutable copy of the original set with the uid attribute added.
|
static String |
createSpecialName(String name)
Create a special name from the specified name.
|
static Set<Attribute> |
filterUid(Set<Attribute> attrs)
Returns a mutable copy of the original set with the uid attribute
removed.
|
static Attribute |
find(String name,
Set<Attribute> attrs)
|
static String |
getAsStringValue(Attribute attr)
Get the string value from the specified (single-valued) attribute.
|
static Set<Attribute> |
getBasicAttributes(Set<Attribute> attrs)
Filter out any special attribute from the specified set.
|
static BigDecimal |
getBigDecimalValue(Attribute attr)
Get the big decimal value from the specified (single-valued) attribute.
|
static BigInteger |
getBigIntegerValue(Attribute attr)
Get the big integer value from the specified (single-valued) attribute.
|
static Boolean |
getBooleanValue(Attribute attr)
Get the boolean value from the specified (single-valued) attribute.
|
static Byte[] |
getByteArrayValue(Attribute attr)
Get the byte array value from the specified (single-valued) attribute.
|
static Byte |
getByteValue(Attribute attr)
Get the byte value from the specified (single-valued) attribute.
|
static Character |
getCharacterValue(Attribute attr)
Get the character value from the specified (single-valued) attribute.
|
static GuardedString |
getCurrentPasswordValue(Set<Attribute> attrs)
Get the current password value from the provided set of
Attribute
s. |
static Date |
getDateValue(Attribute attr)
Get the date value from the specified (single-valued) attribute that
contains a long.
|
static Double |
getDoubleValue(Attribute attr)
Get the double value from the specified (single-valued) attribute.
|
static Date |
getEnableDate(Set<Attribute> attrs)
Get the enable date from the set of attributes.
|
static Float |
getFloatValue(Attribute attr)
Get the float value from the specified (single-valued) attribute.
|
static GuardedByteArray |
getGuardedByteArrayValue(Attribute attr)
Get the
GuardedByteArray value from the specified (single-valued)
attribute. |
static GuardedString |
getGuardedStringValue(Attribute attr)
Get the
GuardedString value from the specified (single-valued)
attribute. |
static Integer |
getIntegerValue(Attribute attr)
Get the integer value from the specified (single-valued) attribute.
|
static Long |
getLongValue(Attribute attr)
Get the long value from the specified (single-valued) attribute.
|
static Map<String,Object> |
getMapValue(Attribute attr)
Get the map value from the specified (single-valued) attribute.
|
static Name |
getNameFromAttributes(Set<Attribute> attrs)
Get the
Name attribute from the specified set of attributes. |
static Date |
getPasswordExpirationDate(ConnectorObject obj)
Retrieve the password expiration date from the
ConnectorObject . |
static Boolean |
getPasswordExpired(Set<Attribute> attrs)
Get the password expired attribute from a
Collection of
Attribute s. |
static GuardedString |
getPasswordValue(Set<Attribute> attrs)
Get the password value from the provided set of
Attribute s. |
static Object |
getSingleValue(Attribute attr)
Get the
Object value from the specified (single-valued)
attribute. |
static Set<Attribute> |
getSpecialAttributes(Set<Attribute> attrs)
Filter out any basic attributes from the specified set, leaving only
special attributes.
|
static String |
getStringValue(Attribute attr)
Get the string value from the specified (single-valued) attribute.
|
static Uid |
getUidAttribute(Set<Attribute> attrs)
Get the
Uid from the specified set of attributes. |
static Boolean |
isEnabled(ConnectorObject obj)
Determine if the
ConnectorObject is enable. |
static Boolean |
isLockedOut(ConnectorObject obj)
Determine if the
ConnectorObject is locked out. |
static Boolean |
isPasswordExpired(ConnectorObject obj)
Determine if the password is expired for this object.
|
static boolean |
isSpecial(Attribute attr)
Determines whether the specified attribute is a special attribute.
|
static boolean |
isSpecial(AttributeInfo attr)
Determines whether the specified attribute info is for a special
attribute.
|
static boolean |
isSpecialName(String name)
Determines whether the specified attribute name is special in the sense
of
createSpecialName(java.lang.String) . |
static boolean |
namesEqual(String name1,
String name2)
Compares two attribute names for equality.
|
static Map<String,Attribute> |
toMap(Collection<? extends Attribute> attributes)
|
public static String getStringValue(Attribute attr)
attr
- Attribute from which to retrieve the string value.ClassCastException
- if the object in the attribute is not a string.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static Character getCharacterValue(Attribute attr)
attr
- Attribute from which to retrieve the character value.ClassCastException
- if the object in the attribute is not a character.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static GuardedByteArray getGuardedByteArrayValue(Attribute attr)
GuardedByteArray
value from the specified (single-valued)
attribute.attr
- Attribute from which to retrieve the guarded byte array value.ClassCastException
- if the object in the attribute is not a GuardedByteArray.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static GuardedString getGuardedStringValue(Attribute attr)
GuardedString
value from the specified (single-valued)
attribute.attr
- Attribute from which to retrieve the guarded string value.ClassCastException
- if the object in the attribute is not a GuardedString.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static String getAsStringValue(Attribute attr)
attr
- Attribute from which to retrieve the string value.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static Byte getByteValue(Attribute attr)
attr
- Attribute from which to retrieve the byte value.ClassCastException
- if the object in the attribute is not a byte.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static Byte[] getByteArrayValue(Attribute attr)
attr
- Attribute from which to retrieve the byte array value.ClassCastException
- if the object in the attribute is not a byte array.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static Integer getIntegerValue(Attribute attr)
attr
- Attribute from which to retrieve the integer value.ClassCastException
- if the object in the attribute is not an integer.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static Long getLongValue(Attribute attr)
attr
- Attribute from which to retrieve the long value.ClassCastException
- if the object in the attribute is not a long.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static Float getFloatValue(Attribute attr)
attr
- Attribute from which to retrieve the float value.ClassCastException
- if the object in the attribute is not a float.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static Date getDateValue(Attribute attr)
attr
- Attribute from which to retrieve the date value.ClassCastException
- if the object in the attribute is not a long.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static Double getDoubleValue(Attribute attr)
attr
- Attribute from which to retrieve the double value.ClassCastException
- if the object in the attribute is not a double.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued)..public static BigDecimal getBigDecimalValue(Attribute attr)
attr
- Attribute from which to retrieve the big decimal value.ClassCastException
- if the object in the attribute is not a big decimal.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static BigInteger getBigIntegerValue(Attribute attr)
attr
- Attribute from which to retrieve the big integer value.ClassCastException
- if the object in the attribute is not a big integer.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static Boolean getBooleanValue(Attribute attr)
attr
- Attribute from which to retrieve the boolean value.ClassCastException
- if the object in the attribute is not an Boolean
.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static Map<String,Object> getMapValue(Attribute attr)
attr
- Attribute from which to retrieve the map value.ClassCastException
- if the object in the attribute is not an Map
.IllegalArgumentException
- if the attribute is a multi-valued (rather than
single-valued).public static Object getSingleValue(Attribute attr)
Object
value from the specified (single-valued)
attribute.null
if the attribute's list of values is
null
or empty.public static Map<String,Attribute> toMap(Collection<? extends Attribute> attributes)
Collection
of Attribute
instances into a
Map
.
The key to each element in the map is the name of an
Attribute
. The value of each element in the map is the
Attribute
instance with that name.attributes
- set of attribute to transform to a map.NullPointerException
- if the parameter attributes is
null.public static Uid getUidAttribute(Set<Attribute> attrs)
Uid
from the specified set of attributes.public static Set<Attribute> getBasicAttributes(Set<Attribute> attrs)
Name
, Uid
, and
OperationalAttributes
.attrs
- set of Attribute
s to filter out the operational and
default attributes.public static Set<Attribute> getSpecialAttributes(Set<Attribute> attrs)
Name
, Uid
, and
OperationalAttributes
.attrs
- set of Attribute
s to filter out the basic attributespublic static Set<Attribute> filterUid(Set<Attribute> attrs)
attrs
- The original set. Must not be null.public static Set<Attribute> addUid(Set<Attribute> attrs, Uid uid)
attrs
- The original set. Must not be null.uid
- The uid. Must not be null.public static boolean isSpecial(Attribute attr)
Uid
, ObjectClass
and
OperationalAttributes
.attr
- Attribute
to test for against.Uid
, ObjectClass
or one of the OperationalAttributes
.NullPointerException
- if the attribute parameter is null.public static boolean isSpecial(AttributeInfo attr)
Uid
, ObjectClass
and OperationalAttributes
.attr
- AttributeInfo
to test for against.Uid
, ObjectClass
or one of the OperationalAttributes
.NullPointerException
- if the attribute parameter is null.public static boolean isSpecialName(String name)
createSpecialName(java.lang.String)
.name
- the attribute name to test against.public static String createSpecialName(String name)
__
string as both prefix and suffix. This indicates that an attribute name
identifies a "special attribute" such as Uid
, ObjectClass
or one of the OperationalAttributes
.public static boolean namesEqual(String name1, String name2)
name1
- the first attribute name.name2
- the second attribute name.public static Name getNameFromAttributes(Set<Attribute> attrs)
Name
attribute from the specified set of attributes.attrs
- set of attributes to search against.Name
attribute it if exsist otherwise
null
.public static GuardedString getPasswordValue(Set<Attribute> attrs)
Attribute
s.public static GuardedString getCurrentPasswordValue(Set<Attribute> attrs)
Attribute
s.attrs
- Set of Attribute
s that may contain the current
password OperationalAttributes.CURRENT_PASSWORD_NAME
Attribute
.null
if it does not exist in the Set
else
the value.public static Boolean isLockedOut(ConnectorObject obj)
ConnectorObject
is locked out. By getting the
value of the OperationalAttributes.LOCK_OUT_NAME
.obj
- ConnectorObject
object to inspect.null
if the attribute does not exist otherwise to
value of the Attribute
.NullPointerException
- if the parameter 'obj' is null
.public static Boolean isEnabled(ConnectorObject obj)
ConnectorObject
is enable. By getting the value
of the OperationalAttributes.ENABLE_NAME
.obj
- ConnectorObject
object to inspect.null
if the attribute does not exist otherwise to
value of the Attribute
.IllegalStateException
- if the object does not contain attribute in question.NullPointerException
- if the parameter 'obj' is null
.public static Date getPasswordExpirationDate(ConnectorObject obj)
ConnectorObject
.obj
- ConnectorObject
object to inspect.null
if the Attribute
does not exist
otherwise the value of the Attribute
.IllegalStateException
- if the object does not contain attribute in question.NullPointerException
- if the parameter 'obj' is null
.public static Boolean getPasswordExpired(Set<Attribute> attrs)
Collection
of
Attribute
s.public static Boolean isPasswordExpired(ConnectorObject obj)
obj
- ConnectorObject
that should contain a password expired
attribute.null
if the attribute does not exist and the value
of the Attribute
if it does.Copyright © 2022. All rights reserved.