Interface SearchResultEntry

All Superinterfaces:
Entry, ProtocolOp, Response

public interface SearchResultEntry extends Response, Entry
A Search Result Entry represents an entry found during a Search operation.

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 Details

    • addAttribute

      default SearchResultEntry addAttribute(String attributeDescription, Object... values)
      Description copied from interface: Entry
      Ensures 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 matching attribute description, then this entry will be modified such that it contains attribute, even if it is empty.
      • If this entry already contains an attribute with a matching attribute description, then the attribute values contained in attribute will 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 ByteString will be converted using the ByteString.valueOfObject(Object) method.

      NOTE: When attribute is non-empty, this method implements LDAP Modify add semantics.

      Specified by:
      addAttribute in interface Entry
      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.
    • addControl

      default SearchResultEntry addControl(Control control)
      Description copied from interface: ProtocolOp
      Adds the provided control to this protocol-op.
      Specified by:
      addControl in interface ProtocolOp
      Specified by:
      addControl in interface Response
      Parameters:
      control - The control to be added to this protocol-op.
      Returns:
      This protocol-op.
    • addControls

      default SearchResultEntry addControls(Iterable<? extends Control> controls)
      Description copied from interface: ProtocolOp
      Adds the provided controls to this protocol-op.
      Specified by:
      addControls in interface ProtocolOp
      Specified by:
      addControls in interface Response
      Parameters:
      controls - The controls to be added to this protocol-op.
      Returns:
      This protocol-op.
    • removeControls

      default SearchResultEntry removeControls(String oid)
      Description copied from interface: ProtocolOp
      Removes all the controls having the specified OID.
      Specified by:
      removeControls in interface ProtocolOp
      Specified by:
      removeControls in interface Response
      Parameters:
      oid - The numeric OID of the protocol-op control to remove.
      Returns:
      This protocol-op.
    • clearAttributes

      default SearchResultEntry clearAttributes()
      Description copied from interface: Entry
      Removes all the attributes from this entry (optional operation).
      Specified by:
      clearAttributes in interface Entry
      Returns:
      This entry.
    • removeAttribute

      default SearchResultEntry removeAttribute(String attributeDescription, Object... values)
      Description copied from interface: Entry
      Removes all of the attribute values contained in values from the named attribute in this entry if it is present (optional operation). If values is null or 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 ByteString will be converted using the ByteString.valueOfObject(Object) method.

      NOTE: This method implements LDAP Modify delete semantics.

      Specified by:
      removeAttribute in interface Entry
      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 be null or empty if the entire attribute is to be removed.
      Returns:
      This entry.
    • replaceAttribute

      default SearchResultEntry replaceAttribute(String attributeDescription, Object... values)
      Description copied from interface: Entry
      Adds all of the attribute values contained in values to this entry, replacing any existing attribute values (optional operation). If values is null or 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 ByteString will be converted using the ByteString.valueOfObject(Object) method.

      NOTE: This method implements LDAP Modify replace semantics as described in RFC 4511 - Section 4.6. Modify Operation.

      Specified by:
      replaceAttribute in interface Entry
      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 be null or empty if the entire attribute is to be removed.
      Returns:
      This entry.
    • setName

      default SearchResultEntry setName(Dn dn)
      Description copied from interface: Entry
      Sets the distinguished name of this entry (optional operation).
      Specified by:
      setName in interface Entry
      Parameters:
      dn - The distinguished name.
      Returns:
      This entry.
    • setName

      default SearchResultEntry setName(String dn)
      Description copied from interface: Entry
      Sets 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).

      Specified by:
      setName in interface Entry
      Parameters:
      dn - The string representation of the distinguished name.
      Returns:
      This entry.