@Override
public Set<Resource> getResources(Request request, Predicate predicate)
throws SystemException, UnsupportedPropertyException,
NoSuchResourceException, NoSuchParentResourceException {
final RootServiceComponentRequest rootServiceComponentRequest = getRequest(PredicateHelper
.getProperties(predicate));
Set<String> requestedIds = getRequestPropertyIds(request, predicate);
Set<RootServiceComponentResponse> responses = getResources(new Command<Set<RootServiceComponentResponse>>() {
@Override
public Set<RootServiceComponentResponse> invoke() throws AmbariException {
return getManagementController().getRootServiceComponents(
Collections.singleton(rootServiceComponentRequest));
}
});
Set<Resource> resources = new HashSet<Resource>();
for (RootServiceComponentResponse response : responses) {
Resource resource = new ResourceImpl(Resource.Type.RootServiceComponent);
setResourceProperty(resource, SERVICE_NAME_PROPERTY_ID,
rootServiceComponentRequest.getServiceName(), requestedIds);
setResourceProperty(resource, COMPONENT_NAME_PROPERTY_ID,
response.getComponentName(), requestedIds);
setResourceProperty(resource, PROPERTIES_PROPERTY_ID,