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