Package org.nasutekds.server.backends.task

Examples of org.nasutekds.server.backends.task.Task


    }

    if (Thread.currentThread() instanceof DirectoryThread)
    {
      DirectoryThread thread = (DirectoryThread) Thread.currentThread();
      Task task = thread.getAssociatedTask();
      if (task != null)
      {
        task.addLogMessage(message);
      }
    }
  }
View Full Code Here


      "-w", "password",
      "--noPropertiesFile",
      "-f", taskFile
    };
    assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0);
    Task task = getCompletedTask(taskDN);
    assertNotNull(task);
    assertEquals(task.getTaskState(), TaskState.COMPLETED_SUCCESSFULLY);
    assertTrue(DirectoryServer.lockdownMode());


    // If the local IP isn't the loopback address, then verify that we can't
    // connect using it even as a root user.
    if (! isLoopback)
    {
      args = new String[]
      {
        "-h", localIP,
        "-p", String.valueOf(TestCaseUtils.getServerLdapPort()),
        "-D", "cn=Directory Manager",
        "-w", "password",
        "-b", "",
        "-s", "base",
        "--noPropertiesFile",
        "(objectClass=*)"
      };
      assertFalse(LDAPSearch.mainSearch(args, false, null, null) == 0);
    }


    // Make sure that we can no longer retrieve the server's root DSE over an
    // unauthenticated connection.  In this case, we'll make sure to use a
    // loopback connection.
    args = new String[]
    {
      "-h", "127.0.0.1",
      "-p", String.valueOf(TestCaseUtils.getServerLdapPort()),
      "-b", "",
      "-s", "base",
      "--noPropertiesFile",
      "(objectClass=*)"
    };
    assertFalse(LDAPSearch.mainSearch(args, false, null, null) == 0);


    // Make sure that we can no longer retrieve the server's root DSE over an
    // authenticated connection.  In this case, we'll make sure to use a
    // loopback connection.
    args = new String[]
    {
      "-h", "127.0.0.1",
      "-p", String.valueOf(TestCaseUtils.getServerLdapPort()),
      "-D", "cn=Admin,o=test",
      "-w", "password",
      "-b", "",
      "-s", "base",
      "--noPropertiesFile",
      "(objectClass=*)"
    };
    assertFalse(LDAPSearch.mainSearch(args, false, null, null) == 0);


    // Make sure that we can retrieve the server's root DSE over a
    // root-authenticated loopback connection.
    args = new String[]
    {
      "-h", "127.0.0.1",
      "-p", String.valueOf(TestCaseUtils.getServerLdapPort()),
      "-D", "cn=Directory Manager",
      "-w", "password",
      "-b", "",
      "-s", "base",
      "--noPropertiesFile",
      "(objectClass=*)"
    };
    assertEquals(LDAPSearch.mainSearch(args, false, null, null), 0);


    // Use another task to take the server out of lockdown mode and make sure it
    // works.
    taskFile = TestCaseUtils.createTempFile(
      "dn: ds-task-id=Leave Lockdown Mode,cn=Scheduled Tasks,cn=tasks",
      "changetype: add",
      "objectClass: top",
      "objectClass: ds-task",
      "ds-task-id: Leave Lockdown Mode",
      "ds-task-class-name: org.nasutekds.server.tasks.LeaveLockdownModeTask");

    taskDN = DN.decode(
         "ds-task-id=Leave Lockdown Mode,cn=Scheduled Tasks,cn=tasks");

    args = new String[]
    {
      "-h", "127.0.0.1",
      "-p", String.valueOf(TestCaseUtils.getServerAdminPort()),
      "-Z", "-X",
      "-D", "cn=Directory Manager",
      "-w", "password",
      "--noPropertiesFile",
      "-f", taskFile
    };
    assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0);
    task = getCompletedTask(taskDN);
    assertNotNull(task);
    assertEquals(task.getTaskState(), TaskState.COMPLETED_SUCCESSFULLY);
    assertFalse(DirectoryServer.lockdownMode());


    // Make sure that we can once again retrieve the server's root DSE over an
    // anonymous connection.
