Details
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.