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