Package com.unboundid.ldap.sdk
Class IntermediateResponse
java.lang.Object
com.unboundid.ldap.sdk.IntermediateResponse
- All Implemented Interfaces:
LDAPResponse,Serializable
- Direct Known Subclasses:
ChangelogEntryIntermediateResponse,CollectSupportDataArchiveFragmentIntermediateResponse,CollectSupportDataOutputIntermediateResponse,ContentSyncInfoIntermediateResponse,MissingChangelogEntriesIntermediateResponse,StreamDirectoryValuesIntermediateResponse,StreamProxyValuesIntermediateResponse
@Extensible
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public class IntermediateResponse
extends Object
implements Serializable, LDAPResponse
This class provides a data structure for holding information about an LDAP
intermediate response, which provides the ability for the directory server to
return multiple messages in response to operations that would not otherwise
support it. Intermediate response messages will only be returned by the
server if the client does something to explicitly indicate that it is able
to accept them (e.g., by requesting an extended operation that may return
intermediate response messages, or by including a control in a request that
may cause the request to return intermediate response messages).
Intermediate response messages may include one or both of the following:
- Response OID -- An optional OID that can be used to identify the type of intermediate response.
- Value -- An optional element that provides the encoded value for this intermediate response. If a value is provided, then the encoding for the value depends on the type of intermediate response.
IntermediateResponseListener must be provided for the associated
request. If an intermediate response message is returned for a request that
does not have a registered IntermediateResponseListener, then it will
be silently discarded.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final byteThe BER type for the intermediate response OID element.protected static final byteThe BER type for the intermediate response value element. -
Constructor Summary
ConstructorsModifierConstructorDescriptionIntermediateResponse(int messageID, String oid, ASN1OctetString value) Creates a new intermediate response with the provided information.IntermediateResponse(int messageID, String oid, ASN1OctetString value, Control[] controls) Creates a new intermediate response with the provided information.protectedIntermediateResponse(IntermediateResponse intermediateResponse) Creates a new intermediate response with the information from the provided intermediate response.IntermediateResponse(String oid, ASN1OctetString value) Creates a new intermediate response with the provided information.IntermediateResponse(String oid, ASN1OctetString value, Control[] controls) Creates a new intermediate response with the provided information. -
Method Summary
Modifier and TypeMethodDescriptionfinal ControlgetControl(String oid) Retrieves the control with the specified OID.final Control[]Retrieves the set of controls returned with this intermediate response.Retrieves the user-friendly name for the intermediate response, if available.intRetrieves the message ID for the LDAP message containing this response.final StringgetOID()Retrieves the OID for this intermediate response, if any.final ASN1OctetStringgetValue()Retrieves the encoded value for this intermediate response, if any.final StringtoString()Retrieves a string representation of this intermediate response.voidtoString(StringBuilder buffer) Appends a string representation of this intermediate response to the provided buffer.Retrieves a human-readable string representation for the contents of the value for this intermediate response, if appropriate.
-
Field Details
-
TYPE_INTERMEDIATE_RESPONSE_OID
The BER type for the intermediate response OID element.- See Also:
-
TYPE_INTERMEDIATE_RESPONSE_VALUE
The BER type for the intermediate response value element.- See Also:
-
-
Constructor Details
-
IntermediateResponse
Creates a new intermediate response with the provided information.- Parameters:
oid- The OID for this intermediate response. It may benullif there is no OID.value- The value for this intermediate response. It may benullif there is no value.
-
IntermediateResponse
Creates a new intermediate response with the provided information.- Parameters:
messageID- The message ID for the LDAP message containing this intermediate response.oid- The OID for this intermediate response. It may benullif there is no OID.value- The value for this intermediate response. It may benullif there is no value.
-
IntermediateResponse
public IntermediateResponse(@Nullable String oid, @Nullable ASN1OctetString value, @Nullable Control[] controls) Creates a new intermediate response with the provided information.- Parameters:
oid- The OID for this intermediate response. It may benullif there is no OID.value- The value for this intermediate response. It may benullif there is no value.controls- The set of controls for this intermediate response.
-
IntermediateResponse
public IntermediateResponse(int messageID, @Nullable String oid, @Nullable ASN1OctetString value, @Nullable Control[] controls) Creates a new intermediate response with the provided information.- Parameters:
messageID- The message ID for the LDAP message containing this intermediate response.oid- The OID for this intermediate response. It may benullif there is no OID.value- The value for this intermediate response. It may benullif there is no value.controls- The set of controls for this intermediate response.
-
IntermediateResponse
Creates a new intermediate response with the information from the provided intermediate response.- Parameters:
intermediateResponse- The intermediate response that should be used to create this new intermediate response.
-
-
Method Details
-
getMessageID
Retrieves the message ID for the LDAP message containing this response.- Specified by:
getMessageIDin interfaceLDAPResponse- Returns:
- The message ID for the LDAP message containing this response.
-
getOID
Retrieves the OID for this intermediate response, if any.- Returns:
- The OID for this intermediate response, or
nullif there is no OID for this response.
-
getValue
Retrieves the encoded value for this intermediate response, if any.- Returns:
- The encoded value for this intermediate response, or
nullif there is no value for this response.
-
getControls
Retrieves the set of controls returned with this intermediate response. Individual response controls of a specific type may be retrieved and decoded using thegetmethod in the response control class.- Returns:
- The set of controls returned with this intermediate response.
-
getControl
Retrieves the control with the specified OID. If there is more than one control with the given OID, then the first will be returned.- Parameters:
oid- The OID of the control to retrieve.- Returns:
- The control with the requested OID, or
nullif there is no such control for this intermediate response.
-
getIntermediateResponseName
Retrieves the user-friendly name for the intermediate response, if available. If no user-friendly name has been defined, but a response OID is available, then that will be returned. If neither a user-friendly name nor a response OID are available, thennullwill be returned.- Returns:
- The user-friendly name for this intermediate response, the
response OID if a user-friendly name is not available but a
response OID is, or
nullif neither a user-friendly name nor a response OID are available.
-
valueToString
Retrieves a human-readable string representation for the contents of the value for this intermediate response, if appropriate. If one is provided, then it should be a relatively compact single-line representation of the most important elements of the value.- Returns:
- A human-readable string representation for the contents of the
value for this intermediate response, or
nullif there is no value or no string representation is available.
-
toString
Retrieves a string representation of this intermediate response. -
toString
Appends a string representation of this intermediate response to the provided buffer.- Specified by:
toStringin interfaceLDAPResponse- Parameters:
buffer- The buffer to which the string representation should be appended.
-