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    import org.opends.server.types.DN;
036    
037    
038    
039    /**
040     * This class defines a set of methods that are available for use by
041     * pre-operation plugins for bind operations.  Note that this
042     * interface is intended only to define an API for use by plugins and
043     * is not intended to be implemented by any custom classes.
044     */
045    @org.opends.server.types.PublicAPI(
046         stability=org.opends.server.types.StabilityLevel.UNCOMMITTED,
047         mayInstantiate=false,
048         mayExtend=false,
049         mayInvoke=true)
050    public interface PreOperationBindOperation
051           extends PreOperationOperation
052    {
053      /**
054       * Retrieves the authentication type for this bind operation.
055       *
056       * @return  The authentication type for this bind operation.
057       */
058      public AuthenticationType getAuthenticationType();
059    
060    
061    
062      /**
063       * Retrieves a string representation of the protocol version
064       * associated with this bind request.
065       *
066       * @return  A string representation of the protocol version
067       *          associated with this bind request.
068       */
069      public String getProtocolVersion();
070    
071    
072    
073      /**
074       * Retrieves the raw, unprocessed bind DN for this bind operation as
075       * contained in the client request.  The value may not actually
076       * contain a valid DN, as no validation will have been performed.
077       *
078       * @return  The raw, unprocessed bind DN for this bind operation as
079       *          contained in the client request.
080       */
081      public ByteString getRawBindDN();
082    
083    
084    
085      /**
086       * Retrieves the bind DN for this bind operation.
087       *
088       * @return  The bind DN for this bind operation.
089       */
090      public DN getBindDN();
091    
092    
093    
094      /**
095       * Retrieves the simple authentication password for this bind
096       * operation.
097       *
098       * @return  The simple authentication password for this bind
099       *          operation.
100       */
101      public ByteString getSimplePassword();
102    
103    
104    
105      /**
106       * Retrieves the SASL mechanism for this bind operation.
107       *
108       * @return  The SASL mechanism for this bind operation, or
109       *          <CODE>null</CODE> if the bind does not use SASL
110       *          authentication.
111       */
112      public String getSASLMechanism();
113    
114    
115    
116      /**
117       * Retrieves the SASL credentials for this bind operation.
118       *
119       * @return  The SASL credentials for this bind operation, or
120       *          <CODE>null</CODE> if there are none or if the bind does
121       *          not use SASL authentication.
122       */
123      public ASN1OctetString getSASLCredentials();
124    
125    
126    
127      /**
128       * Specifies the set of server SASL credentials to include in the
129       * bind response.
130       *
131       * @param  serverSASLCredentials  The set of server SASL credentials
132       *                                to include in the bind response.
133       */
134      public void setServerSASLCredentials(ASN1OctetString
135                                                serverSASLCredentials);
136    
137    
138    
139      /**
140       * Specifies the reason that the authentication failed.
141       *
142       * @param  reason  A human-readable message providing the reason
143       *                 that the authentication failed.
144       */
145      public void setAuthFailureReason(Message reason);
146    
147    
148    
149      /**
150       * Retrieves the user entry DN for this bind operation.  It will
151       * only be available for simple bind operations (and may be
152       * different than the bind DN from the client request).
153       *
154       * @return  The user entry DN for this bind operation, or
155       *          <CODE>null</CODE> if the bind processing has not
156       *          progressed far enough to identify the user or if the
157       *          user DN could not be determined.
158       */
159      public DN getUserEntryDN();
160    }
161