View Full Code Here

    if (hasPrivilege)
    {
      assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS);

      Task task = getCompletedTask(taskEntry.getDN());
      assertNotNull(task);
      assertTrue(TaskState.isSuccessful(task.getTaskState()));
    }
    else
    {
      assertEquals(addOperation.getResultCode(),
                   ResultCode.INSUFFICIENT_ACCESS_RIGHTS);
View Full Code Here

    };

    assertEquals(LDAPModify.mainModify(args, false, System.out, System.err),
                 LDAPResultCode.SUCCESS);

    Task task = getCompletedTask(DN.decode(
         "ds-task-id=testAllowedTask 2,cn=Scheduled Tasks,cn=Tasks"));
    assertNotNull(task);
    assertEquals(task.getTaskState(), TaskState.COMPLETED_SUCCESSFULLY);


    // Remove the task class from the set of allowed tasks and verify that we
    // can no longer schedule the task.
    TestCaseUtils.dsconfig(
View Full Code Here

      "objectclass: ds-task-import",
      "ds-task-class-name: org.nasutekds.server.tasks.ImportTask",
      "ds-task-import-backend-id: ldifRoot",
      "ds-task-import-ldif-file: " + ldifFile.getAbsolutePath());

    Task t = TasksTestCase.getCompletedTask(DN.decode(taskDN));
    assertNotNull(t);
    assertEquals(t.getTaskState(), TaskState.COMPLETED_SUCCESSFULLY);
  }
View Full Code Here

      "objectclass: ds-task-export",
      "ds-task-class-name: org.nasutekds.server.tasks.ExportTask",
      "ds-task-export-backend-id: ldifRoot",
      "ds-task-export-ldif-file: " + tempFilePath);

    Task t = TasksTestCase.getCompletedTask(DN.decode(taskDN));
    assertNotNull(t);
    assertEquals(t.getTaskState(), TaskState.COMPLETED_SUCCESSFULLY);
  }
View Full Code Here

         "ds-task-id: add-single-valid-file",
         "ds-task-class-name: org.nasutekds.server.tasks.AddSchemaFileTask",
         "ds-task-schema-file-name: 05-single-valid.ldif");
    assertEquals(resultCode, 0);

    Task task = getCompletedTask(DN.decode(taskDNStr));
    assertEquals(task.getTaskState(), TaskState.COMPLETED_SUCCESSFULLY);
    assertFalse(DirectoryServer.getSchema().getYoungestModificationTime() ==
                     beforeModifyTimestamp);
  }
View Full Code Here

         "ds-task-class-name: org.nasutekds.server.tasks.AddSchemaFileTask",
         "ds-task-schema-file-name: 05-multiple-valid-1.ldif",
         "ds-task-schema-file-name: 05-multiple-valid-2.ldif");
    assertEquals(resultCode, 0);

    Task task = getCompletedTask(DN.decode(taskDNStr));
    assertEquals(task.getTaskState(), TaskState.COMPLETED_SUCCESSFULLY);
    assertFalse(DirectoryServer.getSchema().getYoungestModificationTime() ==
                     beforeModifyTimestamp);
  }
View Full Code Here

         "ds-task-id: add-empty-file",
         "ds-task-class-name: org.nasutekds.server.tasks.AddSchemaFileTask",
         "ds-task-schema-file-name: 05-empty.ldif");
    assertEquals(resultCode, 0);

    Task task = getCompletedTask(DN.decode(taskDNStr));
    assertEquals(task.getTaskState(), TaskState.COMPLETED_SUCCESSFULLY);
    assertFalse(DirectoryServer.getSchema().getYoungestModificationTime() ==
                     beforeModifyTimestamp);
  }
View Full Code Here

      "ds-task-class-name: org.nasutekds.server.tasks.DisconnectClientTask",
      "ds-task-disconnect-connection-id: " + connectionID,
      "ds-task-disconnect-notify-client: true",
      "ds-task-disconnect-message: " + disconnectMessage);

    Task task = getCompletedTask(taskDN);
    assertNotNull(task);
    assertEquals(task.getTaskState(), TaskState.COMPLETED_SUCCESSFULLY);


    // Make sure that we get a notice of disconnection on the initial
    // connection.
    message = r.readMessage();
View Full Code Here

TOP

Related Classes of org.nasutekds.server.backends.task.Task

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.