public PropertyInfo getProperty(String stackName, String version, String serviceName, String propertyName)
throws AmbariException {
Set<PropertyInfo> properties = getProperties(stackName, version, serviceName);
if (properties.size() == 0)
throw new StackAccessException("stackName=" + stackName
+ ", stackVersion=" + version
+ ", serviceName=" + serviceName
+ ", propertyName=" + propertyName);
PropertyInfo propertyResult = null;
for (PropertyInfo property : properties) {
if (property.getName().equals(propertyName))
propertyResult = property;
}
if (propertyResult == null)
throw new StackAccessException("stackName=" + stackName
+ ", stackVersion=" + version
+ ", serviceName=" + serviceName
+ ", propertyName=" + propertyName);
return propertyResult;