String requestStatus,
Set<String> requestedPropertyIds)
throws NoSuchResourceException, NoSuchParentResourceException {
Set<Resource> response = new HashSet<Resource>();
ActionManager actionManager = getManagementController().getActionManager();
if (clusterName != null) {
Clusters clusters = getManagementController().getClusters();
//validate that cluster exists, throws exception if it doesn't.
try {
clusters.getCluster(clusterName);
} catch (AmbariException e) {
throw new NoSuchParentResourceException(e.getMessage(), e);
}
}
if (requestId == null) {
org.apache.ambari.server.actionmanager.RequestStatus status = null;
if (requestStatus != null) {
status = org.apache.ambari.server.actionmanager.RequestStatus.valueOf(requestStatus);
}
if (LOG.isDebugEnabled()) {
LOG.debug("Received a Get Request Status request"
+ ", requestId=null"
+ ", requestStatus=" + status);
}
response.addAll(getRequestResources(clusterName, actionManager,
actionManager.getRequestsByStatus(status), requestedPropertyIds));
} else {
Collection<Resource> responses = getRequestResources(
clusterName, actionManager, Collections.singletonList(requestId), requestedPropertyIds);
if (responses.isEmpty()) {