Package org.nasutekds.server.core

Examples of org.nasutekds.server.core.ModifyOperation


    switch (cre.getChangeOperationType()) {
      case MODIFY:
        LOG.log(Level.INFO, "proparing to modify " + dnByteString);
        ModifyChangeRecordEntry mcre =
                (ModifyChangeRecordEntry) cre;
        ModifyOperation op =
                cc.processModify(dnByteString, mcre.getModifications());
        rc = op.getResultCode();
        if (rc.equals(ResultCode.
                SUCCESS)) {
          LOG.log(Level.INFO, "processed server modification " +
                  modListToString(op.getModifications()));
        } else if (rc.equals(
                ResultCode.
                        ATTRIBUTE_OR_VALUE_EXISTS)) {
          // ignore this error
          LOG.log(Level.INFO, "ignoring attribute that already exists: " +
                  modListToString(op.getModifications()));
        } else if (rc.equals(ResultCode.NO_SUCH_ATTRIBUTE)) {
          // This can happen if for instance the old configuration was
          // changed so that the value of an attribute matches the default
          // value of the attribute in the new configuration.
          // Just log it and move on.
          LOG.log(Level.INFO, "Ignoring attribute not found: " +
                  modListToString(op.getModifications()));
        } else {
          // report the error to the user
          MessageBuilder error = op.getErrorMessage();
          throw new ApplicationException(
              ReturnCode.IMPORT_ERROR,
                  INFO_ERROR_APPLY_LDIF_MODIFY.get(dnByteString.toString(),
                          error != null ? error.toString() : ""),
                  null);
View Full Code Here


      // If there are any modifications that need to be made to the password
      // policy state, then apply them now.
      List<Modification> stateMods = pwpState.getModifications();
      if ((stateMods != null) && (! stateMods.isEmpty()))
      {
        ModifyOperation modifyOperation =
            conn.processModify(targetDN, stateMods);
        if (modifyOperation.getResultCode() != ResultCode.SUCCESS)
        {
          operation.setResultCode(modifyOperation.getResultCode());
          operation.setErrorMessage(modifyOperation.getErrorMessage());
          operation.setMatchedDN(modifyOperation.getMatchedDN());
          operation.setReferralURLs(modifyOperation.getReferralURLs());
          return;
        }
      }
    }
    catch (Exception e)
View Full Code Here

      Attribute attribute = Attributes.create(
          ConfigConstants.ATTR_CRYPTO_SYMMETRIC_KEY, symmetricKey);
      modifications.add(
              new Modification(ModificationType.ADD, attribute,
                      false));
      ModifyOperation internalModify =
              internalConnection.processModify(entry.getDN(),
                      modifications);
      if (internalModify.getResultCode() != ResultCode.SUCCESS)
      {
        throw new CryptoManagerException(
                ERR_CRYPTOMGR_IMPORT_KEY_ENTRY_FAILED_TO_ADD_KEY.get(
                        entry.getDN().toString()));
      }
View Full Code Here

        Attribute attribute = Attributes.create(
            ConfigConstants.ATTR_CRYPTO_SYMMETRIC_KEY, symmetricKey);
        modifications.add(
             new Modification(ModificationType.ADD, attribute,
                              false));
        ModifyOperation internalModify =
             internalConnection.processModify(entry.getDN(),
                                              modifications);
        if (internalModify.getResultCode() != ResultCode.SUCCESS)
        {
          throw new CryptoManagerException(
               ERR_CRYPTOMGR_IMPORT_KEY_ENTRY_FAILED_TO_ADD_KEY.get(
                    entry.getDN().toString()));
        }
View Full Code Here

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
    String backendDNString = configEntryDN.toString();
    ByteString rawEntryDN =
        ByteString.valueOf(backendDNString);
    ModifyOperation internalModify = conn.processModify(rawEntryDN, modList);

    ResultCode resultCode = internalModify.getResultCode();
    if (resultCode != ResultCode.SUCCESS)
    {
      Message message =
          TaskMessages.ERR_TASK_CANNOT_ENABLE_BACKEND.get(backendDNString);
      throw new DirectoryException(resultCode, message);
View Full Code Here

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
    String backendDNString = configEntryDN.toString();
    ByteString rawEntryDN =
        ByteString.valueOf(backendDNString);
    ModifyOperation internalModify = conn.processModify(rawEntryDN, modList);

    ResultCode resultCode = internalModify.getResultCode();
    if (resultCode != ResultCode.SUCCESS)
    {
      Message message =
          TaskMessages.ERR_TASK_CANNOT_DISABLE_BACKEND.get(backendDNString);
      throw new DirectoryException(resultCode, message);
View Full Code Here

      }
    }

    InternalClientConnection conn =
            InternalClientConnection.getRootConnection();
    ModifyOperation modifyOperation =
            conn.processModify(entryDN, mods);
    if(modifyOperation.getResultCode() != ResultCode.SUCCESS)
    {
      logError(ERR_PLUGIN_REFERENT_MODIFY_FAILED.get(entryDN.toString(),
                      String.valueOf(modifyOperation.getErrorMessage())));
    }
  }
View Full Code Here

          InternalClientConnection.getRootConnection();
        try
        {
          // Map the modMsg modifications to an LDIF string
          // for the 'changes' attribute of the CL entry
          ModifyOperation modifyOperation =
            (ModifyOperation)modMsg.createOperation(conn);
          String LDIFchanges = modToLDIF(modifyOperation.getModifications());

          ArrayList<RawAttribute> eclAttributes = modMsg.getEclIncludes();

          clEntry = createChangelogEntry(
              eclmsg.getServiceId(),
View Full Code Here

    LDAPAttribute attr = new LDAPAttribute("ds-cfg-max-psearches", values);

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

    ModifyOperation modifyOperation =
         conn.processModify(ByteString.valueOf("cn=config"), mods);
    assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);

    //Create a persistent search request.
    LinkedHashSet<String> attributes = new LinkedHashSet<String>();
    attributes.add("cn");
    List<Control> controls = new LinkedList<Control>();
View Full Code Here

      InternalClientConnection.getRootConnection();
    ArrayList<Modification> mods = new ArrayList<Modification>();
    mods.add(new Modification(ModificationType.ADD,
        Attributes.create("ds-cfg-base-dn", "o=airius.com")));
    String userRootDN  = "ds-cfg-backend-id=userRoot,cn=Backends,cn=config";
    ModifyOperation modifyOperation =
         rootConnection.processModify(DN.decode(userRootDN), mods);
    assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
  }
View Full Code Here

TOP

Related Classes of org.nasutekds.server.core.ModifyOperation

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.