com.unboundid.ldap.sdk.unboundidds.controls
Class IntermediateClientResponseControl

java.lang.Object
  extended by com.unboundid.ldap.sdk.Control
      extended by com.unboundid.ldap.sdk.unboundidds.controls.IntermediateClientResponseControl
All Implemented Interfaces:
DecodeableControl, java.io.Serializable

@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class IntermediateClientResponseControl
extends Control
implements DecodeableControl

NOTE: This class is part of the Commercial Edition of the UnboundID LDAP SDK for Java. It is not available for use in applications that include only the Standard Edition of the LDAP SDK, and is not supported for use in conjunction with non-UnboundID products.
This class defines an intermediate client response control, which can be used to provide a server with information about the client and any downstream clients that it may have.

This control is not based on any public standard. It was originally developed for use with the UnboundID Directory Server. The value of this control uses the following encoding:

 IntermediateClientResponse ::= SEQUENCE {
      upstreamResponse       [0] IntermediateClientResponse OPTIONAL,
      upstreamServerAddress  [1] OCTET STRING OPTIONAL,
      upstreamServerSecure   [3] BOOLEAN DEFAULT FALSE,
      serverName             [4] OCTET STRING OPTIONAL,
      serverSessionID        [5] OCTET STRING OPTIONAL,
      serverResponseID       [6] OCTET STRING OPTIONAL,
      ... }
 
See the documentation in the IntermediateClientRequestControl class for an example of using the intermediate client request and response controls.

See Also:
Serialized Form

Field Summary
static java.lang.String INTERMEDIATE_CLIENT_RESPONSE_OID
          The OID (1.3.6.1.4.1.30221.2.5.2) for the intermediate client response control.
 
Constructor Summary
IntermediateClientResponseControl(boolean isCritical, IntermediateClientResponseValue value)
          Creates a new intermediate client response control with the provided value.
IntermediateClientResponseControl(IntermediateClientResponseValue value)
          Creates a new intermediate client response control with the provided value.
IntermediateClientResponseControl(IntermediateClientResponseValue upstreamResponse, java.lang.String upstreamServerAddress, java.lang.Boolean upstreamServerSecure, java.lang.String serverName, java.lang.String serverSessionID, java.lang.String serverResponseID)
          Creates a new intermediate client response control with the provided information.
IntermediateClientResponseControl(java.lang.String oid, boolean isCritical, ASN1OctetString value)
          Creates a new intermediate client response control with the provided information.
 
Method Summary
 IntermediateClientResponseControl decodeControl(java.lang.String oid, boolean isCritical, ASN1OctetString value)
          Creates a new instance of this decodeable control from the provided information.
static IntermediateClientResponseControl get(LDAPResult result)
          Extracts an intermediate client response control from the provided result.
 java.lang.String getControlName()
          Retrieves the user-friendly name for this control, if available.
 IntermediateClientResponseValue getResponseValue()
          Retrieves the value for this intermediate client response.
 java.lang.String getServerName()
          Retrieves a string that identifies the server application that created this intermediate client response value.
 java.lang.String getServerResponseID()
          Retrieves a string that may be used to identify the response in the server application.
 java.lang.String getServerSessionID()
          Retrieves a string that may be used to identify the session in the server application.
 IntermediateClientResponseValue getUpstreamResponse()
          Retrieves the wrapped response from an upstream server, if available.
 java.lang.String getUpstreamServerAddress()
          Retrieves the IP address or resolvable name of the upstream server system, if available.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this LDAP control to the provided buffer.
 java.lang.Boolean upstreamServerSecure()
          Indicates whether the communication with the communication with the upstream server is secure (i.e., whether communication between the server application and the upstream server is safe from interpretation or undetectable alteration by a third party observer or interceptor).
 
Methods inherited from class com.unboundid.ldap.sdk.Control
decode, decode, decodeControls, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, toString, writeTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INTERMEDIATE_CLIENT_RESPONSE_OID

public static final java.lang.String INTERMEDIATE_CLIENT_RESPONSE_OID
The OID (1.3.6.1.4.1.30221.2.5.2) for the intermediate client response control.

See Also:
Constant Field Values
Constructor Detail

IntermediateClientResponseControl

public IntermediateClientResponseControl(IntermediateClientResponseValue upstreamResponse,
                                         java.lang.String upstreamServerAddress,
                                         java.lang.Boolean upstreamServerSecure,
                                         java.lang.String serverName,
                                         java.lang.String serverSessionID,
                                         java.lang.String serverResponseID)
Creates a new intermediate client response control with the provided information. It will not be marked critical.

