| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.controls; |
| | | |
| | |
| | | import org.opends.server.types.Control; |
| | | import org.opends.server.types.DN; |
| | | |
| | | import static org.opends.server.loggers.Debug.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.messages.ProtocolMessages.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | | |
| | |
| | | public class AuthorizationIdentityResponseControl |
| | | extends Control |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.controls.AuthorizationIdentityResponseControl"; |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | super(OID_AUTHZID_RESPONSE, false, new ASN1OctetString()); |
| | | |
| | | assert debugConstructor(CLASS_NAME); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | super(OID_AUTHZID_RESPONSE, false, encodeValue(authorizationID)); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(authorizationID)); |
| | | |
| | | this.authorizationID = authorizationID; |
| | | } |
| | |
| | | { |
| | | super(OID_AUTHZID_RESPONSE, false, encodeValue(authorizationDN)); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(authorizationDN)); |
| | | |
| | | if (authorizationDN == null) |
| | | { |
| | |
| | | { |
| | | super(oid, isCritical, encodeValue(authorizationID)); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(oid), |
| | | String.valueOf(isCritical), |
| | | String.valueOf(authorizationID)); |
| | | |
| | | this.authorizationID = authorizationID; |
| | | } |
| | |
| | | { |
| | | super(oid, isCritical, encodeValue(authorizationDN)); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(oid), |
| | | String.valueOf(isCritical), |
| | | String.valueOf(authorizationDN)); |
| | | |
| | | if (authorizationDN == null) |
| | | { |
| | |
| | | { |
| | | super(oid, isCritical, encodedValue); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(oid), |
| | | String.valueOf(isCritical), |
| | | String.valueOf(authorizationID), |
| | | String.valueOf(encodedValue)); |
| | | |
| | | this.authorizationID = authorizationID; |
| | | } |
| | |
| | | */ |
| | | private static ASN1OctetString encodeValue(String authorizationID) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "encodeValue", |
| | | String.valueOf(authorizationID)); |
| | | |
| | | |
| | | return new ASN1OctetString(authorizationID); |
| | |
| | | */ |
| | | private static ASN1OctetString encodeValue(DN authorizationDN) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "encodeValue", |
| | | String.valueOf(authorizationDN)); |
| | | |
| | | |
| | | if (authorizationDN == null) |
| | |
| | | Control control) |
| | | throws LDAPException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "decodeControl", String.valueOf(control)); |
| | | |
| | | |
| | | if (! control.hasValue()) |
| | |
| | | */ |
| | | public String getAuthorizationID() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getAuthorizationID"); |
| | | |
| | | return authorizationID; |
| | | } |
| | |
| | | */ |
| | | public void setAuthorizationID(String authorizationID) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setAuthorizationID", |
| | | String.valueOf(authorizationID)); |
| | | |
| | | this.authorizationID = authorizationID; |
| | | setValue(encodeValue(authorizationID)); |
| | |
| | | */ |
| | | 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("AuthorizationIdentityResponseControl(authzID=\""); |
| | | buffer.append(authorizationID); |