use of com.emc.storageos.db.client.impl.DbClientContext in project coprhd-controller by CoprHD.
the class ExportUtilsTests method setupTest.
@Before
public void setupTest() {
DbClientImplUnitTester dbClient = new DbClientImplUnitTester();
dbClient.setCoordinatorClient(_coordinator);
dbClient.setDbVersionInfo(sourceVersion);
dbClient.setBypassMigrationLock(true);
_encryptionProvider.setCoordinator(_coordinator);
dbClient.setEncryptionProvider(_encryptionProvider);
DbClientContext localCtx = new DbClientContext();
localCtx.setClusterName("Test");
localCtx.setKeyspaceName("Test");
dbClient.setLocalContext(localCtx);
VdcUtil.setDbClient(dbClient);
dbClient.setBypassMigrationLock(false);
dbClient.start();
_dbClient = dbClient;
}
use of com.emc.storageos.db.client.impl.DbClientContext in project coprhd-controller by CoprHD.
the class InternalDbClient method getKeyspace.
@Override
public <T extends DataObject> Keyspace getKeyspace(Class<T> clazz) {
DbClientContext ctx = null;
if (localContext == null || geoContext == null) {
throw new IllegalStateException();
}
ctx = KeyspaceUtil.isGlobal(clazz) ? geoContext : localContext;
if (!ctx.isInitDone()) {
String serviceName = ctx.equals(geoContext) ? Constants.GEODBSVC_NAME : Constants.DBSVC_NAME;
log.info("Initialize db context {}", serviceName);
setupContext(ctx, serviceName);
}
return ctx.getKeyspace();
}
Aggregations