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