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.shared.ldap.message;
021    
022    
023    /**
024     * Extended protocol request message used to add to more operations to the
025     * protocol. Here's what <a href="http://www.faqs.org/rfcs/rfc2251.html"> RFC
026     * 2251</a> says about it:
027     * 
028     * <pre>
029     *  4.12. Extended Operation
030     * 
031     *   An extension mechanism has been added in this version of LDAP, in
032     *   order to allow additional operations to be defined for services not
033     *   available elsewhere in this protocol, for instance digitally signed
034     *   operations and results.
035     * 
036     *   The extended operation allows clients to make requests and receive
037     *   responses with predefined syntaxes and semantics.  These may be
038     *   defined in RFCs or be private to particular implementations.  Each
039     *   request MUST have a unique OBJECT IDENTIFIER assigned to it.
040     * 
041     *        ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
042     *                requestName      [0] LDAPOID,
043     *                requestValue     [1] OCTET STRING OPTIONAL }
044     * 
045     *   The requestName is a dotted-decimal representation of the OBJECT
046     *   IDENTIFIER corresponding to the request. The requestValue is
047     *   information in a form defined by that request, encapsulated inside an
048     *   OCTET STRING.
049     *  &lt;pre&gt;
050     * <br>
051     *  
052     *  @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
053     *  @version $Revision: 764131 $
054     * 
055     */
056    public interface InternalExtendedRequest extends SingleReplyRequest, javax.naming.ldap.ExtendedRequest
057    {
058        /** Extended request message type enumeration value */
059        MessageTypeEnum TYPE = MessageTypeEnum.EXTENDED_REQ;
060    
061        /** Extended response message type enumeration value */
062        MessageTypeEnum RESP_TYPE = InternalExtendedResponse.TYPE;
063    
064    
065        /**
066         * Gets the Object Idendifier corresponding to the extended request type.
067         * This is the <b>requestName</b> portion of the ext. req. PDU.
068         * 
069         * @return the dotted-decimal representation as a String of the OID
070         */
071        String getOid();
072    
073    
074        /**
075         * Sets the Object Idendifier corresponding to the extended request type.
076         * 
077         * @param oid
078         *            the dotted-decimal representation as a String of the OID
079         */
080        void setOid( String oid );
081    
082    
083        /**
084         * Gets the extended request's <b>requestValue</b> portion of the PDU. The
085         * form of the data is request specific and is determined by the extended
086         * request OID.
087         * 
088         * @return byte array of data
089         */
090        byte[] getPayload();
091    
092    
093        /**
094         * Sets the extended request's <b>requestValue</b> portion of the PDU.
095         * 
096         * @param payload
097         *            byte array of data encapsulating ext. req. parameters
098         */
099        void setPayload( byte[] payload );
100    }