@Override
public Set<Resource> getResources(Request request, Predicate predicate)
throws SystemException, UnsupportedPropertyException,
NoSuchResourceException, NoSuchParentResourceException {
final StackConfigurationRequest stackConfigurationRequest = getRequest(PredicateHelper
.getProperties(predicate));
Set<String> requestedIds = getRequestPropertyIds(request, predicate);
Set<StackConfigurationResponse> responses = getResources(new Command<Set<StackConfigurationResponse>>() {
@Override
public Set<StackConfigurationResponse> invoke() throws AmbariException {
return getManagementController().getStackConfigurations(
Collections.singleton(stackConfigurationRequest));
}
});
Set<Resource> resources = new HashSet<Resource>();
for (StackConfigurationResponse response : responses) {
Resource resource = new ResourceImpl(Resource.Type.StackConfiguration);
setResourceProperty(resource, STACK_NAME_PROPERTY_ID,
stackConfigurationRequest.getStackName(), requestedIds);
setResourceProperty(resource, STACK_VERSION_PROPERTY_ID,
stackConfigurationRequest.getStackVersion(), requestedIds);
setResourceProperty(resource, SERVICE_NAME_PROPERTY_ID,
stackConfigurationRequest.getServiceName(), requestedIds);
setResourceProperty(resource, PROPERTY_NAME_PROPERTY_ID,
response.getPropertyName(), requestedIds);
setResourceProperty(resource, PROPERTY_VALUE_PROPERTY_ID,