Search in sources :

Example 46 with ASN1BufferSequence

use of com.unboundid.asn1.ASN1BufferSequence in project ldapsdk by pingidentity.

the class ModifyRequest method writeTo.

/**
 * {@inheritDoc}
 */
@Override()
public void writeTo(@NotNull final ASN1Buffer writer) {
    final ASN1BufferSequence requestSequence = writer.beginSequence(LDAPMessage.PROTOCOL_OP_TYPE_MODIFY_REQUEST);
    writer.addOctetString(dn);
    final ASN1BufferSequence modSequence = writer.beginSequence();
    for (final Modification m : modifications) {
        m.writeTo(writer);
    }
    modSequence.end();
    requestSequence.end();
}
Also used : ASN1BufferSequence(com.unboundid.asn1.ASN1BufferSequence)

Example 47 with ASN1BufferSequence

use of com.unboundid.asn1.ASN1BufferSequence in project ldapsdk by pingidentity.

the class Modification method writeTo.

/**
 * Writes an ASN.1-encoded representation of this modification to the provided
 * ASN.1 buffer.
 *
 * @param  buffer  The ASN.1 buffer to which the encoded representation should
 *                 be written.
 */
public void writeTo(@NotNull final ASN1Buffer buffer) {
    final ASN1BufferSequence modSequence = buffer.beginSequence();
    buffer.addEnumerated(modificationType.intValue());
    final ASN1BufferSequence attrSequence = buffer.beginSequence();
    buffer.addOctetString(attributeName);
    final ASN1BufferSet valueSet = buffer.beginSet();
    for (final ASN1OctetString v : values) {
        buffer.addElement(v);
    }
    valueSet.end();
    attrSequence.end();
    modSequence.end();
}
Also used : ASN1OctetString(com.unboundid.asn1.ASN1OctetString) ASN1BufferSequence(com.unboundid.asn1.ASN1BufferSequence) ASN1BufferSet(com.unboundid.asn1.ASN1BufferSet)

Aggregations

ASN1BufferSequence (com.unboundid.asn1.ASN1BufferSequence)47 ASN1Buffer (com.unboundid.asn1.ASN1Buffer)22 ASN1StreamReader (com.unboundid.asn1.ASN1StreamReader)22 ByteArrayInputStream (java.io.ByteArrayInputStream)22 Test (org.testng.annotations.Test)22 ASN1OctetString (com.unboundid.asn1.ASN1OctetString)9 ASN1BufferSet (com.unboundid.asn1.ASN1BufferSet)3 Attribute (com.unboundid.ldap.sdk.Attribute)2 ASN1Element (com.unboundid.asn1.ASN1Element)1 Control (com.unboundid.ldap.sdk.Control)1 Modification (com.unboundid.ldap.sdk.Modification)1 JSONObjectFilter (com.unboundid.ldap.sdk.unboundidds.jsonfilter.JSONObjectFilter)1