Examples of LDIFImportConfig


Examples of org.nasutekds.server.types.LDIFImportConfig

     */
    public LDIFReader getLDIFReader() throws Exception {
      writer.close();

      ByteArrayInputStream istream = new ByteArrayInputStream(stream.toByteArray());
      LDIFImportConfig config = new LDIFImportConfig(istream);
      return new LDIFReader(config);
    }
View Full Code Here

Examples of org.nasutekds.server.types.LDIFImportConfig

                                      "objectClass: organization",
                                      "o: test");

    ByteArrayInputStream bais =
         new ByteArrayInputStream(ldifString.getBytes("UTF-8"));
    LDIFImportConfig importConfig = new LDIFImportConfig(bais);

    DN dn = DN.decode("cn=Entry UUID,cn=plugins,cn=config");
    EntryUUIDPlugin plugin =
         (EntryUUIDPlugin)
         DirectoryServer.getPluginConfigManager().getRegisteredPlugin(dn);
View Full Code Here

Examples of org.nasutekds.server.types.LDIFImportConfig

                                      "o: test",
                                      "entryUUID: " + uuid);

    ByteArrayInputStream bais =
         new ByteArrayInputStream(ldifString.getBytes("UTF-8"));
    LDIFImportConfig importConfig = new LDIFImportConfig(bais);

    DN dn = DN.decode("cn=Entry UUID,cn=plugins,cn=config");
    EntryUUIDPlugin plugin =
         (EntryUUIDPlugin)
         DirectoryServer.getPluginConfigManager().getRegisteredPlugin(dn);
View Full Code Here

Examples of org.nasutekds.server.types.LDIFImportConfig

      new LDIFExportConfig(tempFile.getAbsolutePath(),
                           ExistingFileBehavior.OVERWRITE);

    schemaBackend.exportLDIF(exportConfig);

    LDIFImportConfig importConfig =
         new LDIFImportConfig(tempFile.getAbsolutePath());

    schemaBackend.importLDIF(importConfig);
  }
View Full Code Here

Examples of org.nasutekds.server.types.LDIFImportConfig

      // Launch import of the Ldif file on the memory test backend
      // Note: we do not use a task here as import task does not work on memory
      // backend: it disables then re-enables backend which leads to backend
      // object instance lost and this is not accepttable for a backend with
      // non persistent data
      LDIFImportConfig importConfig =
        new LDIFImportConfig(ldifFile.getAbsolutePath());

      MemoryBackend memoryBackend =
        (MemoryBackend) DirectoryServer.getBackend(TEST_BACKEND_ID);
      memoryBackend.importLDIF(importConfig);
View Full Code Here

Examples of org.nasutekds.server.types.LDIFImportConfig

   * @throws IOException if there is an error creating the internal stream.
   */
  protected Entry getEntry() throws LDIFException, IOException
  {
    Entry entry;
    LDIFImportConfig ldifImportConfig = null;
    try
    {
      String ldif = getLDIF();

      if (ldif.trim().length() == 0)
      {
        throw new LDIFException(ERR_LDIF_REPRESENTATION_REQUIRED.get());
      }

      ldifImportConfig = new LDIFImportConfig(new StringReader(ldif));
      LDIFReader reader = new LDIFReader(ldifImportConfig);
      entry = reader.readEntry(checkSchema());
      if (entry == null)
      {
        throw new LDIFException(ERR_LDIF_REPRESENTATION_REQUIRED.get());
      }
      else
      {
        if (entry.getObjectClasses().size() == 0)
        {
          throw new LDIFException(ERR_OBJECTCLASS_FOR_ENTRY_REQUIRED.get());
        }
      }
    }
    finally
    {
      if (ldifImportConfig != null)
      {
        ldifImportConfig.close();
      }
    }
    return entry;
  }
View Full Code Here

Examples of org.nasutekds.server.types.LDIFImportConfig

          "ds-cfg-writability-mode: enabled",
          "ds-cfg-java-class: " +
            "org.nasutekds.server.replication.server.ReplicationBackend",
          "ds-cfg-backend-id: " + backendId);

      LDIFImportConfig ldifImportConfig = new LDIFImportConfig(
          new StringReader(ldif));
      LDIFReader reader = new LDIFReader(ldifImportConfig);
      Entry backendConfigEntry = reader.readEntry();
      if (!DirectoryServer.getConfigHandler().entryExists(backendConfigEntryDN))
      {
        // Add the replication backend
        DirectoryServer.getConfigHandler().addEntry(backendConfigEntry, null);
      }
      ldifImportConfig.close();
    }
    catch(Exception e)
    {
      MessageBuilder mb = new MessageBuilder();
      mb.append(e.getLocalizedMessage());
View Full Code Here

Examples of org.nasutekds.server.types.LDIFImportConfig

      ByteArrayInputStream istream = new
      ByteArrayInputStream(stream.toByteArray());
      String ldif = stream.toString("UTF-8");
      ldif = ldif.replace("\n-\n", "\n");
      istream = new ByteArrayInputStream(ldif.getBytes());
      LDIFImportConfig config = new LDIFImportConfig(istream);
      return new LDIFReader(config);
    }
View Full Code Here

Examples of org.nasutekds.server.types.LDIFImportConfig

      f = new File(schemaDirPath, schemaFile);
    }
    LDIFReader reader;
    try
    {
      reader = new LDIFReader(new LDIFImportConfig(f.getAbsolutePath()));
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
View Full Code Here

Examples of org.nasutekds.server.types.LDIFImportConfig

  {
    boolean schemaDefined = false;
    LDIFReader reader = null;
    try
    {
      reader = new LDIFReader(new LDIFImportConfig(schemaFile));
      Entry entry = reader.readEntry();
      if (entry != null)
      {
        schemaDefined = true;
      }
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.