Interface ProtocolOp

All Known Subinterfaces:
ChangeRecord, ExtendedRequest<S>, ExtendedResult, Request, Response, Result
All Known Implementing Classes:
AbandonRequest, AddRequest, BindRequest, BindResult, CancelExtendedRequest, CompareRequest, CompareResult, DeleteRequest, GenericExtendedRequest, GenericExtendedResult, IntermediateResponse, InvalidRequest, ModifyDnRequest, ModifyRequest, PasswordModifyExtendedRequest, PasswordModifyExtendedResult, SearchRequest, SearchResultEntry, SearchResultReference, StartTlsExtendedRequest, StartTlsExtendedResult, UnbindRequest, UnknownRequest, WhoAmIExtendedRequest, WhoAmIExtendedResult

public interface ProtocolOp
The base class of all requests and responses provides methods for querying and manipulating the set of Controls.
  • Method Summary

    Modifier and Type
    Method
    Description
    default ProtocolOp
    Adds the provided control to this protocol-op.
    default ProtocolOp
    addControls(Iterable<? extends Control> controls)
    Adds the provided controls to this protocol-op.
    default boolean
    Returns true if this protocol-op contains the specified control.
    Returns a List containing the controls included with this protocol-op.
    default <C extends Control>
    C
    Decodes and returns the first control in this protocol-op having an OID corresponding to the provided control decoder using default decode options.
    default <C extends Control>
    C
    getControl(ControlDecoder<C> decoder, DecodeOptions options)
    Decodes and returns the first control in this protocol-op having an OID corresponding to the provided control decoder.
    default ProtocolOp
    Removes all the controls having the specified OID.
  • Method Details

    • getControl

      default <C extends Control> C getControl(ControlDecoder<C> decoder) throws DecodeException
      Decodes and returns the first control in this protocol-op having an OID corresponding to the provided control decoder using default decode options.
      Type Parameters:
      C - The type of control to be decoded and returned.
      Parameters:
      decoder - The control decoder.
      Returns:
      The decoded control, or null if the control is not included with this protocol-op.
      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).
      NullPointerException - If decoder or options was null.
    • getControl

      default <C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options) throws DecodeException
      Decodes and returns the first control in this protocol-op having an OID corresponding to the provided control decoder.
      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 null if the control is not included with this protocol-op.
      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).
      NullPointerException - If decoder or options was null.
    • controls

      List<Control> controls()
      Returns a List containing the controls included with this protocol-op. The returned List may be modified if permitted by this protocol-op.
      Returns:
      A List containing the controls.
    • addControl

      default ProtocolOp addControl(Control control)
      Adds the provided control to this protocol-op.
      Parameters:
      control - The control to be added to this protocol-op.
      Returns:
      This protocol-op.
      Throws:
      UnsupportedOperationException - If this protocol-op does not permit controls to be added.
      NullPointerException - If control was null.
    • addControls

      default ProtocolOp addControls(Iterable<? extends Control> controls)
      Adds the provided controls to this protocol-op.
      Parameters:
      controls - The controls to be added to this protocol-op.
      Returns:
      This protocol-op.
      Throws:
      UnsupportedOperationException - If this protocol-op does not permit controls to be added.
      NullPointerException - If control was null.
    • removeControls

      default ProtocolOp removeControls(String oid)
      Removes all the controls having the specified OID.
      Parameters:
      oid - The numeric OID of the protocol-op control to remove.
      Returns:
      This protocol-op.
      Throws:
      UnsupportedOperationException - If this protocol-op does not permit controls to be removed.
      NullPointerException - If oid was null.
    • containsControl

      default boolean containsControl(String oid)
      Returns true if this protocol-op contains the specified control.
      Parameters:
      oid - The numeric OID of the protocol-op control.
      Returns:
      true if this protocol-op contains the specified control.