Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-1545

Ability to specify an import order for the LDIF files

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.5.7
    • 2.1.1
    • ldif
    • None
    • Linux OS, JBOSS AS 5.1.0.GA, Apache DS

    Description

      We ship a number of deployment packages with our product, of which some are optionally installed into the JBOSS AS container. Some of those packages that are installed wish to plug data into the directory, so we use the LDIF file import mechanism on directory startup to achieve that. Some of the files have dependencies on others, so we have incorporated a numbering convention into the LDIF file naming and up until now that has worked successfully. However, on the Linux platform we realised it was not working. Linux is giving the LDIF files to the directory startup neither in creation date/time order nor alphabetical order and thus the dependencies within the files collapse.

      I can quickly resolve the issue by simply sorting the files prior to their import.
      i.e. in org.apache.directory.server.configuration.ApacheDS#loadLdifs()

                  // sort the ldif files
                  Arrays.sort(ldifFiles, new Comparator<File>() {
                      @Override
                      public int compare(File o1, File o2) {
                          return o1.getName().compareTo(o2.getName());
                      }
                  });
      
                  // load all the ldif files and load each one that is loaded
                  . . .
      

      There are a number of solutions to this, and clearly it is not a problem of the directory server. However, given that the directory server supports an import directory and thus multiple LDIF files, I think it would be a useful enhancement to provide a mechanism to cater for dependencies within the files.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ejroberts Ed Roberts
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: