Interface Attributes
- All Known Implementing Classes:
DefaultAttributes
,ServiceAccountAttributes
This interface wraps the attributes associated with a user profile. Different operations are provided to access and manage these attributes.
Attributes are classified as:
- Managed
- Unmanaged
A managed attribute is any attribute defined in the user profile configuration. Therefore, they are known by the server and can be managed accordingly.
A unmanaged attributes is any attribute not defined in the user profile configuration. Therefore, the server
does not know about them and they cannot use capabilities provided by the server. However, they can still be managed by
administrators by setting any of the UPConfig.UnmanagedAttributePolicy
.
Any attribute available from this interface has a corresponding AttributeMetadata
UPConfig
and the availability of the attribute in
a given UserProfileContext
.- Author:
- Pedro Igor
-
Field Summary
Modifier and TypeFieldDescriptionDefault value for attributes with no value set. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether an attribute with the givenname
is defined.Returns all values for an attribute with the givenname
.default String
Returns the first value associated with the attribute with the given .getMetadata
(String name) Returns the metadata associated with the attribute with the givenname
.Returns only the attributes that have read permissions in a particularUserProfileContext
.Returns aMap
holding any unmanaged attribute.Returns all the attributes with read-write permissions in a particularUserProfileContext
.boolean
isReadOnly
(String name) Checks whether an attribute is read-only.boolean
isRequired
(String name) Returns whether the attribute with the givenname
is required.nameSet()
Returns the names of all defined attributes.toMap()
Returns the attributes as aMap
that are accessible to a particularUserProfileContext
.boolean
validate
(String name, Consumer<ValidationError>... listeners) Validates the attribute with the givenname
.
-
Field Details
-
EMPTY_VALUE
Default value for attributes with no value set.
-
-
Method Details
-
getFirst
Returns the first value associated with the attribute with the given .- Parameters:
name
- the name of the attribute- Returns:
- the first value
-
get
Returns all values for an attribute with the givenname
.- Parameters:
name
- the name of the attribute- Returns:
- the attribute values
-
isReadOnly
Checks whether an attribute is read-only.- Parameters:
name
- the attribute name- Returns:
true
if the attribute is read-only. Otherwise,false
-
validate
Validates the attribute with the givenname
.- Parameters:
name
- the name of the attributelisteners
- the listeners for listening for errors.ValidationError.inputHint
contains name of the attribute in error.- Returns:
true
if validation is successful. Otherwise,false
. In case there is no attribute with the givenname
,false
is also returned but without triggering listeners
-
contains
Checks whether an attribute with the givenname
is defined.- Parameters:
name
- the name of the attribute- Returns:
true
if the attribute is defined. Otherwise,false
-
nameSet
Returns the names of all defined attributes.- Returns:
- the set of attribute names
-
getWritable
Returns all the attributes with read-write permissions in a particularUserProfileContext
.- Returns:
- the attributes
-
getMetadata
Returns the metadata associated with the attribute with the given
name
.The
AttributeMetadata
is a copy of the original metadata. The original metadata keeps immutable.- Parameters:
name
- the attribute name- Returns:
- the metadata
-
isRequired
Returns whether the attribute with the givenname
is required.- Parameters:
name
- the attribute name- Returns:
true
if the attribute is required. Otherwise,false
.
-
getReadable
Returns only the attributes that have read permissions in a particularUserProfileContext
.- Returns:
- the attributes with read permission.
-
toMap
Returns the attributes as aMap
that are accessible to a particularUserProfileContext
.- Returns:
- a map with all the attributes
-
getUnmanagedAttributes
Returns aMap
holding any unmanaged attribute.- Returns:
- a map with any unmanaged attribute
-