String serviceName = request.getServiceName();
String componentName = request.getComponentName();
if (componentName != null) {
ComponentInfo component = this.ambariMetaInfo.getComponent(stackName, stackVersion, serviceName, componentName);
response = Collections.singleton(component.convertToResponse());
} else {
List<ComponentInfo> components = this.ambariMetaInfo.getComponentsByService(stackName, stackVersion, serviceName);
response = new HashSet<StackServiceComponentResponse>();