Parameters:
upstreamResponse - A wrapped intermediate client response from an upstream server. It may be null if there is no wrapped upstream response.
upstreamServerAddress - The IP address or resolvable name of the upstream server system. It may be null if there is no upstream server or its address is not available.
upstreamServerSecure - Indicates whether communication with the upstream server is secure. It may be null if there is no upstream server or it is not known whether the communication is secure.
serverName - An identifier string that summarizes the server application that created this intermediate client response. It may be null if that information is not available.
serverSessionID - A string that may be used to identify the session in the server application. It may be null if there is no available session identifier.
serverResponseID - A string that may be used to identify the response in the server application. It may be null if there is no available response identifier.

IntermediateClientResponseControl

public IntermediateClientResponseControl(java.lang.String oid,
                                         boolean isCritical,
                                         ASN1OctetString value)
                                  throws LDAPException
Creates a new intermediate client response control with the provided information.

Parameters:
oid - The OID for the control.
isCritical - Indicates whether the control should be marked critical.
value - The encoded value for the control. This may be null if no value was provided.
Throws:
LDAPException - If the provided control cannot be decoded as an intermediate client response control.

IntermediateClientResponseControl

public IntermediateClientResponseControl(IntermediateClientResponseValue value)
Creates a new intermediate client response control with the provided value. It will be marked critical.

Parameters:
value - The value to use for this intermediate client response control. It must not be null.

IntermediateClientResponseControl

public IntermediateClientResponseControl(boolean isCritical,
                                         IntermediateClientResponseValue value)
Creates a new intermediate client response control with the provided value.

Parameters:
isCritical - Indicates whether the control should be marked critical.
value - The value to use for this intermediate client response control. It must not be null.
Method Detail

decodeControl

public IntermediateClientResponseControl decodeControl(java.lang.String oid,
                                                       boolean isCritical,
                                                       ASN1OctetString value)
                                                throws LDAPException
Creates a new instance of this decodeable control from the provided information.

Specified by:
decodeControl in interface DecodeableControl
Parameters:
oid - The OID for the control.
isCritical - Indicates whether the control should be marked critical.
value - The encoded value for the control. This may be null if no value was provided.
Returns:
The decoded representation of this control.
Throws:
LDAPException - If the provided information cannot be decoded as a valid instance of this decodeable control.

get

public static IntermediateClientResponseControl get(LDAPResult result)
                                             throws LDAPException
Extracts an intermediate client response control from the provided result.

Parameters:
result - The result from which to retrieve the intermediate client response control.
Returns:
The intermediate client response control contained in the provided result, or null if the result did not contain an intermediate client response control.
Throws:
LDAPException - If a problem is encountered while attempting to decode the intermediate client response control contained in the provided result.

getResponseValue

public IntermediateClientResponseValue getResponseValue()
Retrieves the value for this intermediate client response.

Returns:
The value for this intermediate client response.

getUpstreamResponse

public IntermediateClientResponseValue getUpstreamResponse()
Retrieves the wrapped response from an upstream server, if available.

Returns:
The wrapped response from an upstream server, or null if there is none.

getUpstreamServerAddress

public java.lang.String getUpstreamServerAddress()
Retrieves the IP address or resolvable name of the upstream server system, if available.

Returns:
The IP address or resolvable name of the upstream server system, null if there is no upstream server or its address is not available.

upstreamServerSecure

public java.lang.Boolean upstreamServerSecure()
Indicates whether the communication with the communication with the upstream server is secure (i.e., whether communication between the server application and the upstream server is safe from interpretation or undetectable alteration by a third party observer or interceptor).

Returns:
Boolean.TRUE if communication with the upstream server is secure, Boolean.FALSE if it is not secure, or null if there is no upstream server or it is not known whether the communication is secure.

getServerName

public java.lang.String getServerName()
Retrieves a string that identifies the server application that created this intermediate client response value.

Returns:
A string that may be used to identify the server application that created this intermediate client response value.

getServerSessionID

public java.lang.String getServerSessionID()
Retrieves a string that may be used to identify the session in the server application.

Returns:
A string that may be used to identify the session in the server application, or null if there is none.

getServerResponseID

public java.lang.String getServerResponseID()
Retrieves a string that may be used to identify the response in the server application.

Returns:
A string that may be used to identify the response in the server application, or null if there is none.

getControlName

public java.lang.String getControlName()
Retrieves the user-friendly name for this control, if available. If no user-friendly name has been defined, then the OID will be returned.

Overrides:
getControlName in class Control
Returns:
The user-friendly name for this control, or the OID if no user-friendly name is available.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP control to the provided buffer.

Overrides:
toString in class Control
Parameters:
buffer - The buffer to which to append the string representation of this buffer.