use of com.emc.storageos.model.property.PropertyMetadata in project coprhd-controller by CoprHD.
the class CreateISO method formatProperties.
private static String formatProperties(Map<String, String> properties) {
StringBuffer props = new StringBuffer();
PropertyMetadata metadata;
String equal = "=";
String newLine = "\n";
// Getting properties metadata
Map<String, PropertyMetadata> metadataMap = PropertiesMetadata.getGlobalMetadata();
if (metadataMap == null) {
_log.warn("Properties metadata not found");
throw APIException.internalServerErrors.targetIsNullOrEmpty("Properties metadata");
}
// Looping through each property, checking if it is visible to all nodes
for (Map.Entry<String, String> entry : properties.entrySet()) {
// Check if this property is visible to all nodes
metadata = metadataMap.get(entry.getKey());
if (metadata != null && !metadata.getControlNodeOnly()) {
props.append(entry.getKey());
props.append(equal);
props.append(entry.getValue());
props.append(newLine);
} else {
_log.info("Property metadata not found or control only: " + entry.getKey());
}
}
return props.toString();
}
use of com.emc.storageos.model.property.PropertyMetadata 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.model.property.PropertyMetadata in project coprhd-controller by CoprHD.
the class PasswordServiceTest method setPropMetaData.
public PropertyMetadata setPropMetaData(String label, String description, String type, int maxLen, String tag, Boolean advanced, Boolean userMutable, Boolean userConfigurable, Boolean reconfigRequired, Boolean rebootRequired, String value, Boolean controlNodeOnly) {
PropertyMetadata metaData = new PropertyMetadata();
metaData.setLabel(label);
metaData.setDescription(description);
metaData.setType(type);
metaData.setMaxLen(maxLen);
metaData.setTag(tag);
metaData.setAdvanced(advanced);
metaData.setUserMutable(userMutable);
metaData.setUserConfigurable(userConfigurable);
metaData.setReconfigRequired(reconfigRequired);
metaData.setRebootRequired(rebootRequired);
metaData.setValue(value);
metaData.setControlNodeOnly(controlNodeOnly);
return metaData;
}
use of com.emc.storageos.model.property.PropertyMetadata in project coprhd-controller by CoprHD.
the class LocalPasswordHandlerTestBase method setPropsMetaData.
public void setPropsMetaData() {
PropertyMetadata proxyuser_metadata = setPropMetaData("Encrypted password for the 'proxyuser' account", "Encrypted (SHA-512) password for the local 'proxyuser' account.", "encryptedstring", 255, "Security", true, true, false, true, false, "", true);
PropertyMetadata sysmonitor_metadata = setPropMetaData("Encrypted password for the 'sysmonitor' account", "Encrypted password for the 'sysmonitor' account.", "string", 255, "Security", true, true, false, true, false, "$6$BIu9aQ6$wBnn9Tn.CUuuoi/JZe.oAOmUDIVCqHpXeem7ZHO5R7dPg2hul8tNCBzwumKrFw8A0qm.LH8YvMJUaN2AL1JVc0", true);
PropertyMetadata root_metadata = setPropMetaData("Encrypted password for the 'root' account", "Encrypted (SHA-512) password for the local 'root' account.", "string", 255, "Security", true, true, false, true, false, "$6$eBIu9aQ6$wBnn9Tn.CUuuoi/JZe.oAOmUDIVCqHpXeem7ZHO5R7dPg2hul8tNCBzwumKrFw8A0qm.LH8YvMJUaN2AL1JVc0", false);
PropertyMetadata svcuser_metadata = setPropMetaData("Encrypted password for the 'svcuser' account", "Encrypted (SHA-512) password for the local 'svcuser' account.", "string", 255, "Security", true, true, false, true, false, "$6$eBIu9aQ6$wBnn9Tn.CUuuoi/JZe.oAOmUDIVCqHpXeem7ZHO5R7dPg2hul8tNCBzwumKrFw8A0qm.LH8YvMJUaN2AL1JVc0", false);
_propsMetadata.put("system_proxyuser_encpassword", proxyuser_metadata);
_propsMetadata.put("system_sysmonitor_encpassword", sysmonitor_metadata);
_propsMetadata.put("system_root_encpassword", root_metadata);
_propsMetadata.put("system_svcuser_encpassword", svcuser_metadata);
}
use of com.emc.storageos.model.property.PropertyMetadata in project coprhd-controller by CoprHD.
the class CreateISOTest method setPropMetaData.
public PropertyMetadata setPropMetaData(String label, String description, String type, Integer maxLen, String tag, Boolean advanced, Boolean userMutable, Boolean userConfigurable, Boolean reconfigRequired, Boolean rebootRequired, String value, Boolean controlNodeOnly) {
PropertyMetadata metaData = new PropertyMetadata();
metaData.setLabel(label);
metaData.setDescription(description);
metaData.setType(type);
metaData.setMaxLen(maxLen);
metaData.setTag(tag);
metaData.setAdvanced(advanced);
metaData.setUserMutable(userMutable);
metaData.setUserConfigurable(userConfigurable);
metaData.setReconfigRequired(reconfigRequired);
metaData.setRebootRequired(rebootRequired);
metaData.setValue(value);
metaData.setControlNodeOnly(controlNodeOnly);
return metaData;
}
Aggregations