@Override
protected void importBackend(InputStream input) throws DirectoryException
{
LDIFImportConfig importConfig = null;
Backend backend = retrievesBackend(baseDn);
try
{
if (!backend.supportsLDIFImport())
{
Message message = ERR_INIT_IMPORT_NOT_SUPPORTED.get(
backend.getBackendID().toString());
if (ieContext.getException() == null)
ieContext.setException(new DirectoryException(ResultCode.OTHER,
message));
}
else
{
importConfig =
new LDIFImportConfig(input);
List<DN> includeBranches = new ArrayList<DN>();
includeBranches.add(this.baseDn);
importConfig.setIncludeBranches(includeBranches);
importConfig.setAppendToExistingData(false);
importConfig.setSkipDNValidation(true);
// Allow fractional replication ldif import plugin to be called
importConfig.setInvokeImportPlugins(true);
// Reset the follow import flag and message before starting the import
importErrorMessageId = -1;
followImport = true;
// TODO How to deal with rejected entries during the import
importConfig.writeRejectedEntries(
getFileForPath("logs" + File.separator +
"replInitRejectedEntries").getAbsolutePath(),
ExistingFileBehavior.OVERWRITE);
// Process import
preBackendImport(backend);
backend.importLDIF(importConfig);
stateSavingDisabled = false;
}
}
catch(Exception e)