Search in sources :

Example 1 with InitialSetup

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);
    }
}
Also used : DbClient(com.emc.storageos.db.client.DbClient) InitialSetup(com.emc.storageos.db.client.model.uimodels.InitialSetup) ConfigurationImpl(com.emc.storageos.coordinator.common.impl.ConfigurationImpl)

Example 2 with 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);
}
Also used : InitialSetup(com.emc.storageos.db.client.model.uimodels.InitialSetup)

Example 3 with InitialSetup

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()));
}
Also used : Configuration(com.emc.storageos.coordinator.common.Configuration) InitialSetup(com.emc.storageos.db.client.model.uimodels.InitialSetup)

Aggregations

InitialSetup (com.emc.storageos.db.client.model.uimodels.InitialSetup)3 Configuration (com.emc.storageos.coordinator.common.Configuration)1 ConfigurationImpl (com.emc.storageos.coordinator.common.impl.ConfigurationImpl)1 DbClient (com.emc.storageos.db.client.DbClient)1