Package org.nasutekds.server.protocols.ldap

Examples of org.nasutekds.server.protocols.ldap.LDAPAttribute


    ArrayList<ByteString> values = new ArrayList<ByteString>();
    values.add(ByteString.valueOf("This is a test"));

    ArrayList<RawModification> mods = new ArrayList<RawModification>();
    mods.add(new LDAPModification(ModificationType.REPLACE,
                                  new LDAPAttribute("description", values)));

    ModifyOperation modifyOperation =
         conn.processModify(ByteString.valueOf("cn=test,o=test"), mods);
    assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
  }
View Full Code Here



    ArrayList<RawModification> ldapMods = new ArrayList<RawModification>();
    ArrayList<ByteString> ldapValues = new ArrayList<ByteString>();
    ldapValues.add(ByteString.valueOf("foo"));
    LDAPAttribute ldapAttr = new LDAPAttribute("description", ldapValues);
    ldapMods.add(new LDAPModification(ModificationType.ADD, ldapAttr));

    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), null,
                                   ByteString.empty(), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), noControls,
                                   ByteString.empty(), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), null,
                                   ByteString.valueOf("o=test"), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), noControls,
                                   ByteString.valueOf("o=test"), ldapMods));

    ldapMods = new ArrayList<RawModification>();
    ldapMods.add(new LDAPModification(ModificationType.DELETE, ldapAttr));

    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), null,
                                   ByteString.empty(), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), noControls,
                                   ByteString.empty(), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), null,
                                   ByteString.valueOf("o=test"), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), noControls,
                                   ByteString.valueOf("o=test"), ldapMods));

    ldapMods = new ArrayList<RawModification>();
    ldapMods.add(new LDAPModification(ModificationType.REPLACE, ldapAttr));

    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), null,
                                   ByteString.empty(), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), noControls,
                                   ByteString.empty(), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), null,
                                   ByteString.valueOf("o=test"), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), noControls,
                                   ByteString.valueOf("o=test"), ldapMods));

    ldapMods = new ArrayList<RawModification>();
    ArrayList<ByteString> values2 = new ArrayList<ByteString>();
    values2.add(ByteString.valueOf("bar"));
    LDAPAttribute ldapAttr2 = new LDAPAttribute("description", values2);
    ldapMods.add(new LDAPModification(ModificationType.DELETE, ldapAttr));
    ldapMods.add(new LDAPModification(ModificationType.ADD, ldapAttr2));

    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), null,
                                   ByteString.empty(), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), noControls,
                                   ByteString.empty(), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), null,
                                   ByteString.valueOf("o=test"), ldapMods));
    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), noControls,
                                   ByteString.valueOf("o=test"), ldapMods));

    ldapMods = new ArrayList<RawModification>();
    ldapAttr2 = new LDAPAttribute("cn", values2);
    ldapMods.add(new LDAPModification(ModificationType.REPLACE, ldapAttr));
    ldapMods.add(new LDAPModification(ModificationType.REPLACE, ldapAttr2));

    opList.add(new ModifyOperationBasis(conn, conn.nextOperationID(),
                                   conn.nextMessageID(), null,
View Full Code Here

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();

    ArrayList<ByteString> values = new ArrayList<ByteString>();
    values.add(ByteString.valueOf("foo"));
    LDAPAttribute attr = new LDAPAttribute("description", values);

    ArrayList<RawModification> mods = new ArrayList<RawModification>();
    mods.add(new LDAPModification(ModificationType.REPLACE, attr));

    ModifyOperation modifyOperation =
View Full Code Here

         new ArrayList<RawModification>(rawMods);
    modifyOperation.setRawModifications(clonedMods);

    ArrayList<ByteString> values = new ArrayList<ByteString>();
    values.add(ByteString.valueOf("test"));
    LDAPAttribute attr = new LDAPAttribute("test", values);

    LDAPModification mod = new LDAPModification(ModificationType.REPLACE, attr);
    modifyOperation.addRawModification(mod);

    assertEquals(modifyOperation.getRawModifications().size(),
View Full Code Here

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();

    ArrayList<ByteString> values = new ArrayList<ByteString>();
    values.add(ByteString.valueOf("foo"));
    LDAPAttribute attr = new LDAPAttribute("description", values);

    ArrayList<RawModification> mods = new ArrayList<RawModification>();
    mods.add(new LDAPModification(ModificationType.REPLACE, attr));

    ModifyOperation modifyOperation =
View Full Code Here

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();

    ArrayList<ByteString> values = new ArrayList<ByteString>();
    values.add(ByteString.valueOf("foo"));
    LDAPAttribute attr = new LDAPAttribute("description", values);

    ArrayList<RawModification> mods = new ArrayList<RawModification>();
    mods.add(new LDAPModification(ModificationType.REPLACE, attr));

    ModifyOperation modifyOperation =
View Full Code Here

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();

    ArrayList<ByteString> values = new ArrayList<ByteString>();
    values.add(ByteString.valueOf("foo"));
    LDAPAttribute attr = new LDAPAttribute("description", values);

    ArrayList<RawModification> mods = new ArrayList<RawModification>();
    mods.add(new LDAPModification(ModificationType.REPLACE, attr));

    ModifyOperation modifyOperation =
View Full Code Here

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();

    ArrayList<ByteString> values = new ArrayList<ByteString>();
    values.add(ByteString.valueOf("foo"));
    LDAPAttribute attr = new LDAPAttribute("description", values);

    ArrayList<RawModification> mods = new ArrayList<RawModification>();
    mods.add(new LDAPModification(ModificationType.REPLACE, attr));

    ModifyOperation modifyOperation =
View Full Code Here

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();

    ArrayList<ByteString> values = new ArrayList<ByteString>();
    values.add(ByteString.valueOf("foo"));
    LDAPAttribute attr = new LDAPAttribute("description", values);

    ArrayList<RawModification> mods = new ArrayList<RawModification>();
    mods.add(new LDAPModification(ModificationType.REPLACE, attr));

    ModifyOperation modifyOperation =
View Full Code Here

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();

    ArrayList<ByteString> values = new ArrayList<ByteString>();
    values.add(ByteString.valueOf("test2"));
    LDAPAttribute attr = new LDAPAttribute("o", values);

    ArrayList<RawModification> mods = new ArrayList<RawModification>();
    mods.add(new LDAPModification(ModificationType.ADD, attr));

    ModifyOperation modifyOperation =
View Full Code Here

TOP

Related Classes of org.nasutekds.server.protocols.ldap.LDAPAttribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.