com.unboundid.ldap.sdk.migrate.jndi
Class JNDIExtendedRequest

java.lang.Object
  extended by com.unboundid.ldap.sdk.migrate.jndi.JNDIExtendedRequest
All Implemented Interfaces:
java.io.Serializable, javax.naming.ldap.ExtendedRequest

@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class JNDIExtendedRequest
extends java.lang.Object
implements javax.naming.ldap.ExtendedRequest

This class provides a mechanism for converting between an LDAP extended request as used in JNDI and one used in the UnboundID LDAP SDK for Java.

See Also:
ExtendedRequest, Serialized Form

Constructor Summary
JNDIExtendedRequest(ExtendedRequest r)
          Creates a new JNDI extended request from the provided SDK extended request.
JNDIExtendedRequest(javax.naming.ldap.ExtendedRequest r)
          Creates a new JNDI extended request from the provided JNDI extended request.
 
Method Summary
 JNDIExtendedResponse createExtendedResponse(java.lang.String id, byte[] berValue, int offset, int length)
          Creates a JNDI extended response with the provided information.
 byte[] getEncodedValue()
          Retrieves the encoded value for this extended request (including the BER type and length), if available.
 java.lang.String getID()
          Retrieves the object identifier for this extended request.
 ExtendedRequest toSDKExtendedRequest()
          Retrieves an LDAP SDK extended request that is the equivalent of this JNDI extended request.
static ExtendedRequest toSDKExtendedRequest(javax.naming.ldap.ExtendedRequest r)
          Retrieves an LDAP SDK extended request that is the equivalent of the provided JNDI extended request.
 java.lang.String toString()
          Retrieves a string representation of this JNDI extended request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JNDIExtendedRequest

public JNDIExtendedRequest(ExtendedRequest r)
Creates a new JNDI extended request from the provided SDK extended request.

Parameters:
r - The SDK extended request to use to create this JNDI extended request.

JNDIExtendedRequest

public JNDIExtendedRequest(javax.naming.ldap.ExtendedRequest r)
                    throws javax.naming.NamingException
Creates a new JNDI extended request from the provided JNDI extended request.

Parameters:
r - The JNDI extended request to use to create this JNDI extended request.
Throws:
javax.naming.NamingException - If a problem occurs while trying to create this JNDI extended request.
Method Detail

getID

public java.lang.String getID()
Retrieves the object identifier for this extended request.

Specified by:
getID in interface javax.naming.ldap.ExtendedRequest
Returns:
The object identifier for this extended request.

getEncodedValue

public byte[] getEncodedValue()
Retrieves the encoded value for this extended request (including the BER type and length), if available.

Specified by:
getEncodedValue in interface javax.naming.ldap.ExtendedRequest
Returns:
The encoded value for this extended request, or null if there is no value.

createExtendedResponse

public JNDIExtendedResponse createExtendedResponse(java.lang.String id,
                                                   byte[] berValue,
                                                   int offset,
                                                   int length)
                                            throws javax.naming.NamingException
Creates a JNDI extended response with the provided information.

Specified by:
createExtendedResponse in interface javax.naming.ldap.ExtendedRequest
Parameters:
id - The object identifier for the response, or null if there should not be a value.
berValue - A byte array containing the encoded value (including BER type and length), or null if the response should not have a value.
offset - The offset within the provided array at which the value should begin.
length - The number of bytes contained in the value.
Returns:
The created JNDI extended response.
Throws:
javax.naming.NamingException - If a problem occurs while creating the response.

toSDKExtendedRequest

public ExtendedRequest toSDKExtendedRequest()
Retrieves an LDAP SDK extended request that is the equivalent of this JNDI extended request.

Returns:
An LDAP SDK extended request that is the equivalent of this JNDI extended request.

toSDKExtendedRequest

public static ExtendedRequest toSDKExtendedRequest(javax.naming.ldap.ExtendedRequest r)
                                            throws javax.naming.NamingException
Retrieves an LDAP SDK extended request that is the equivalent of the provided JNDI extended request.

Parameters:
r - The JNDI extended request to convert to an LDAP SDK extended request.
Returns:
The LDAP SDK extended request converted from the provided JNDI extended request.
Throws:
javax.naming.NamingException - If a problem occurs while decoding the provided JNDI extended request as an SDK extended request.

toString

public java.lang.String toString()
Retrieves a string representation of this JNDI extended request.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this JNDI request.