public final class AttributeFilter extends Object
AttributeFilter
is useful for performing fine-grained access control,
selecting attributes based on search request criteria, and selecting
attributes based on post- and pre- read request control criteria.
In cases where methods accept a string based list of attribute descriptions, the following special attribute descriptions are permitted:
Constructor and Description |
---|
AttributeFilter()
Creates a new attribute filter which will include all user attributes but
no operational attributes.
|
AttributeFilter(Collection<String> attributeDescriptions)
Creates a new attribute filter which will include the attributes
identified by the provided search request attribute list.
|
AttributeFilter(Collection<String> attributeDescriptions,
Schema schema)
Creates a new attribute filter which will include the attributes
identified by the provided search request attribute list.
|
AttributeFilter(String... attributeDescriptions)
Creates a new attribute filter which will include the attributes
identified by the provided search request attribute list.
|
Modifier and Type | Method and Description |
---|---|
Entry |
filteredCopyOf(Entry entry)
Returns a modifiable filtered copy of the provided entry.
|
Entry |
filteredViewOf(Entry entry)
Returns an unmodifiable filtered view of the provided entry.
|
AttributeFilter |
includeAllOperationalAttributes(boolean include)
Specifies whether all operational attributes should be included in
filtered entries.
|
AttributeFilter |
includeAllUserAttributes(boolean include)
Specifies whether all user attributes should be included in
filtered entries.
|
AttributeFilter |
includeAttribute(AttributeDescription attributeDescription)
Specifies that the named attribute should be included in filtered
entries.
|
AttributeFilter |
includeAttribute(String attributeDescription)
Specifies that the named attribute should be included in filtered
entries.
|
AttributeFilter |
includeAttribute(String attributeDescription,
Schema schema)
Specifies that the named attribute should be included in filtered
entries.
|
AttributeFilter |
includeAttribute(String attributeDescription,
Schema schema,
boolean includeAttributesFromSuperiors)
Specifies that the named attribute should be included in filtered
entries.
|
boolean |
matchesAllAttributes()
Returns
true if this attribute filter matches all attributes, regardless of whether they are user or
operational attributes. |
boolean |
matchesAllOperationalAttributes()
Returns
true if this attribute filter matches all operational attributes. |
boolean |
matchesAllUserAttributes()
Returns
true if this attribute filter matches all user attributes. |
boolean |
matchesAnyAttributes()
Returns
true if this attribute filter may match some attributes, or false if it will never
match any attributes. |
boolean |
matchesAttribute(AttributeDescription attributeDescription)
Returns
true if this attribute filter matches the provided attribute description. |
String |
toString() |
AttributeFilter |
typesOnly(boolean typesOnly)
Specifies whether filtered attributes are to contain both
attribute descriptions and values, or just attribute descriptions.
|
public AttributeFilter()
public AttributeFilter(Collection<String> attributeDescriptions)
attributeDescriptions
- The names of the attributes to be included with each entry.public AttributeFilter(Collection<String> attributeDescriptions, Schema schema)
attributeDescriptions
- The names of the attributes to be included with each entry.schema
- The schema The schema to use when parsing attribute
descriptions and object class names.public AttributeFilter(String... attributeDescriptions)
attributeDescriptions
- The names of the attributes to be included with each entry.public Entry filteredCopyOf(Entry entry)
entry
- The entry to be filtered and copied.public Entry filteredViewOf(Entry entry)
entry
- The entry to be filtered.public AttributeFilter includeAllOperationalAttributes(boolean include)
include
- true
if operational attributes should be included in
filtered entries.public AttributeFilter includeAllUserAttributes(boolean include)
include
- true
if user attributes should be included in filtered
entries.public AttributeFilter includeAttribute(AttributeDescription attributeDescription)
attributeDescription
- The name of the attribute to be included in filtered entries.public AttributeFilter includeAttribute(String attributeDescription)
attributeDescription
- The name of the attribute to be included in filtered entries.public AttributeFilter includeAttribute(String attributeDescription, Schema schema)
attributeDescription
- The name of the attribute to be included in filtered entries.schema
- The schema The schema to use when parsing attribute
descriptions and object class names.public AttributeFilter includeAttribute(String attributeDescription, Schema schema, boolean includeAttributesFromSuperiors)
attributeDescription
- The name of the attribute to be included in filtered entries.schema
- The schema The schema to use when parsing attribute
descriptions and object class names.includeAttributesFromSuperiors
- true
if attribute expansion from object classes using the '@OC' syntax should also
include attributes from superior classes in the list of requested attributes;
false
otherwise.public boolean matchesAllAttributes()
true
if this attribute filter matches all attributes, regardless of whether they are user or
operational attributes.true
if this attribute filter matches all attributes.public boolean matchesAllUserAttributes()
true
if this attribute filter matches all user attributes.true
if this attribute filter matches all user attributes.public boolean matchesAllOperationalAttributes()
true
if this attribute filter matches all operational attributes.true
if this attribute filter matches all operational attributes.public boolean matchesAnyAttributes()
true
if this attribute filter may match some attributes, or false
if it will never
match any attributes.true
if this attribute filter may match some attributes.public boolean matchesAttribute(AttributeDescription attributeDescription)
true
if this attribute filter matches the provided attribute description.attributeDescription
- The attribute description.true
if this attribute filter matches the provided attribute description.public AttributeFilter typesOnly(boolean typesOnly)
typesOnly
- true
if only attribute descriptions (and not values)
are to be included, or false
(the default) if both
attribute descriptions and values are to be included.Copyright 2010-2020 ForgeRock AS.