if (request.getHostname() != null) {
try {
if (! clusters.getClustersForHost(request.getHostname()).contains(cluster)) {
// case where host exists but not associated with given cluster
throw new ParentObjectNotFoundException("Parent Host resource doesn't exist",
new HostNotFoundException(request.getClusterName(), request.getHostname()));
}
} catch (HostNotFoundException e) {
// creating new HostNotFoundException to add cluster name
throw new ParentObjectNotFoundException("Parent Host resource doesn't exist",
new HostNotFoundException(request.getClusterName(), request.getHostname()));
}
}
if (request.getComponentName() != null) {
if (request.getServiceName() == null