use of io.jans.orm.couchbase.operation.impl.CouchbaseOperationServiceImpl in project jans by JanssenProject.
the class CouchbaseEntryManagerFactory method createEntryManager.
@Override
public CouchbaseEntryManager createEntryManager(Properties conf) {
Properties entryManagerConf = PropertiesHelper.filterProperties(conf, "#");
// Allow proper initialization
if (this.couchbaseConnectionProperties == null) {
this.couchbaseConnectionProperties = entryManagerConf;
}
init();
if (!isInitialized()) {
throw new ConfigurationException("Failed to create Couchbase environment!");
}
CouchbaseConnectionProvider connectionProvider = new CouchbaseConnectionProvider(entryManagerConf, couchbaseEnvironment);
connectionProvider.create();
if (!connectionProvider.isCreated()) {
throw new ConfigurationException(String.format("Failed to create Couchbase connection pool! Result code: '%s'", connectionProvider.getCreationResultCode()));
}
LOG.debug("Created connectionProvider '{}' with code '{}'", connectionProvider, connectionProvider.getCreationResultCode());
CouchbaseEntryManager couchbaseEntryManager = new CouchbaseEntryManager(new CouchbaseOperationServiceImpl(entryManagerConf, connectionProvider));
LOG.info("Created CouchbaseEntryManager: {}", couchbaseEntryManager.getOperationService());
return couchbaseEntryManager;
}
Aggregations