| | |
| | | import org.opends.server.types.LockManager; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.Debug.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugCought; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.messages.ProtocolMessages.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | |
| | | public class ProxiedAuthV1Control |
| | | extends Control |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.controls.ProxiedAuthV1Control"; |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | super(OID_PROXIED_AUTH_V1, true, encodeValue(rawAuthorizationDN)); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(rawAuthorizationDN)); |
| | | |
| | | this.rawAuthorizationDN = rawAuthorizationDN; |
| | | |
| | |
| | | super(OID_PROXIED_AUTH_V1, true, |
| | | encodeValue(new ASN1OctetString(authorizationDN.toString()))); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(authorizationDN)); |
| | | |
| | | this.authorizationDN = authorizationDN; |
| | | |
| | |
| | | { |
| | | super(oid, isCritical, controlValue); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(oid), |
| | | String.valueOf(isCritical), |
| | | String.valueOf(controlValue), |
| | | String.valueOf(rawAuthorizationDN)); |
| | | |
| | | this.rawAuthorizationDN = rawAuthorizationDN; |
| | | |
| | |
| | | */ |
| | | private static ASN1OctetString encodeValue(ASN1OctetString rawAuthorizationDN) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "encodeValue", |
| | | String.valueOf(rawAuthorizationDN)); |
| | | |
| | | ensureNotNull(rawAuthorizationDN); |
| | | |
| | |
| | | public static ProxiedAuthV1Control decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "decodeControl", String.valueOf(control)); |
| | | |
| | | ensureNotNull(control); |
| | | |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "decodeControl", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_PROXYAUTH1_CANNOT_DECODE_VALUE; |
| | | String message = getMessage(msgID, stackTraceToSingleLineString(e)); |
| | |
| | | */ |
| | | public ASN1OctetString getRawAuthorizationDN() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getRawAuthorizationDN"); |
| | | |
| | | return rawAuthorizationDN; |
| | | } |
| | |
| | | */ |
| | | public void setRawAuthorizationDN(ASN1OctetString rawAuthorizationDN) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setRawAuthorizationDN", |
| | | String.valueOf(rawAuthorizationDN)); |
| | | |
| | | this.rawAuthorizationDN = rawAuthorizationDN; |
| | | |
| | |
| | | public DN getAuthorizationDN() |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getAuthorizationDN"); |
| | | |
| | | if (authorizationDN == null) |
| | | { |
| | |
| | | */ |
| | | public void setAuthorizationDN(DN authorizationDN) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setAuthorizationDN", |
| | | String.valueOf(authorizationDN)); |
| | | |
| | | ensureNotNull(authorizationDN); |
| | | |
| | |
| | | public Entry getAuthorizationEntry() |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getAuthorizationEntry"); |
| | | |
| | | DN authzDN = getAuthorizationDN(); |
| | | if (authzDN.isNullDN()) |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "toString"); |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "toString", "java.lang.StringBuilder"); |
| | | |
| | | buffer.append("ProxiedAuthorizationV1Control(authorizationDN=\""); |
| | | rawAuthorizationDN.toString(buffer); |