| | |
| | | * 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.ObjectClass; |
| | | |
| | | 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 LDAPPostReadRequestControl |
| | | extends Control |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.controls.LDAPPostReadRequestControl"; |
| | | |
| | | |
| | | |
| | |
| | | super(OID_LDAP_READENTRY_POSTREAD, isCritical, |
| | | encodeAttributes(rawAttributes)); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(isCritical), |
| | | String.valueOf(rawAttributes)); |
| | | |
| | | if (rawAttributes == null) |
| | | { |
| | |
| | | { |
| | | super(oid, isCritical, encodeAttributes(rawAttributes)); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(oid), |
| | | String.valueOf(isCritical), |
| | | String.valueOf(rawAttributes)); |
| | | |
| | | if (rawAttributes == null) |
| | | { |
| | |
| | | { |
| | | super(oid, isCritical, encodedValue); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(oid), |
| | | String.valueOf(isCritical), |
| | | String.valueOf(rawAttributes), |
| | | String.valueOf(encodedValue)); |
| | | |
| | | if (rawAttributes == null) |
| | | { |
| | |
| | | public static LDAPPostReadRequestControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "decodeControl", String.valueOf(control)); |
| | | |
| | | if (! control.hasValue()) |
| | | { |
| | |
| | | } |
| | | catch (ASN1Exception ae) |
| | | { |
| | | assert debugException(CLASS_NAME, "decodeControl", ae); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, ae); |
| | | } |
| | | |
| | | int msgID = MSGID_POSTREADREQ_CANNOT_DECODE_VALUE; |
| | | String message = getMessage(msgID, ae.getMessage()); |
| | |
| | | private static ASN1OctetString encodeAttributes(LinkedHashSet<String> |
| | | rawAttributes) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "encodeAttributes", |
| | | String.valueOf(rawAttributes)); |
| | | |
| | | if (rawAttributes == null) |
| | | { |
| | |
| | | */ |
| | | public LinkedHashSet<String> getRawAttributes() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getRawAttributes"); |
| | | |
| | | return rawAttributes; |
| | | } |
| | |
| | | */ |
| | | public void setRawAttributes(LinkedHashSet<String> rawAttributes) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setRawAttributes", |
| | | String.valueOf(rawAttributes)); |
| | | |
| | | if (rawAttributes == null) |
| | | { |
| | |
| | | */ |
| | | public LinkedHashSet<AttributeType> getRequestedAttributes() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getRequestedAttributes"); |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | |
| | | */ |
| | | public boolean returnAllUserAttributes() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "returnAllUserAttributes"); |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | |
| | | */ |
| | | public boolean returnAllOperationalAttributes() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "returnAllOperationalAttributes"); |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | |
| | | */ |
| | | public boolean allowsAttribute(AttributeType attrType) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "allowsAttribute", |
| | | String.valueOf(attrType)); |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | |
| | | */ |
| | | 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("LDAPPostReadRequestControl(criticality="); |
| | | buffer.append(isCritical()); |