| | |
| | | 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 ProxiedAuthV2Control |
| | | extends Control |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.controls.ProxiedAuthV2Control"; |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | super(OID_PROXIED_AUTH_V2, true, authorizationID); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(authorizationID)); |
| | | |
| | | ensureNotNull(authorizationID); |
| | | this.authorizationID = authorizationID; |
| | |
| | | { |
| | | super(oid, isCritical, authorizationID); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(oid), |
| | | String.valueOf(isCritical), |
| | | String.valueOf(authorizationID)); |
| | | |
| | | this.authorizationID = authorizationID; |
| | | } |
| | |
| | | public static ProxiedAuthV2Control decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "decodeControl", String.valueOf(control)); |
| | | |
| | | ensureNotNull(control); |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | assert debugException(CLASS_NAME, "decodeControl", ae); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, ae); |
| | | } |
| | | |
| | | int msgID = MSGID_PROXYAUTH2_CANNOT_DECODE_VALUE; |
| | | String message = getMessage(msgID, stackTraceToSingleLineString(ae)); |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "decodeControl", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_PROXYAUTH2_CANNOT_DECODE_VALUE; |
| | | String message = getMessage(msgID, stackTraceToSingleLineString(e)); |
| | |
| | | */ |
| | | public ASN1OctetString getAuthorizationID() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getAuthorizationID"); |
| | | |
| | | return authorizationID; |
| | | } |
| | |
| | | */ |
| | | public void setAuthorizationID(ASN1OctetString authorizationID) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setAuthorizationID", |
| | | String.valueOf(authorizationID)); |
| | | |
| | | if (authorizationID == null) |
| | | { |
| | |
| | | public Entry getAuthorizationEntry() |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getValidatedAuthorizationDN"); |
| | | |
| | | |
| | | // Check for a zero-length value, which would be for an anonymous user. |
| | |
| | | */ |
| | | 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("ProxiedAuthorizationV2Control(authzID=\""); |
| | | authorizationID.toString(buffer); |