ImportTask.java:
Code cleanup + AutoRefactor.

git-svn-id: https://svn.forgerock.org/opendj/branches/opendj3-server-dev@11529 41b1ffd8-f28e-4786-ab96-9950f0a78031
Do not specify the comparator and rely on ByteString natural ordering.

git-svn-id: https://svn.forgerock.org/opendj/branches/opendj3-server-dev@11530 41b1ffd8-f28e-4786-ab96-9950f0a78031
PersistItStorage.java:
Removed FIXME because now we know there is actually nothing to fix :)

git-svn-id: https://svn.forgerock.org/opendj/branches/opendj3-server-dev@11531 41b1ffd8-f28e-4786-ab96-9950f0a78031
OPENDJ-1690 CR-5724 Fix file-based changelog purging

- Log file rotation for CN Index DB is based on both size and time
- Time interval before log file rotation is a fraction of replication purge delay
- Last log file rotation time for CN index DB is stored in a file

git-svn-id: https://svn.forgerock.org/opendj/branches/opendj3-server-dev@11532 41b1ffd8-f28e-4786-ab96-9950f0a78031
BackendConfigManager.java:
In applyConfiguration*(), replaced the triplet (resultCode, adminActionRequired, messages) with a single ConfigChangeResult object.

git-svn-id: https://svn.forgerock.org/opendj/branches/opendj3-server-dev@11533 41b1ffd8-f28e-4786-ab96-9950f0a78031
OPENDJ-1680 Set file-based changelog as default

The property replication-db-implementation is now writable
 and set as an 'advanced' property 

git-svn-id: https://svn.forgerock.org/opendj/branches/opendj3-server-dev@11534 41b1ffd8-f28e-4786-ab96-9950f0a78031
OPENDJ-1713: Persistit: dsconfig configuration properties have no effect

Hook configuration parameters into Persistit so that it is possible to configure the cache utilization and commit policy. It is a bit brittle, but seems to work on my laptop.

The commit policy config may need adjusting: JE provided three settings, effectively NONE, FLUSH, and FSYNC. Persistit has only two settings: FSYNC and non-FSYNC. It's unclear at this stage what the non-FSYNC mode is, i.e. whether it is flushing or not. I've adjusted the default commit policy to be SOFT otherwise full FSYNC is horribly slow.


git-svn-id: https://svn.forgerock.org/opendj/branches/opendj3-server-dev@11535 41b1ffd8-f28e-4786-ab96-9950f0a78031
Code cleanup

ConfigFileHandler.java:
Extracted methods getMatchedDN(), getMatchedDNForDescendantOfConfig(), aggregate() and throwIfUnsuccessful().

git-svn-id: https://svn.forgerock.org/opendj/branches/opendj3-server-dev@11536 41b1ffd8-f28e-4786-ab96-9950f0a78031
OPENDJ-1706 Persistit: online import fails with NPE

Code review: Matthew Swift


Problem happened when disabling the backend before online import.
Before applying the change, the config backend was iterating over the list of listeners for this configuration.
It is important to note that the list was a CopyOnWriteArrayList, and we used its iterator.
When disabling the backend, the first listener is the backend itself. This ends up calling pluggable.BackendImpl.finalizeBackend() which calls RootContainer.close(), EntryContainer.close(), AttributeIndex.close(), etc.
The net effect is that the RootContainer, EntryContainer, and AttributeIndex deregister themselves as change listeners of that config.
In the end, before the first iteration (on the backend), there are 9 config change listeners to notify. After the first loop iteration, there is only one config change listener remaining on the list of listeners: it is actually the backend we just iterated over!
However, remember the loop is performed on the CopyOnWriteArrayList iterator, which was initilized when the list had 9 elements. So it keeps notifying listeners which are no longer interested in the change.
The code then end up trying to update the indexes, by opening a transaction on the database. Problem is that the database has been closed by the call to pluggable.BackendImpl.finalizeBackend() => and BOOM! NullPointerException!

The fix consists in verifying that each listener to be notified is still interested in the config change; i.e. did it deregister itself from listening?


ConfigFileHandler.java:
In addEntry(), replaceEntry(), deleteEntry(), always verify the listener is still interested in the config change before notifying it.


git-svn-id: https://svn.forgerock.org/opendj/branches/opendj3-server-dev@11537 41b1ffd8-f28e-4786-ab96-9950f0a78031