001    /*
002     *  Licensed to the Apache Software Foundation (ASF) under one
003     *  or more contributor license agreements.  See the NOTICE file
004     *  distributed with this work for additional information
005     *  regarding copyright ownership.  The ASF licenses this file
006     *  to you under the Apache License, Version 2.0 (the
007     *  "License"); you may not use this file except in compliance
008     *  with the License.  You may obtain a copy of the License at
009     *  
010     *    http://www.apache.org/licenses/LICENSE-2.0
011     *  
012     *  Unless required by applicable law or agreed to in writing,
013     *  software distributed under the License is distributed on an
014     *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     *  KIND, either express or implied.  See the License for the
016     *  specific language governing permissions and limitations
017     *  under the License. 
018     *  
019     */
020    package org.apache.directory.server.ldap;
021    
022    
023    import java.util.Set;
024    
025    import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
026    
027    
028    /**
029     * An extension (hook) point that enables an implementor to provide his or her
030     * own LDAP 'Extended' operation.  
031     *
032     * @org.apache.xbean.XBean
033    *
034     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
035     * @version $Rev: 905344 $, $Date: 2010-02-01 18:31:50 +0100 (Mon, 01 Feb 2010) $
036     *
037     */
038    public interface ExtendedOperationHandler
039    {
040        /**
041         * Returns the EXTENSION_OID of the extended request this handler can handle.
042         */
043        String getOid();
044    
045    
046        /**
047         * The OIDs of the extensions supported by this handler.  This includes the 
048         * request as well as any responses associated with the request.  These OIDs 
049         * will be registered with the server to publish them as supportedExtensions.
050         * 
051         * @return the OIDs supported by this handler.
052         */
053        Set<String> getExtensionOids();
054    
055    
056        /**
057         * Handles the specified extended operation.
058         * 
059         * @param session the session object related with current connection
060         * @param req the LDAP Extended operation request
061         * 
062         * @throws Exception if failed to handle the operation
063         */
064        void handleExtendedOperation( LdapSession session, InternalExtendedRequest req ) throws Exception;
065    
066    
067        /**
068         * Sets the LDAP server for this extendedOperation handler.
069         * 
070         * @param ldapServer the ldap protocol server
071         */
072        void setLdapServer( LdapServer ldapServer );
073    }