Interface SearchResultEntry
Each entry returned in a Search Result Entry will contain all appropriate attributes as specified in the Search request, subject to access control and other administrative policy.
Note that a Search Result Entry may hold zero attributes. This may happen when none of the attributes of an entry were requested or could be returned.
Note also that each returned attribute may hold zero attribute values. This may happen when only attribute types are requested, access controls prevent the return of values, or other reasons.
-
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(String attributeDescription, Object... values) Ensures that this entry contains the provided attribute and values (optional operation).booleanaddAttribute(Attribute attribute) Ensures that this entry contains the provided attribute and values (optional operation).booleanaddAttribute(Attribute attribute, Collection<? super ByteString> duplicateValues) Ensures that this entry contains the provided attribute and values (optional operation).addControl(Control control) Adds the provided control to this response.Removes all the attributes from this entry (optional operation).booleancontainsAttribute(String attributeDescription, Object... values) Returnstrueif this entry contains all of the attribute values contained invalues.booleancontainsAttribute(Attribute attribute, Collection<? super ByteString> missingValues) Returnstrueif this entry contains all of the attribute values contained inattribute.Returns anIterablecontaining all of the attributes in this entry.getAllAttributes(String attributeDescription) Returns anIterablecontaining all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description.getAllAttributes(AttributeDescription attributeDescription) Returns anIterablecontaining all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description.getAttribute(String attributeDescription) Returns the named attribute contained in this entry, ornullif it is not included with this entry.getAttribute(AttributeDescription attributeDescription) Returns the named attribute contained in this entry, ornullif it is not included with this entry.intReturns the number of attributes in this entry.<C extends Control>
CgetControl(ControlDecoder<C> decoder, DecodeOptions options) Decodes and returns the first control in this response having an OID corresponding to the provided control decoder.Returns aListcontaining the controls included with this response.getName()Returns the string representation of the distinguished name of this entry.removeAttribute(String attributeDescription, Object... values) Removes all of the attribute values contained invaluesfrom the named attribute in this entry if it is present (optional operation).booleanremoveAttribute(AttributeDescription attributeDescription) Removes the named attribute from this entry if it is present (optional operation).booleanremoveAttribute(Attribute attribute, Collection<? super ByteString> missingValues) Removes all of the attribute values contained inattributefrom this entry if it is present (optional operation).replaceAttribute(String attributeDescription, Object... values) Adds all of the attribute values contained invaluesto this entry, replacing any existing attribute values (optional operation).booleanreplaceAttribute(Attribute attribute) Adds all of the attribute values contained inattributeto this entry, replacing any existing attribute values (optional operation).Sets the distinguished name of this entry (optional operation).Sets the distinguished name of this entry (optional operation).Methods inherited from interface org.forgerock.opendj.ldap.Entry
equals, hashCode, parseAttribute, parseAttribute, toStringMethods inherited from interface org.forgerock.opendj.ldap.responses.Response
containsControl
-
Method Details
-
addAttribute
Description copied from interface:EntryEnsures that this entry contains the provided attribute and values (optional operation). This method has the following semantics:- If this entry does not already contain an attribute with a
matchingattribute description, then this entry will be modified such that it containsattribute, even if it is empty. - If this entry already contains an attribute with a
matchingattribute description, then the attribute values contained inattributewill be merged with the existing attribute values.
NOTE: When
attributeis non-empty, this method implements LDAP Modify add semantics.- Specified by:
addAttributein interfaceEntry- Parameters:
attribute- The attribute values to be added to this entry, merging with any existing attribute values.- Returns:
trueif this entry changed as a result of this call.
- If this entry does not already contain an attribute with a
-
addAttribute
Description copied from interface:EntryEnsures that this entry contains the provided attribute and values (optional operation). This method has the following semantics:- If this entry does not already contain an attribute with a
matchingattribute description, then this entry will be modified such that it containsattribute, even if it is empty. - If this entry already contains an attribute with a
matchingattribute description, then the attribute values contained inattributewill be merged with the existing attribute values.
NOTE: When
attributeis non-empty, this method implements LDAP Modify add semantics.- Specified by:
addAttributein interfaceEntry- Parameters:
attribute- The attribute values to be added to this entry, merging with any existing attribute values.duplicateValues- A collection into which duplicate values will be added, ornullif duplicate values should not be saved.- Returns:
trueif this entry changed as a result of this call.
- If this entry does not already contain an attribute with a
-
addAttribute
Description copied from interface:EntryEnsures that this entry contains the provided attribute and values (optional operation). This method has the following semantics:- If this entry does not already contain an attribute with a
matchingattribute description, then this entry will be modified such that it containsattribute, even if it is empty. - If this entry already contains an attribute with a
matchingattribute description, then the attribute values contained inattributewill be merged with the existing attribute values.
The attribute description will be decoded using the schema associated with this entry (usually the default schema).
Any attribute values which are not instances of
ByteStringwill be converted using theByteString.valueOfObject(Object)method.NOTE: When
attributeis non-empty, this method implements LDAP Modify add semantics.- Specified by:
addAttributein interfaceEntry- Parameters:
attributeDescription- The name of the attribute whose values are to be added.values- The attribute values to be added to this entry, merging any existing attribute values.- Returns:
- This entry.
- If this entry does not already contain an attribute with a
-
addControl
Description copied from interface:ResponseAdds the provided control to this response.- Specified by:
addControlin interfaceResponse- Parameters:
control- The control to be added.- Returns:
- This response.
-
clearAttributes
Description copied from interface:EntryRemoves all the attributes from this entry (optional operation).- Specified by:
clearAttributesin interfaceEntry- Returns:
- This entry.
-
containsAttribute
Description copied from interface:EntryReturnstrueif this entry contains all of the attribute values contained inattribute. Ifattributeis empty then this method will returntrueif the attribute is present in this entry, regardless of how many values it contains.- Specified by:
containsAttributein interfaceEntry- Parameters:
attribute- The attribute values whose presence in this entry is to be tested.missingValues- A collection into which missing values will be added, ornullif missing values should not be saved.- Returns:
trueif this entry contains all of the attribute values contained inattribute.
-
containsAttribute
Description copied from interface:EntryReturnstrueif this entry contains all of the attribute values contained invalues. Ifvaluesisnullor empty then this method will returntrueif the attribute is present in this entry, regardless of how many values it contains.The attribute description will be decoded using the schema associated with this entry (usually the default schema).
Any attribute values which are not instances of
ByteStringwill be converted using theByteString.valueOfObject(Object)method.- Specified by:
containsAttributein interfaceEntry- Parameters:
attributeDescription- The name of the attribute whose presence in this entry is to be tested.values- The attribute values whose presence in this entry is to be tested, which may benull.- Returns:
trueif this entry contains all of the attribute values contained invalues.
-
getAllAttributes
Description copied from interface:EntryReturns anIterablecontaining all of the attributes in this entry. The returnedIterablemay be used to remove attributes if permitted by this entry.- Specified by:
getAllAttributesin interfaceEntry- Returns:
- An
Iterablecontaining all of the attributes.
-
getAllAttributes
Description copied from interface:EntryReturns anIterablecontaining all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description. The returnedIterablemay be used to remove attributes if permitted by this entry.- Specified by:
getAllAttributesin interfaceEntry- Parameters:
attributeDescription- The name of the attributes to be returned.- Returns:
- An
Iterablecontaining the matching attributes.
-
getAllAttributes
Description copied from interface:EntryReturns anIterablecontaining all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description. The returnedIterablemay be used to remove attributes if permitted by this entry.The attribute description will be decoded using the schema associated with this entry (usually the default schema).
- Specified by:
getAllAttributesin interfaceEntry- Parameters:
attributeDescription- The name of the attributes to be returned.- Returns:
- An
Iterablecontaining the matching attributes.
-
getAttribute
Description copied from interface:EntryReturns the named attribute contained in this entry, ornullif it is not included with this entry.- Specified by:
getAttributein interfaceEntry- Parameters:
attributeDescription- The name of the attribute to be returned.- Returns:
- The named attribute, or
nullif it is not included with this entry.
-
getAttribute
Description copied from interface:EntryReturns the named attribute contained in this entry, ornullif it is not included with this entry.The attribute description will be decoded using the schema associated with this entry (usually the default schema).
- Specified by:
getAttributein interfaceEntry- Parameters:
attributeDescription- The name of the attribute to be returned.- Returns:
- The named attribute, or
nullif it is not included with this entry.
-
getAttributeCount
int getAttributeCount()Description copied from interface:EntryReturns the number of attributes in this entry.- Specified by:
getAttributeCountin interfaceEntry- Returns:
- The number of attributes.
-
getControl
<C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options) throws DecodeException Description copied from interface:ResponseDecodes and returns the first control in this response having an OID corresponding to the provided control decoder.- Specified by:
getControlin interfaceResponse- Type Parameters:
C- The type of control to be decoded and returned.- Parameters:
decoder- The control decoder.options- The set of decode options which should be used when decoding the control.- Returns:
- The decoded control, or
nullif the control is not included with this response. - Throws:
DecodeException- If the control could not be decoded because it was malformed in some way (e.g. the control value was missing, or its content could not be decoded).
-
getControls
Description copied from interface:ResponseReturns aListcontaining the controls included with this response. The returnedListmay be modified if permitted by this response.- Specified by:
getControlsin interfaceResponse- Returns:
- A
Listcontaining the controls.
-
getName
Description copied from interface:EntryReturns the string representation of the distinguished name of this entry. -
removeAttribute
Description copied from interface:EntryRemoves all of the attribute values contained inattributefrom this entry if it is present (optional operation). Ifattributeis empty then the entire attribute will be removed if it is present.NOTE: This method implements LDAP Modify delete semantics.
- Specified by:
removeAttributein interfaceEntry- Parameters:
attribute- The attribute values to be removed from this entry, which may be empty if the entire attribute is to be removed.missingValues- A collection into which missing values will be added, ornullif missing values should not be saved.- Returns:
trueif this entry changed as a result of this call.
-
removeAttribute
Description copied from interface:EntryRemoves the named attribute from this entry if it is present (optional operation). If this attribute does not contain the attribute, the call leaves this entry unchanged and returnsfalse.- Specified by:
removeAttributein interfaceEntry- Parameters:
attributeDescription- The name of the attribute to be removed.- Returns:
trueif this entry changed as a result of this call.
-
removeAttribute
Description copied from interface:EntryRemoves all of the attribute values contained invaluesfrom the named attribute in this entry if it is present (optional operation). Ifvaluesisnullor empty then the entire attribute will be removed if it is present.The attribute description will be decoded using the schema associated with this entry (usually the default schema).
Any attribute values which are not instances of
ByteStringwill be converted using theByteString.valueOfObject(Object)method.NOTE: This method implements LDAP Modify delete semantics.
- Specified by:
removeAttributein interfaceEntry- Parameters:
attributeDescription- The name of the attribute whose values are to be removed.values- The attribute values to be removed from this entry, which may benullor empty if the entire attribute is to be removed.- Returns:
- This entry.
-
replaceAttribute
Description copied from interface:EntryAdds all of the attribute values contained inattributeto this entry, replacing any existing attribute values (optional operation). Ifattributeis empty then the entire attribute will be removed if it is present.NOTE: This method implements LDAP Modify replace semantics as described in RFC 4511 - Section 4.6. Modify Operation.
- Specified by:
replaceAttributein interfaceEntry- Parameters:
attribute- The attribute values to be added to this entry, replacing any existing attribute values, and which may be empty if the entire attribute is to be removed.- Returns:
trueif this entry changed as a result of this call.
-
replaceAttribute
Description copied from interface:EntryAdds all of the attribute values contained invaluesto this entry, replacing any existing attribute values (optional operation). Ifvaluesisnullor empty then the entire attribute will be removed if it is present.The attribute description will be decoded using the schema associated with this entry (usually the default schema).
Any attribute values which are not instances of
ByteStringwill be converted using theByteString.valueOfObject(Object)method.NOTE: This method implements LDAP Modify replace semantics as described in RFC 4511 - Section 4.6. Modify Operation.
- Specified by:
replaceAttributein interfaceEntry- Parameters:
attributeDescription- The name of the attribute whose values are to be replaced.values- The attribute values to be added to this entry, replacing any existing attribute values, and which may benullor empty if the entire attribute is to be removed.- Returns:
- This entry.
-
setName
Description copied from interface:EntrySets the distinguished name of this entry (optional operation). -
setName
Description copied from interface:EntrySets the distinguished name of this entry (optional operation).The distinguished name will be decoded using the schema associated with this entry (usually the default schema).
-