Sun Java System Directory Server Enterprise Edition 6.1 Developer's Guide

Trying the Extended Operation Example

  1. After activating the plug-in in the server, compile the client code reqextop.c.

  2. Add an entry under cn=features in the configuration to let users access the extended operation.


    $ cat myextop.ldif 
    dn: oid=1.2.3.4,cn=features,cn=config
    objectClass: top
    objectClass: directoryServerFeature
    oid: 1.2.3.4
    cn: Fake extended operation
    aci: (targetattr != "aci")(version 3.0;acl "Fake extended operation"; allow
     ( read, search, compare, proxy ) userdn = "ldap:///all";)
    
    $ ldapmodify -h localhost -p 389 -a -D cn=directory\ manager -w - -f myextop.ldif
    Enter bind password: 
    adding new entry uid=qcubbins,ou=People,dc=example,dc=com
    
    $ dsadm restart /local/ds
    Waiting for server to stop...
    Server stopped
    Server started: pid=5658
    $ 
  3. Run the client to send the extended operation request and display the result.


    $ ./reqextop -w password
    Using the following connection info:
            host:    localhost
            port:    389
            bind DN: cn=Directory Manager
            pwd:     password
    Setting up value to pass to server...
    Getting the handle to the LDAP connection...
    Resetting version 2 to 3.0...
    Binding to the directory...
    Initiating the extended operation...
    Operation successful.
            Returned OID: 5.6.7.8
            Returned value: Value from client: My Value
  4. On the Directory Server side, turn on logging.

    Messages similar to the following in the errors log show that the plug-in handled the client request:


    [22/May/2112:08:54:15 +0200] - INFORMATION -
     test_extendedop in test-extendedop plug-in - conn=0 op=1 msgId=2 -
     Request with OID: 1.2.3.4  Value from client: My Value
    [22/May/2112:08:54:15 +0200] - INFORMATION -
     test_extendedop in test-extendedop plug-in - conn=0 op=1 msgId=2 -
     OID sent to client: 5.6.7.8
     Value sent to client: 
     Value from client: My Value

You have thus demonstrated that the example extended operation plug-in handles requests for the extended operation with OID 1.2.3.4.