}
catch ( LdapInvalidDnException lide )
{
String message = "Cannot set the Dn " + jdbmPartitionBean.getPartitionSuffix() + ", " + lide.getMessage();
LOG.error( message );
throw new ConfigurationException( message );
}
jdbmPartition.setSyncOnWrite( jdbmPartitionBean.isPartitionSyncOnWrite() );
jdbmPartition.setIndexedAttributes( createJdbmIndexes( jdbmPartition, jdbmPartitionBean.getIndexes(),
directoryService ) );
String contextEntry = jdbmPartitionBean.getContextEntry();
if ( contextEntry != null )
{
try
{
// Replace '\n' to real LF
String entryStr = contextEntry.replaceAll( "\\\\n", "\n" );
LdifReader ldifReader = new LdifReader();
List<LdifEntry> entries = ldifReader.parseLdif( entryStr );
if ( ( entries != null ) && ( entries.size() > 0 ) )
{
LdifEntry entry = entries.get( 0 );
jdbmPartition.setContextEntry( entry.getEntry() );
}
try
{
ldifReader.close();;
}
catch (IOException ioe )
{
LOG.error( "Cannot close the ldif reader" );
}
}
catch ( LdapLdifException lle )
{
String message = "Cannot parse the context entry : " + contextEntry + ", " + lle.getMessage();
LOG.error( message );
throw new ConfigurationException( message );
}
}
return jdbmPartition;
}