@Override
public Set<Resource> getResources(Request request, Predicate predicate)
throws SystemException, UnsupportedPropertyException,
NoSuchResourceException, NoSuchParentResourceException {
final StackVersionRequest stackVersionRequest = getRequest(PredicateHelper
.getProperties(predicate));
Set<String> requestedIds = getRequestPropertyIds(request, predicate);
Set<StackVersionResponse> responses = getResources(new Command<Set<StackVersionResponse>>() {
@Override
public Set<StackVersionResponse> invoke() throws AmbariException {
return getManagementController().getStackVersions(
Collections.singleton(stackVersionRequest));
}
});
Set<Resource> resources = new HashSet<Resource>();
for (StackVersionResponse response : responses) {
Resource resource = new ResourceImpl(Resource.Type.StackVersion);
setResourceProperty(resource, STACK_NAME_PROPERTY_ID,
stackVersionRequest.getStackName(), requestedIds);
setResourceProperty(resource, STACK_VERSION_PROPERTY_ID,
response.getStackVersion(), requestedIds);
setResourceProperty(resource, STACK_MIN_VERSION_PROPERTY_ID,