use of com.emc.storageos.coordinator.common.impl.ConfigurationImpl in project coprhd-controller by CoprHD.
the class EncryptionProviderImpl method persistKey.
/**
* Persists key to coordinator
*
* @throws Exception
*/
private void persistKey(SecretKey key) throws Exception {
ConfigurationImpl config = new ConfigurationImpl();
config.setKind(CONFIG_KIND);
config.setId(_encryptId);
config.setConfig(CONFIG_KIND, new String(Base64.encodeBase64(key.getEncoded()), UTF_8));
_coordinator.persistServiceConfiguration(config);
_key = key;
}
use of com.emc.storageos.coordinator.common.impl.ConfigurationImpl 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.coordinator.common.impl.ConfigurationImpl in project coprhd-controller by CoprHD.
the class SetupUtils method markSetupComplete.
public static void markSetupComplete() {
if (complete) {
return;
}
if (StorageOsPlugin.isEnabled()) {
CoordinatorClient coordinatorClient = StorageOsPlugin.getInstance().getCoordinatorClient();
ConfigurationImpl config = new ConfigurationImpl();
config.setKind(CONFIG_KIND);
config.setId(CONFIG_ID);
config.setConfig(COMPLETE, Boolean.TRUE.toString());
coordinatorClient.persistServiceConfiguration(config);
complete = true;
} else if (Play.mode.isDev()) {
complete = true;
}
}
use of com.emc.storageos.coordinator.common.impl.ConfigurationImpl in project coprhd-controller by CoprHD.
the class DbOfflineEventInfo method toConfiguration.
public Configuration toConfiguration(String configId) {
ConfigurationImpl config = new ConfigurationImpl();
config.setKind(Constants.DB_DOWNTIME_TRACKER_CONFIG);
config.setId(configId);
log.info("Set DB offline event info to ZK config: {}", eventInfo);
for (Map.Entry<String, Long> entry : eventInfo.entrySet()) {
config.setConfig(entry.getKey(), (entry.getValue() == null) ? null : String.valueOf(entry.getValue()));
}
return config;
}
use of com.emc.storageos.coordinator.common.impl.ConfigurationImpl in project coprhd-controller by CoprHD.
the class Site method toConfiguration.
public Configuration toConfiguration() {
ConfigurationImpl config = new ConfigurationImpl();
config.setKind(String.format("%s/%s", CONFIG_KIND, vdcShortId));
config.setId(uuid);
if (name != null) {
config.setConfig(KEY_NAME, name);
}
if (description != null) {
config.setConfig(KEY_DESCRIPTION, description);
}
if (vip != null) {
config.setConfig(KEY_VIP, vip);
}
if (vip6 != null) {
config.setConfig(KEY_VIP6, vip6);
}
if (siteShortId != null) {
config.setConfig(KEY_SITE_SHORTID, this.siteShortId);
}
config.setConfig(KEY_CREATIONTIME, String.valueOf(creationTime));
if (lastStateUpdateTime != 0L) {
config.setConfig(KEY_LASTSTATEUPDATETIME, String.valueOf(lastStateUpdateTime));
}
if (lastLostQuorumTime != 0L) {
config.setConfig(KEY_LAST_LOST_QUORUM_TIME, String.valueOf(lastLostQuorumTime));
}
if (lastState != null) {
config.setConfig(KEY_LASTSTATE, String.valueOf(lastState));
}
if (state != null) {
config.setConfig(KEY_SITE_STATE, String.valueOf(state));
}
config.setConfig(KEY_NODECOUNT, String.valueOf(nodeCount));
treeMapSorter.clear();
treeMapSorter.putAll(this.hostIPv4AddressMap);
config.setConfig(KEY_NODESADDR, StringUtil.join(treeMapSorter.values(), ","));
treeMapSorter.clear();
treeMapSorter.putAll(this.hostIPv6AddressMap);
config.setConfig(KEY_NODESADDR6, StringUtil.join(treeMapSorter.values(), ","));
return config;
}
Aggregations