View Javadoc
1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *  
10   *    http://www.apache.org/licenses/LICENSE-2.0
11   *  
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License. 
18   *  
19   */
20  package org.apache.directory.server.ldap;
21  
22  
23  import java.util.Set;
24  
25  import org.apache.directory.api.ldap.model.message.ExtendedRequest;
26  import org.apache.directory.api.ldap.model.message.ExtendedResponse;
27  
28  
29  /**
30   * An extension (hook) point that enables an implementor to provide his or her
31   * own LDAP 'Extended' operation.  
32   **
33   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
34   *
35   */
36  public interface ExtendedOperationHandler<R extends ExtendedRequest, P extends ExtendedResponse>
37  {
38      /**
39       * @return the EXTENSION_OID of the extended request this handler can handle.
40       */
41      String getOid();
42  
43  
44      /**
45       * The OIDs of the extensions supported by this handler.  This includes the 
46       * request as well as any responses associated with the request.  These OIDs 
47       * will be registered with the server to publish them as supportedExtensions.
48       * 
49       * @return the OIDs supported by this handler.
50       */
51      Set<String> getExtensionOids();
52  
53  
54      /**
55       * Handles the specified extended operation.
56       * 
57       * @param session the session object related with current connection
58       * @param req the LDAP Extended operation request
59       * 
60       * @throws Exception if failed to handle the operation
61       */
62      void handleExtendedOperation( LdapSession session, R req ) throws Exception;
63  
64  
65      /**
66       * Sets the LDAP server for this extendedOperation handler.
67       * 
68       * @param ldapServer the ldap protocol server
69       */
70      void setLdapServer( LdapServer ldapServer );
71  }