use of com.emc.storageos.coordinator.client.model.PropertyInfoExt in project coprhd-controller by CoprHD.
the class SecretsManager method syncLocalKey.
private void syncLocalKey() throws Exception {
PropertyInfoExt localSslInfo = localRepository.getSslPropertyInfo();
localKey = localSslInfo.getProperty(NGINX_PRIV_KEY);
localKeyHash = localSslInfo.getProperty(NGINX_KEY_HASH);
}
use of com.emc.storageos.coordinator.client.model.PropertyInfoExt in project coprhd-controller by CoprHD.
the class TokenMaxLifeValuesHolder method loadParameterFromZK.
/**
* load parameter from system properties of ZooKeeper.
* if the properties do not exist, or exception when loading, use default values.
*/
public void loadParameterFromZK() {
try {
_log.info("load token life time and idle time from zk");
PropertyInfoExt params = _coordinator.getTargetInfo(PropertyInfoExt.class);
_maxTokenLifeTimeInMins = NumberUtils.toInt(params.getProperty(Constants.TOKEN_LIFE_TIME), Constants.DEFAULT_TOKEN_LIFE_TIME);
_maxTokenIdleTimeInMins = NumberUtils.toInt(params.getProperty(Constants.TOKEN_IDLE_TIME), Constants.DEFAULT_TOKEN_IDLE_TIME);
} catch (Exception e) {
_log.warn("load parameter from ZK error, use default values.");
_maxTokenLifeTimeInMins = Constants.DEFAULT_TOKEN_LIFE_TIME;
_maxTokenIdleTimeInMins = Constants.DEFAULT_TOKEN_IDLE_TIME;
}
}
use of com.emc.storageos.coordinator.client.model.PropertyInfoExt in project coprhd-controller by CoprHD.
the class PropertyManager method updateProperties.
/**
* Update properties
*
* @param svcId node service id
* @throws Exception
*/
private void updateProperties(String svcId) throws Exception {
PropertyInfoExt diffProperties = new PropertyInfoExt(targetPropInfo.getDiffProperties(localTargetPropInfo));
PropertyInfoExt override_properties = new PropertyInfoExt(localRepository.getOverrideProperties().getAllProperties());
log.info("Step3a: Updating User Changed properties file: {}", override_properties);
PropertyInfoExt updatedUserChangedProps = combineProps(override_properties, diffProperties);
if (diffProperties.hasRebootProperty()) {
if (!getRebootLock(svcId)) {
retrySleep();
} else if (!isQuorumMaintained()) {
releaseRebootLock(svcId);
retrySleep();
} else {
log.info("Step3a: Reboot property found.");
localRepository.setOverrideProperties(updatedUserChangedProps);
log.info("Step3a: Updating properties: {}", updatedUserChangedProps);
reboot();
}
} else if (diffProperties.hasReconfigProperty() || !diffProperties.getNotifierTags().isEmpty()) {
log.info("Step3a: Reconfig property found or notifiers specified.");
// CTRL-9860: don't update the local config version until everything is done.
String targetVersion = targetPropInfo.getProperty(PropertyInfoExt.CONFIG_VERSION);
updatedUserChangedProps.addProperty(PropertyInfoExt.CONFIG_VERSION, localConfigVersion);
localRepository.setOverrideProperties(updatedUserChangedProps);
log.info("Step3a: Updating properties without updating the config version: {}", updatedUserChangedProps);
if (diffProperties.hasReconfigAttributeWithoutNotifiers()) {
// this is the old-school "complete" reconfig that takes no notifiers as arguments.
// moving forward this will diminish
// i.e., all reconfigRequired properties will have notifier specified.
localRepository.reconfig();
} else if (diffProperties.hasReconfigProperty()) {
reconfigProperties(diffProperties);
}
// the notifier list can be empty, in which case nothing will be done.
notifyPropertyChanges(diffProperties);
// update the local config version to target version now
log.info("Step3a: Updating the config version to {}", targetVersion);
updatedUserChangedProps.addProperty(PropertyInfoExt.CONFIG_VERSION, targetVersion);
localRepository.setOverrideProperties(updatedUserChangedProps);
} else {
log.info("Step3a: No reboot property found.");
localRepository.setOverrideProperties(updatedUserChangedProps);
log.info("Step3a: Updating properties: {}", updatedUserChangedProps);
}
}
use of com.emc.storageos.coordinator.client.model.PropertyInfoExt in project coprhd-controller by CoprHD.
the class PropertyManager method getLocalTargetPropInfo.
/**
* Get local target property info
*
* For control node, properties that can be found in metadata are target properties
* For extra node, not only exist in metadata, but also ControlNodeOnly==false
*
* @param localPropInfo
* @return
*/
private PropertyInfoExt getLocalTargetPropInfo(final PropertyInfoExt localPropInfo) {
Map<String, PropertyMetadata> metadata = PropertiesMetadata.getGlobalMetadata();
PropertyInfoExt localTargetProps = new PropertyInfoExt();
for (Entry<String, String> entry : localPropInfo.getAllProperties().entrySet()) {
final String key = entry.getKey();
final String value = entry.getValue();
if (metadata.containsKey(key)) {
if (coordinator.isControlNode()) {
localTargetProps.addProperty(key, value);
} else {
if (!metadata.get(key).getControlNodeOnly()) {
localTargetProps.addProperty(key, value);
}
}
}
}
return localTargetProps;
}
use of com.emc.storageos.coordinator.client.model.PropertyInfoExt in project coprhd-controller by CoprHD.
the class VdcOpHandler method flushVdcConfigToLocal.
/**
* Flush vdc config to local disk /.volumes/boot/etc/vdcconfig.properties
* Note: this flush will not write VDC_CONFIG_VERSION to disk to make sure if there are some errors, VdcManager can enter retry loop
*/
protected void flushVdcConfigToLocal() {
PropertyInfoExt vdcProperty = new PropertyInfoExt(targetVdcPropInfo.getAllProperties());
vdcProperty.addProperty(VdcConfigUtil.VDC_CONFIG_VERSION, localVdcPropInfo.getProperty(VdcConfigUtil.VDC_CONFIG_VERSION));
localRepository.setVdcPropertyInfo(vdcProperty);
}
Aggregations