Implementing extended operations by using IBM Security Verify Directory JNDI Toolkit
An extended operation is a mechanism that allows more operations that are not defined in the LDAP protocol to be supported for services. These services are provided by LDAP V3 servers.
- A client sends an extended request to the server.
- If the server recognizes the request, it runs the operation.
- An extended response is sent back with the result, if any, for the operation.
- requestName
- The requestName field contains a unique dotted decimal representation of the OID (Object Identifier) that identifies the request. The OID namespace is hierarchically divided, every authority that can define an OID is assigned a prefix that it uses to identify its OID.
- requestValue
- The requestValue field contains data that is needed to run the request. The format of the data is predefined for every extended operation. Some extended operations do not require any data to be associated with a request.
The javax.naming.ldap.ExtendedRequest interface
describes an extended operation request. This interface contains methods getID() and getEncodedValue() that
retrieve the two properties of an extended operation request, requestName and requestValue.
A request class implements the javax.naming.ldap.ExtendedRequest interface
and overrides the following methods of this interface public
String getID() and public byte[] getEncodedValue().
This method retrieves ASN.1 BER encoded value from the LDAP extended
operation request and constructs request sequence for the extended
operation by using the com.ibm.asn1.BEREncoder class.
This method then converts the encoded request sequence to byte array
to be returned by the method.
createExtendedResponse method creates the
response object corresponding to a request. When a caller sends the
extended operation request to the LDAP server, a response from the
server is sent back. If the operation fails, the caller throws the NamingException exception.
If the operation succeeds, the caller calls this method by using the
data that it received in the response. The purpose of this method
is to return an object of class that implements the ExtendedResponse interface
that is appropriate for the extended operation request. public ExtendedResponse createExtendedResponse(
String id,
byte[] berValue,
int offset, length) throws NamingExceptionThe
parameters that are passed to this method:- id
- An object identifier of the response control.
- berValue
- An ASN.1 BER encoded value of the response control. This value is the raw BER bytes including the tag and length of the response value. It does not include the response OID.
- offset
- The starting position in the
berValueof the bytes to use. - length
- The number of bytes to use from
berValue.
- resultcode
- The resultcode field contains result code of the operation. The result code can contain one of the defined LDAP error codes. For example, LDAP_SUCCESS and LDAP_OPERATIONS_ERROR.
- responseName
- The responseName field contains OID of the response. It might or might not be same as the request OID.
- responseValue
- The responseValue field contains the result of the operation, if any.
The javax.naming.ldap.ExtendedResponse interface describes an extended operation response. A response class implements the javax.naming.ldap.ExtendedResponse interface. The methods in this class can be used by the application to get low-level information about the extended operation response. This class parses the extended response and provides methods specific to that extended operations to return response values. It uses com.ibm.asn1.BERDecoder class to parse the response from the LDAP server. The BEREncoder and BERDecoder classes are part of current IBMLDAPJavaBer.jar shipped with IBM Security Verify Directory.
| Extended operations | Java classes | Request OID or Response OID |
|---|---|---|
| Account status | AccountStatusRequest |
1.3.18.0.2.12.58/ |
| Attribute type | GetAttributesRequest |
1.3.18.0.2.12.46 / |
| Begin transaction | TransactionStartRequest |
1.3.18.0.2.12.5 |
| Cascading replication operation | CascadingReplicationRequest |
1.3.18.0.2.12.15 |
| Clear log | ClearLogRequest |
1.3.18.0.2.12.20 / |
| Control replication | ControlReplicationRequest |
1.3.18.0.2.12.16 |
| Control queue | ControlQueueRequest |
1.3.18.0.2.12.17 |
| DN normalization | NormalizeDNRequest |
1.3.18.0.2.12.30 |
| Dynamic server trace | ControlTracingRequest |
1.3.18.0.2.12.40 |
| Dynamic update requests | ReadConfigurationRequest |
1.3.18.0.2.12.28 / |
| End transaction | TransactionEndRequest |
1.3.18.0.2.12.6 |
| Effective password policy | EffectivePwdPolicyRequest |
1.3.18.0.2.12.75/ |
| Event notification register request | RegisterEventRequest |
1.3.18.0.2.12.1 |
| Event notification unregister request | UnregisterEventRequest |
1.3.18.0.2.12.3 |
| Get lines | ReadLogRequest |
1.3.18.0.2.12.22 / |
| Get number of lines | GetLogSizeRequest |
1.3.18.0.2.12.24 / |
| Group evaluation | EvaluateGroupsRequest |
1.3.18.0.2.12.50 / |
| Kill connection | UnbindRequest |
1.3.18.0.2.12.35 / |
| LDAP trace facility | RemoteTraceExecutionRequest |
1.3.18.0.2.12.41 |
| LogMgmtControl | LogManagementRequest |
1.3.18.0.2.12.70 |
| Proxy back-end server resume role | ResumeRoleRequest |
1.3.18.0.2.12.65 |
| Quiesce or unquiesce replication context | QuiesceRequest |
1.3.18.0.2.12.19 |
| Replication error log | ControlReplErrorRequest |
1.3.18.0.2.12.56 |
| Replication topology | ReplicationTopologyRequest |
1.3.18.0.2.12.54 / |
| ServerBackupRestore | BackupRestoreRequest |
1.3.18.0.2.12.81 |
| Start, stop server | StartStopServerRequest |
1.3.18.0.2.12.26 |
| Start TLS | StartTLSRequest |
1.3.6.1.4.1.1466.20037 |
| Unique attributes | UniqueAttributeRequest |
1.3.18.0.2.12.44 / |
| User type | UserTypeRequest |
1.3.18.0.2.12.37 / |