final private static boolean DIAGNOSTICS_ENABLED = false;
final private static boolean DEBUG_OUTPUT_ENABLED = false;
final private static int DEBUG_OUTPUT_LEVEL = 4;
public EmbeddedConfiguration createDefaultConfiguration() {
EmbeddedConfiguration configuration = Db4oEmbedded.newConfiguration();
configuration.common().reflectWith(new JdkReflector(this.getClass().getClassLoader()));
configuration.common().add(new TransparentPersistenceSupport());
configuration.common().objectClass(RequestLogRecord.class).objectField("requestId").indexed(true);
configuration.common().objectClass(RequestLogRecord.class).objectField("requestOrigin").indexed(true);
configuration.common().objectClass(RequestLogRecord.class).objectField("hostname").indexed(true);
configuration.common().objectClass(RequestLogRecord.class).objectField("requestMethod").indexed(true);
configuration.common().objectClass(RequestLogRecord.class).objectField("responseCode").indexed(true);
configuration.common().objectClass(RequestLogRecord.class).objectField("responseLength").indexed(true);
configuration.common().objectClass(RequestLogRecord.class).objectField("tagList").indexed(true);
configuration.common().objectClass(ScanAlert.class).objectField("key").indexed(true);
configuration.common().objectClass(ScanAlert.class).objectField("resource").indexed(true);
configuration.common().objectClass(ScanAlert.class).objectField("requestId").indexed(true);
configuration.common().objectClass(Tag.class).objectField("name").indexed(true);
configuration.common().weakReferences(false);
if(DIAGNOSTICS_ENABLED) {
configuration.common().diagnostic().addListener(new DiagnosticToConsole());
}
if(DEBUG_OUTPUT_ENABLED) {
configuration.common().messageLevel(DEBUG_OUTPUT_LEVEL);
}
if(LAZY_EVALUATION) {
configuration.common().queries().evaluationMode(QueryEvaluationMode.LAZY);
}
return configuration;
}