use of com.emc.storageos.coordinator.common.impl.ConfigurationImpl in project coprhd-controller by CoprHD.
the class CoordinatorClientImpl method setTargetInfo.
/**
* Update target info(for specific site) to ZK
*
* @param info
* @throws CoordinatorException
*/
public void setTargetInfo(String siteId, final CoordinatorSerializable info) throws CoordinatorException {
final CoordinatorClassInfo coordinatorInfo = info.getCoordinatorClassInfo();
String id = coordinatorInfo.id;
String kind = coordinatorInfo.kind;
ConfigurationImpl cfg = new ConfigurationImpl();
cfg.setId(id);
cfg.setKind(kind);
cfg.setConfig(TARGET_INFO, info.encodeAsString());
persistServiceConfiguration(siteId, cfg);
if (siteId == null) {
log.info("Target info set: {} for local site", info);
} else {
log.info("Target info set: {} for site {}", info, siteId);
}
}
use of com.emc.storageos.coordinator.common.impl.ConfigurationImpl in project coprhd-controller by CoprHD.
the class VdcConfigHelper method setGeoEncryptionKey.
public void setGeoEncryptionKey(String geoEncryptionKey) {
ConfigurationImpl config = new ConfigurationImpl();
config.setKind(ENCRYPTION_CONFIG_KIND);
config.setId(ENCRYPTION_CONFIG_ID);
config.setConfig(ENCRYPTION_CONFIG_KIND, geoEncryptionKey);
coordinator.persistServiceConfiguration(config);
}
use of com.emc.storageos.coordinator.common.impl.ConfigurationImpl in project coprhd-controller by CoprHD.
the class BackupOps method persistBackupOperationStatus.
/**
* Records backup operation status to ZK
*/
public void persistBackupOperationStatus(BackupOperationStatus backupOperationStatus) {
if (backupOperationStatus == null) {
log.warn("Backup operation status is empty, no need persisting");
return;
}
ConfigurationImpl config = new ConfigurationImpl();
config.setKind(Constants.BACKUP_OPERATION_STATUS);
config.setId(Constants.GLOBAL_ID);
log.info("Persisting backup operation status to zk");
setOperationStatus(config, BackupConstants.LAST_SUCCESSFUL_CREATION, backupOperationStatus.getLastSuccessfulCreation());
setOperationStatus(config, BackupConstants.LAST_MANUAL_CREATION, backupOperationStatus.getLastManualCreation());
setOperationStatus(config, BackupConstants.LAST_SCHEDULED_CREATION, backupOperationStatus.getLastScheduledCreation());
setOperationStatus(config, BackupConstants.LAST_UPLOAD, backupOperationStatus.getLastUpload());
coordinatorClient.persistServiceConfiguration(config);
log.info("Persist backup operation status to zk successfully: {}", backupOperationStatus);
}
use of com.emc.storageos.coordinator.common.impl.ConfigurationImpl in project coprhd-controller by CoprHD.
the class BackupOps method persistBackupRestoreStatus.
public void persistBackupRestoreStatus(BackupRestoreStatus status, boolean isLocal, boolean doLog) {
if (doLog) {
log.info("Persist backup restore status {}", status);
}
Map<String, String> allItems = status.toMap();
ConfigurationImpl config = new ConfigurationImpl();
String backupName = status.getBackupName();
config.setKind(getBackupConfigKind(isLocal));
config.setId(backupName);
for (Map.Entry<String, String> entry : allItems.entrySet()) {
config.setConfig(entry.getKey(), entry.getValue());
}
coordinatorClient.persistServiceConfiguration(coordinatorClient.getSiteId(), config);
}
use of com.emc.storageos.coordinator.common.impl.ConfigurationImpl in project coprhd-controller by CoprHD.
the class LoggingMBean method persistLogLevel.
private void persistLogLevel(String level, int expirInMin, String scope) {
ConfigurationImpl config = new ConfigurationImpl();
config.setKind(_logName);
config.setId(_hostId);
long expiration = System.currentTimeMillis() + expirInMin * 60 * 1000;
String configStr = level + LOG_LEVEL_DELIMITER + String.valueOf(expiration) + LOG_LEVEL_DELIMITER + scope;
config.setConfig(LOG_LEVEL_CONFIG, configStr);
try {
_log.info("Persisting log level configuration");
_coordinator.persistServiceConfiguration(config);
_log.info("Persist log level configuration succeed");
} catch (CoordinatorException e) {
_log.error("Exception persisting log level config {}:", configStr, e);
return;
}
}
Aggregations