Examples of ModifyDNOperation


Examples of org.nasutekds.server.core.ModifyDNOperation

                                                e.getUserAttributes(),
                                                e.getOperationalAttributes());
    assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS);


    ModifyDNOperation modifyDNOperation =
         conn.processModifyDN(DN.decode("cn=test,o=test"),
                              RDN.decode("cn=test2"), true);
    assertEquals(modifyDNOperation.getResultCode(), ResultCode.SUCCESS);
  }
View Full Code Here

Examples of org.nasutekds.server.core.ModifyDNOperation

                                                e.getUserAttributes(),
                                                e.getOperationalAttributes());
    assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS);


    ModifyDNOperation modifyDNOperation =
         conn.processModifyDN(DN.decode("cn=test,o=test"),
                              RDN.decode("cn=test2"), true,
                              DN.decode("dc=example,dc=com"));
    assertEquals(modifyDNOperation.getResultCode(),
                 ResultCode.UNWILLING_TO_PERFORM);
  }
View Full Code Here

Examples of org.nasutekds.server.core.ModifyDNOperation

                                      boolean hasPrivilege)
         throws Exception
  {
    assertEquals(conn.hasPrivilege(Privilege.CONFIG_WRITE, null), hasPrivilege);

    ModifyDNOperation modifyDNOperation =
         conn.processModifyDN(DN.decode("cn=Work Queue,cn=config"),
                              RDN.decode("cn=New RDN for Work Queue"), true,
                              null);
    if (hasPrivilege)
    {
      // We don't support modify DN operations in the server configuration, but
      // at least we need to make sure we're getting past the privilege check.
      assertEquals(modifyDNOperation.getResultCode(),
                   ResultCode.UNWILLING_TO_PERFORM);
    }
    else
    {
      assertEquals(modifyDNOperation.getResultCode(),
                   ResultCode.INSUFFICIENT_ACCESS_RIGHTS);
    }
  }
View Full Code Here

Examples of org.nasutekds.server.core.ModifyDNOperation

         throws Exception
  {
    assertEquals(conn.hasPrivilege(Privilege.SUBENTRY_WRITE, null),
            hasPrivilege);

    ModifyDNOperation modifyDNOperation =
         conn.processModifyDN(DN.decode("cn=Subentry Target,o=test"),
                              RDN.decode("cn=New Subentry Target"),
                              true, null);
    if (hasPrivilege)
    {
      assertEquals(modifyDNOperation.getResultCode(),
                   ResultCode.SUCCESS);
      modifyDNOperation =
         conn.processModifyDN(DN.decode("cn=New Subentry Target,o=test"),
                              RDN.decode("cn=Subentry Target"),
                              true, null);
    }
    else
    {
      assertEquals(modifyDNOperation.getResultCode(),
                   ResultCode.INSUFFICIENT_ACCESS_RIGHTS);
    }
  }
View Full Code Here

Examples of org.nasutekds.server.core.ModifyDNOperation

      // Now delete the first entry that was added at the beginning
      InternalClientConnection conn =
        InternalClientConnection.getRootConnection();

      ModifyDNOperation modDNOperation =
        conn.processModifyDN(entry.getDN(), RDN.decode("cn=foo"), false);
      assertEquals(modDNOperation.getResultCode(), ResultCode.SUCCESS);

      // Expect the conflict resolution : the second entry should now
      // have been renamed with the original DN.
      Entry resultEntry = DirectoryServer.getEntry(entry.getDN());
      assertTrue(resultEntry != null, "The conflict was not cleared");
View Full Code Here

Examples of org.nasutekds.server.core.ModifyDNOperation

  {
    Message alertMessage = NOTE_UNRESOLVED_CONFLICT.get(dn.toString());
    DirectoryServer.sendAlertNotification(this,
        ALERT_TYPE_REPLICATION_UNRESOLVED_CONFLICT, alertMessage);

    ModifyDNOperation newOp =
      renameEntry(dn, generateDeleteConflictDn(uid, dn), baseDn, true);

    if (newOp.getResultCode() != ResultCode.SUCCESS)
    {
      // log information for the repair tool.
      MessageBuilder mb = new MessageBuilder();
      mb.append(ERR_CANNOT_RENAME_CONFLICT_ENTRY.get());
      mb.append(String.valueOf(dn));
      mb.append(" ");
      mb.append(String.valueOf(conflictOp));
      mb.append(" ");
      mb.append(String.valueOf(newOp.getResultCode()));
      logError(mb.toMessage());
    }
  }
View Full Code Here

Examples of org.nasutekds.server.core.ModifyDNOperation

            entry = reader.readEntry();
          }
        }
        else if (msg instanceof ModifyDNMsg)
        {
          ModifyDNOperation op = (ModifyDNOperation)msg.createOperation(conn);

          dn = DN.decode("uuid=" + msg.getUniqueId() + "," +
              CHANGE_NUMBER + "=" + msg.getChangeNumber().toString()+ "," +
              msg.getDn() +","+ BASE_DN);
          op.setInternalOperation(true);

          ModifyDNChangeRecordEntry changeRecord =
            new ModifyDNChangeRecordEntry(dn, op.getNewRDN(), op.deleteOldRDN(),
                op.getNewSuperior());

          if (exportConfig != null)
          {
            ldifWriter.writeChangeRecord(changeRecord);
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.