001    /*
002     * CDDL HEADER START
003     *
004     * The contents of this file are subject to the terms of the
005     * Common Development and Distribution License, Version 1.0 only
006     * (the "License").  You may not use this file except in compliance
007     * with the License.
008     *
009     * You can obtain a copy of the license at
010     * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011     * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012     * See the License for the specific language governing permissions
013     * and limitations under the License.
014     *
015     * When distributing Covered Code, include this CDDL HEADER in each
016     * file and include the License file at
017     * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
018     * add the following below this CDDL HEADER, with the fields enclosed
019     * by brackets "[]" replaced with your own identifying information:
020     *      Portions Copyright [yyyy] [name of copyright owner]
021     *
022     * CDDL HEADER END
023     *
024     *
025     *      Copyright 2006-2008 Sun Microsystems, Inc.
026     */
027    package org.opends.server.types.operation;
028    import org.opends.messages.Message;
029    
030    
031    
032    import org.opends.server.protocols.asn1.ASN1OctetString;
033    import org.opends.server.types.AuthenticationType;
034    import org.opends.server.types.ByteString;
035    
036    
037    
038    /**
039     * This class defines a set of methods that are available for use by
040     * pre-parse plugins for bind operations.  Note that this
041     * interface is intended only to define an API for use by plugins and
042     * is not intended to be implemented by any custom classes.
043     */
044    @org.opends.server.types.PublicAPI(
045         stability=org.opends.server.types.StabilityLevel.UNCOMMITTED,
046         mayInstantiate=false,
047         mayExtend=false,
048         mayInvoke=true)
049    public interface PreParseBindOperation
050           extends PreParseOperation
051    {
052      /**
053       * Retrieves the authentication type for this bind operation.
054       *
055       * @return  The authentication type for this bind operation.
056       */
057      public AuthenticationType getAuthenticationType();
058    
059    
060    
061      /**
062       * Retrieves a string representation of the protocol version
063       * associated with this bind request.
064       *
065       * @return  A string representation of the protocol version
066       *          associated with this bind request.
067       */
068      public String getProtocolVersion();
069    
070    
071    
072      /**
073       * Specifies the string representation of the protocol version
074       * associated with this bind request.
075       *
076       * @param  protocolVersion  The string representation of the
077       *                          protocol version associated with this
078       *                          bind request.
079       */
080      public void setProtocolVersion(String protocolVersion);
081    
082    
083    
084      /**
085       * Retrieves the raw, unprocessed bind DN for this bind operation as
086       * contained in the client request.  The value may not actually
087       * contain a valid DN, as no validation will have been performed.
088       *
089       * @return  The raw, unprocessed bind DN for this bind operation as
090       *          contained in the client request.
091       */
092      public ByteString getRawBindDN();
093    
094    
095    
096      /**
097       * Specifies the raw, unprocessed bind DN for this bind operation.
098       *
099       * @param  rawBindDN  The raw, unprocessed bind DN for this bind
100       *                    operation.
101       */
102      public void setRawBindDN(ByteString rawBindDN);
103    
104    
105    
106      /**
107       * Retrieves the simple authentication password for this bind
108       * operation.
109       *
110       * @return  The simple authentication password for this bind
111       *          operation.
112       */
113      public ByteString getSimplePassword();
114    
115    
116    
117      /**
118       * Specifies the simple authentication password for this bind
119       * operation.
120       *
121       * @param  simplePassword  The simple authentication password for
122       *                         this bind operation.
123       */
124      public void setSimplePassword(ByteString simplePassword);
125    
126    
127    
128      /**
129       * Retrieves the SASL mechanism for this bind operation.
130       *
131       * @return  The SASL mechanism for this bind operation, or
132       *          <CODE>null</CODE> if the bind does not use SASL
133       *          authentication.
134       */
135      public String getSASLMechanism();
136    
137    
138    
139      /**
140       * Retrieves the SASL credentials for this bind operation.
141       *
142       * @return  The SASL credentials for this bind operation, or
143       *          <CODE>null</CODE> if there are none or if the bind does
144       *          not use SASL authentication.
145       */
146      public ASN1OctetString getSASLCredentials();
147    
148    
149    
150      /**
151       * Specifies the SASL credentials for this bind operation.
152       *
153       * @param  saslMechanism    The SASL mechanism for this bind
154       *                          operation.
155       * @param  saslCredentials  The SASL credentials for this bind
156       *                          operation, or <CODE>null</CODE> if there
157       *                          are none.
158       */
159      public void setSASLCredentials(String saslMechanism,
160                                     ASN1OctetString saslCredentials);
161    
162    
163    
164      /**
165       * Specifies the set of server SASL credentials to include in the
166       * bind response.
167       *
168       * @param  serverSASLCredentials  The set of server SASL credentials
169       *                                to include in the bind response.
170       */
171      public void setServerSASLCredentials(ASN1OctetString
172                                                serverSASLCredentials);
173    
174    
175    
176      /**
177       * Specifies the reason that the authentication failed.
178       *
179       * @param  reason  A human-readable message providing the reason
180       *                 that the authentication failed.
181       */
182      public void setAuthFailureReason(Message reason);
183    }
184