use of com.emc.storageos.model.property.PropertyMetadata in project coprhd-controller by CoprHD.
the class DefaultUpdateHandler method isPropertyChanged.
/**
* check if the value of specified property get changed.
*
* @param oldProps
* @param newProps
* @param property
* @return
*/
public boolean isPropertyChanged(PropertyInfoRestRep oldProps, PropertyInfoRestRep newProps, String property) {
String oldValue = oldProps.getProperty(property);
String newValue = newProps.getProperty(property);
if (newValue == null) {
return false;
}
if (oldValue == null) {
Map<String, PropertyMetadata> metadata = PropertiesMetadata.getGlobalMetadata();
// no metadata, that is, this property is not defined
if (metadata == null) {
return false;
}
final PropertyMetadata propertyMetadata = metadata.get(property);
if (propertyMetadata != null) {
oldValue = propertyMetadata.getValue();
}
}
if (oldValue != null && oldValue.equals(newValue)) {
return false;
}
return true;
}
use of com.emc.storageos.model.property.PropertyMetadata in project coprhd-controller by CoprHD.
the class CreateISOTest method getPropsMetaData.
public Map<String, PropertyMetadata> getPropsMetaData() {
Map<String, PropertyMetadata> metadata = new TreeMap<String, PropertyMetadata>();
PropertyMetadata networkMetadata = setPropMetaData("server ip address", "ipaddress", "ipaddr", null, "Network", true, false, true, null, null, "", false);
PropertyMetadata controlNodeOnlyMetadata = setPropMetaData("server ip address", "ipaddress", "ipaddr", null, "Network", true, false, true, null, null, "", true);
PropertyMetadata iplistMetadata = setPropMetaData("server ip address", "ipaddress", "ipaddrlist", null, "Network", true, false, true, null, null, "", false);
metadata.put("network_1_ipaddr", networkMetadata);
metadata.put("network_2_ipaddr", networkMetadata);
metadata.put("network_3_ipaddr", networkMetadata);
metadata.put("network_dns_servers", iplistMetadata);
metadata.put("network_ntp_servers", iplistMetadata);
metadata.put("system_datanode_ipaddrs", iplistMetadata);
metadata.put("network_gateway", controlNodeOnlyMetadata);
metadata.put("system_upgrade_repo", controlNodeOnlyMetadata);
return metadata;
}
use of com.emc.storageos.model.property.PropertyMetadata in project coprhd-controller by CoprHD.
the class PropertyInfoExt method hasReconfigAttributeWithoutNotifiers.
public boolean hasReconfigAttributeWithoutNotifiers() {
Map<String, PropertyMetadata> metadata = PropertiesMetadata.getGlobalMetadata();
List<String> ret = new ArrayList<>();
if (getProperties() == null || metadata == null) {
// call the old-fashion reconfig() in this case
return true;
}
for (Map.Entry<String, String> entry : getProperties().entrySet()) {
final String key = entry.getKey();
final PropertyMetadata propertyMetadata = metadata.get(key);
if (propertyMetadata != null && propertyMetadata.getReconfigRequired() != null && propertyMetadata.getReconfigRequired().booleanValue() && (propertyMetadata.getNotifiers() == null || propertyMetadata.getNotifiers().length == 0)) {
return true;
}
}
return false;
}
use of com.emc.storageos.model.property.PropertyMetadata in project coprhd-controller by CoprHD.
the class PropertyInfoExt method hasRebootProperty.
public boolean hasRebootProperty() {
Map<String, PropertyMetadata> metadata = PropertiesMetadata.getGlobalMetadata();
if (getProperties() == null || metadata == null) {
return false;
}
for (Map.Entry<String, String> entry : getProperties().entrySet()) {
final String key = entry.getKey();
final PropertyMetadata propertyMetadata = metadata.get(key);
if (propertyMetadata != null && propertyMetadata.getRebootRequired() != null && propertyMetadata.getRebootRequired().booleanValue()) {
return true;
}
}
return false;
}
Aggregations