Package org.nasutekds.server.api

Examples of org.nasutekds.server.api.Backend


       extends OperationTestCase
{
  // Some of the tests disable the backends, so we reenable them here.
  @AfterMethod(alwaysRun=true)
  public void reenableBackend() throws DirectoryException {
    Backend b = DirectoryServer.getBackend(DN.decode("o=test"));
    b.setWritabilityMode(WritabilityMode.ENABLED);
  }
View Full Code Here


    TestCaseUtils.initializeTestBackend(true);

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();

    Backend backend = DirectoryServer.getBackend(DN.decode("o=test"));
    backend.setWritabilityMode(WritabilityMode.DISABLED);

    DeleteOperation deleteOperation =
         conn.processDelete(ByteString.valueOf("o=test"));
    assertFalse(deleteOperation.getResultCode() == ResultCode.SUCCESS);

    backend.setWritabilityMode(WritabilityMode.ENABLED);
  }
View Full Code Here

    TestCaseUtils.initializeTestBackend(true);

    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();

    Backend backend = DirectoryServer.getBackend(DN.decode("o=test"));
    backend.setWritabilityMode(WritabilityMode.INTERNAL_ONLY);

    DeleteOperation deleteOperation =
         conn.processDelete(ByteString.valueOf("o=test"));
    assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS);

    backend.setWritabilityMode(WritabilityMode.ENABLED);
  }
View Full Code Here

  public void testExternalDeleteWithBackendWritabilityInternalOnly()
         throws Exception
  {
    TestCaseUtils.initializeTestBackend(true);

    Backend backend = DirectoryServer.getBackend(DN.decode("o=test"));
    backend.setWritabilityMode(WritabilityMode.INTERNAL_ONLY);

    String[] args =
    {
      "-h", "127.0.0.1",
      "-p", String.valueOf(TestCaseUtils.getServerLdapPort()),
      "-D", "cn=Directory Manager",
      "-w", "password",
      "o=test"
    };
    assertFalse(LDAPDelete.mainDelete(args, false, null, null) == 0);

    backend.setWritabilityMode(WritabilityMode.ENABLED);
  }
View Full Code Here

  {
    assertNull(super.toVerboseString(),
      "Expected empty cache.  " + "Cache contents:" + ServerConstants.EOL +
      super.toVerboseString());

    Backend b = DirectoryServer.getBackend(DN.decode("o=test"));

    for(int i = 0; i < super.NUMTESTENTRIES; i++ ) {
      super.cache.putEntry(super.testEntriesList.get(i), b, i);
    }
View Full Code Here

  {
    assertNull(super.toVerboseString(),
      "Expected empty cache.  " + "Cache contents:" + ServerConstants.EOL +
      super.toVerboseString());

    Backend b = DirectoryServer.getBackend(DN.decode("o=test"));

    for(int i = 0; i < super.NUMTESTENTRIES; i++ ) {
      super.cache.putEntry(super.testEntriesList.get(i), b, i);
    }
View Full Code Here

   */
  private WorkflowImpl createWorkflow(String baseDN, String backendID)
      throws Exception
  {
    // Get the backend
    Backend backend = DirectoryServer.getBackend(backendID);
    assertNotNull(backend);
   
    // Create the workflow element that wraps the local backend
    String workflowElementID = baseDN + "#" + backendID;
    LocalBackendWorkflowElement workflowElement =
View Full Code Here

        "--type", "memory",
        "--set", "base-dn:" + baseDN,
        "--set", "writability-mode:enabled",
        "--set", "enabled:true");
   
    Backend backend = DirectoryServer.getBackend(backendID);
    if (createBaseEntry)
    {
      Entry e = createEntry(DN.decode(baseDN));
      backend.addEntry(e, null);
    }
    return backend;
  }
View Full Code Here

      logError(message);
      return 1;
    }

    // Get information about the backends defined in the server.
    Backend backend = null;
    DN[]          baseDNArray;

    ArrayList<Backend>     backendList = new ArrayList<Backend>();
    ArrayList<BackendCfg>  entryList   = new ArrayList<BackendCfg>();
    ArrayList<List<DN>> dnList = new ArrayList<List<DN>>();
    BackendToolUtils.getBackends(backendList, entryList, dnList);

    int numBackends = backendList.size();
    for (int i=0; i < numBackends; i++)
    {
      Backend     b       = backendList.get(i);
      List<DN>    baseDNs = dnList.get(i);

      for (DN baseDN : baseDNs)
      {
        if (baseDN.equals(rebuildBaseDN))
View Full Code Here

    }

    AttributeType t = configuration.getFingerprintAttribute();
    for (DN baseDN : cfgBaseDNs)
    {
      Backend b = DirectoryServer.getBackend(baseDN);
      if ((b != null) && (! b.isIndexed(t, IndexType.EQUALITY)))
      {
        Message message = WARN_SATUACM_ATTR_UNINDEXED.get(
            configuration.dn().toString(),
            t.getNameOrOID(), b.getBackendID());
        ErrorLogger.logError(message);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.nasutekds.server.api.Backend

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.