use of com.emc.storageos.db.client.model.uimodels.InitialSetup in project coprhd-controller by CoprHD.
the class InitialSetupDeprecationCallback method process.
/**
* If the InitialSetup CF singleton exists and has the 'complete' attribute set,
* set the corresponding configuration fields in ZK, then remove the CF row
*/
@Override
public void process() throws MigrationCallbackException {
DbClient dbClient = this.getDbClient();
InitialSetup initialSetup = dbClient.queryObject(InitialSetup.class, InitialSetup.SINGLETON_ID);
if ((initialSetup != null) && (BooleanUtils.isTrue(initialSetup.getComplete()))) {
log.info("Migrating InitialSetup CF into Coordinator");
ConfigurationImpl config = new ConfigurationImpl();
config.setKind(CONFIG_KIND);
config.setId(CONFIG_ID);
config.setConfig(COMPLETE, Boolean.TRUE.toString());
coordinatorClient.persistServiceConfiguration(config);
dbClient.removeObject(initialSetup);
}
}
use of com.emc.storageos.db.client.model.uimodels.InitialSetup in project coprhd-controller by CoprHD.
the class InitialSetupMigrationTest method prepareData.
@Override
protected void prepareData() throws Exception {
InitialSetup setup = new InitialSetup();
setup.setId(InitialSetup.SINGLETON_ID);
setup.setComplete(true);
_dbClient.createObject(setup);
setup = _dbClient.queryObject(InitialSetup.class, InitialSetup.SINGLETON_ID);
Assert.assertNotNull(setup);
}
use of com.emc.storageos.db.client.model.uimodels.InitialSetup in project coprhd-controller by CoprHD.
the class InitialSetupMigrationTest method verifyResults.
@Override
protected void verifyResults() throws Exception {
InitialSetup setup = _dbClient.queryObject(InitialSetup.class, InitialSetup.SINGLETON_ID);
Assert.assertTrue("the InitialSetup singleton should be gone after migration", ((setup == null) || (setup.getInactive() == Boolean.TRUE)));
Configuration config = getCoordinator().queryConfiguration(InitialSetup.CONFIG_KIND, InitialSetup.CONFIG_ID);
Assert.assertNotNull("coordinator config setup object should not be null", config);
String complete = config.getConfig(InitialSetup.COMPLETE);
Assert.assertTrue("coordinator config setup object should be marked comoplete", complete != null && complete.equals(Boolean.TRUE.toString()));
}
Aggregations