| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | | |
| | | import java.io.IOException; |
| | | |
| | | import org.forgerock.opendj.io.*; |
| | |
| | | |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | |
| | | |
| | | /** |
| | | * This class defines the data structures and methods to use when interacting |
| | | * with a generic LDAP control. |
| | |
| | | /** The control value. */ |
| | | private ByteString value; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new LDAP control with the specified OID. It will not be |
| | | * critical, and will not have a value. |
| | |
| | | super(oid, false); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new LDAP control with the specified OID and criticality. It will |
| | | * not have a value. |
| | |
| | | super(oid, isCritical); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new LDAP control with the specified OID, criticality, and value. |
| | | * |
| | |
| | | this.value = value; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Retrieves the value for this control. |
| | | * |
| | |
| | | return value; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether this control has a value. |
| | | * |
| | |
| | | return value != null; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void writeValue(ASN1Writer stream) throws IOException |
| | | { |
| | | if (value != null) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Appends a string representation of this LDAP control to the provided |
| | | * buffer. |
| | | * |
| | | * @param buffer The buffer to which the information should be appended. |
| | | */ |
| | | @Override |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | buffer.append("LDAPControl(oid="); |
| | |
| | | buffer.append(")"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Appends a multi-line string representation of this LDAP control to the |
| | | * provided buffer. |
| | |
| | | } |
| | | } |
| | | } |
| | | |