final OidGenerator oidGenerator = new OidGenerator(createIdentifierGenerator(db));
final Map<String, DataEncryption> availableDataEncryption = new HashMap<String, DataEncryption>();
try {
final String[] encryptionClasses = getConfiguration().getList(NAKEDOBJECTS_ENCRYPTION_CLASSES);
DataEncryption writeWithEncryption = null;
boolean encryptionSpecified = false;
for (final String fullyQualifiedClass : encryptionClasses) {
LOG.info(" adding encryption " + fullyQualifiedClass);
final DataEncryption encryption = (DataEncryption) InstanceUtil.createInstance(fullyQualifiedClass);
encryption.init(configuration);
availableDataEncryption.put(encryption.getType(), encryption);
if (!encryptionSpecified) {
writeWithEncryption = encryption;
}
encryptionSpecified = true;
}
if (!encryptionSpecified) {
LOG.warn("No encryption specified");
final DataEncryption encryption = new DataEncryptionNone();
availableDataEncryption.put(encryption.getType(), encryption);
writeWithEncryption = encryption;
}
objectStore = new NoSqlObjectStore(db, oidGenerator, versionCreator, writeWithEncryption, availableDataEncryption);
} catch (final IllegalArgumentException e) {
throw new IsisException(e);