@Test public void testGetHostComponents___OR_Predicate_ServiceComponentHostNotFoundException() throws Exception { Injector injector = createStrictMock(Injector.class); Capture<AmbariManagementController> controllerCapture = EasyMock.newCapture(); StackId stack = createNiceMock(StackId.class); Cluster cluster = createNiceMock(Cluster.class); final Host host = createNiceMock(Host.class); Service service = createNiceMock(Service.class); ServiceComponent component = createNiceMock(ServiceComponent.class); ServiceComponent component2 = createNiceMock(ServiceComponent.class); ServiceComponent component3 = createNiceMock(ServiceComponent.class); final ServiceComponentHost componentHost1 = createNiceMock(ServiceComponentHost.class); final ServiceComponentHost componentHost2 = createNiceMock(ServiceComponentHost.class); ServiceComponentHostResponse response1 = createNiceMock(ServiceComponentHostResponse.class); ServiceComponentHostResponse response2 = createNiceMock(ServiceComponentHostResponse.class); MaintenanceStateHelper stateHelper = createNiceMock(MaintenanceStateHelper.class); expect(stateHelper.getEffectiveState( anyObject(ServiceComponentHost.class), anyObject(Host.class))).andReturn(MaintenanceState.OFF).anyTimes(); expect(clusters.getHostsForCluster((String) anyObject())).andReturn( new HashMap<String, Host>() {{ put("host1", host); }}).anyTimes(); ServiceComponentHostRequest request1 = new ServiceComponentHostRequest( "cluster1", null, "component1", "host1", null); ServiceComponentHostRequest request2 = new ServiceComponentHostRequest( "cluster1", null, "component2", "host1", null); ServiceComponentHostRequest request3 = new ServiceComponentHostRequest( "cluster1", null, "component3", "host1", null); Set<ServiceComponentHostRequest> setRequests = new HashSet<ServiceComponentHostRequest>(); setRequests.add(request1); setRequests.add(request2); setRequests.add(request3); injector.injectMembers(capture(controllerCapture)); expect(injector.getInstance(Gson.class)).andReturn(null); expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(stateHelper).anyTimes(); expect(injector.getInstance(KerberosHelper.class)).andReturn(createNiceMock(KerberosHelper.class)); expect(clusters.getCluster("cluster1")).andReturn(cluster).times(3); expect(clusters.getClustersForHost("host1")).andReturn(Collections.singleton(cluster)).anyTimes(); expect(cluster.getService("service1")).andReturn(service).times(3); expect(cluster.getDesiredStackVersion()).andReturn(stack).anyTimes(); expect(stack.getStackName()).andReturn("stackName").anyTimes(); expect(stack.getStackVersion()).andReturn("stackVersion").anyTimes(); expect(ambariMetaInfo.getComponentToService("stackName", "stackVersion", "component1")).andReturn("service1"); expect(service.getServiceComponent("component1")).andReturn(component); expect(component.getName()).andReturn("component1"); expect(component.getServiceComponentHosts()).andReturn( new HashMap<String, ServiceComponentHost>() {{ put("host1", componentHost1); }}); expect(componentHost1.convertToResponse(null)).andReturn(response1); expect(componentHost1.getHostName()).andReturn("host1"); expect(ambariMetaInfo.getComponentToService("stackName", "stackVersion", "component2")).andReturn("service1"); expect(service.getServiceComponent("component2")).andReturn(component2); expect(component2.getName()).andReturn("component2"); expect(component2.getServiceComponentHosts()).andReturn(null); expect(componentHost2.getHostName()).andReturn("host1"); expect(ambariMetaInfo.getComponentToService("stackName", "stackVersion", "component3")).andReturn("service1"); expect(service.getServiceComponent("component3")).andReturn(component3); expect(component3.getName()).andReturn("component3"); expect(component3.getServiceComponentHosts()).andReturn( new HashMap<String, ServiceComponentHost>() {{ put("host1", componentHost2); }}); expect(componentHost2.convertToResponse(null)).andReturn(response2); replay(stateHelper, injector, clusters, cluster, host, stack, ambariMetaInfo, service, component, component2, component3, componentHost1, componentHost2, response1, response2); AmbariManagementController controller = new AmbariManagementControllerImpl(null, clusters, injector); setAmbariMetaInfo(ambariMetaInfo, controller); Set<ServiceComponentHostResponse> setResponses = controller.getHostComponents(setRequests); assertSame(controller, controllerCapture.getValue()); assertEquals(2, setResponses.size()); assertTrue(setResponses.contains(response1)); assertTrue(setResponses.contains(response2)); verify(injector, clusters, cluster, host, stack, ambariMetaInfo, service, component, component2, component3, componentHost1, componentHost2, response1, response2); }
private Set<ServiceComponentHostResponse> getHostComponents( ServiceComponentHostRequest request) throws AmbariException { LOG.debug("Processing request {}", request); if (request.getClusterName() == null || request.getClusterName().isEmpty()) { IllegalArgumentException e = new IllegalArgumentException("Invalid arguments, cluster name should not be null"); LOG.debug("Cluster not specified in request", e); throw e; } final Cluster cluster; try { cluster = clusters.getCluster(request.getClusterName()); } catch (ClusterNotFoundException e) { LOG.error("Cluster not found ", e); throw new ParentObjectNotFoundException("Parent Cluster resource doesn't exist", e); } if (request.getHostname() != null) { try { if (!clusters.getClustersForHost(request.getHostname()).contains(cluster)) { LOG.error("Host doesn't belong to cluster - " + request.getHostname()); throw new ParentObjectNotFoundException("Parent Host resource doesn't exist", new HostNotFoundException(request.getClusterName(), request.getHostname())); } } catch (HostNotFoundException e) { LOG.error("Host not found", e); throw new ParentObjectNotFoundException("Parent Host resource doesn't exist", new HostNotFoundException(request.getClusterName(), request.getHostname())); } } if (request.getComponentName() != null) { if (request.getServiceName() == null || request.getServiceName().isEmpty()) { StackId stackId = cluster.getDesiredStackVersion(); String serviceName = ambariMetaInfo.getComponentToService(stackId.getStackName(), stackId.getStackVersion(), request.getComponentName()); if (LOG.isDebugEnabled()) { LOG.debug("Looking up service name for component" + ", componentName=" + request.getComponentName() + ", serviceName=" + serviceName + ", stackInfo=" + stackId.getStackId()); } if (serviceName == null || serviceName.isEmpty()) { LOG.error("Unable to find service for component {}", request.getComponentName()); throw new ServiceComponentHostNotFoundException( cluster.getClusterName(), null, request.getComponentName(), request.getHostname()); } request.setServiceName(serviceName); } } Set<Service> services = new HashSet<>(); if (request.getServiceName() != null && !request.getServiceName().isEmpty()) { services.add(cluster.getService(request.getServiceName())); } else { services.addAll(cluster.getServices().values()); } Set<ServiceComponentHostResponse> response = new HashSet<>(); boolean checkDesiredState = false; State desiredStateToCheck = null; boolean checkState = false; State stateToCheck = null; boolean filterBasedConfigStaleness = false; boolean staleConfig = true; if (request.getStaleConfig() != null) { filterBasedConfigStaleness = true; staleConfig = "true".equals(request.getStaleConfig().toLowerCase()); } if (request.getDesiredState() != null && !request.getDesiredState().isEmpty()) { desiredStateToCheck = State.valueOf(request.getDesiredState()); if (!desiredStateToCheck.isValidDesiredState()) { throw new IllegalArgumentException("Invalid arguments, invalid desired" + " state, desiredState=" + desiredStateToCheck); } checkDesiredState = true; } if (!StringUtils.isEmpty(request.getState())) { stateToCheck = State.valueOf(request.getState()); if (stateToCheck == null) { throw new IllegalArgumentException("Invalid arguments, invalid state, State=" + request.getState()); } checkState = true; } Map<String, DesiredConfig> desiredConfigs = cluster.getDesiredConfigs(); Map<String, Host> hosts = clusters.getHostsForCluster(cluster.getClusterName()); for (Service s : services) { Set<ServiceComponent> components = new HashSet<>(); if (request.getComponentName() != null) { components.add(s.getServiceComponent(request.getComponentName())); } else { components.addAll(s.getServiceComponents().values()); } for (ServiceComponent sc : components) { if (request.getComponentName() != null) { if (!sc.getName().equals(request.getComponentName())) { continue; } } Map<String, ServiceComponentHost> serviceComponentHostMap = sc.getServiceComponentHosts(); if (request.getHostname() != null) { try { if (serviceComponentHostMap == null || !serviceComponentHostMap.containsKey(request.getHostname())) { throw new ServiceComponentHostNotFoundException(cluster.getClusterName(), s.getName(), sc.getName(), request.getHostname()); } ServiceComponentHost sch = serviceComponentHostMap.get(request.getHostname()); if (null == sch) { continue; } if (checkDesiredState && (desiredStateToCheck != sch.getDesiredState())) { continue; } if (checkState && stateToCheck != sch.getState()) { continue; } if (request.getAdminState() != null) { String stringToMatch = sch.getComponentAdminState() == null ? "" : sch.getComponentAdminState().name(); if (!request.getAdminState().equals(stringToMatch)) { continue; } } ServiceComponentHostResponse r = sch.convertToResponse(desiredConfigs); if (null == r || (filterBasedConfigStaleness && r.isStaleConfig() != staleConfig)) { continue; } Host host = hosts.get(sch.getHostName()); if (host == null) { throw new HostNotFoundException(cluster.getClusterName(), sch.getHostName()); } MaintenanceState effectiveMaintenanceState = maintenanceStateHelper.getEffectiveState(sch, host); if(filterByMaintenanceState(request, effectiveMaintenanceState)) { continue; } r.setMaintenanceState(effectiveMaintenanceState.name()); response.add(r); } catch (ServiceComponentHostNotFoundException e) { if (request.getServiceName() == null || request.getComponentName() == null) { LOG.debug("Ignoring not specified host_component ", e); } else { LOG.debug("ServiceComponentHost not found ", e); throw new ServiceComponentHostNotFoundException(cluster.getClusterName(), request.getServiceName(), request.getComponentName(), request.getHostname()); } } } else { for (ServiceComponentHost sch : serviceComponentHostMap.values()) { if (null == sch) { continue; } if (checkDesiredState && (desiredStateToCheck != sch.getDesiredState())) { continue; } if (checkState && stateToCheck != sch.getState()) { continue; } if (request.getAdminState() != null) { String stringToMatch = sch.getComponentAdminState() == null ? "" : sch.getComponentAdminState().name(); if (!request.getAdminState().equals(stringToMatch)) { continue; } } ServiceComponentHostResponse r = sch.convertToResponse(desiredConfigs); if (null == r || (filterBasedConfigStaleness && r.isStaleConfig() != staleConfig)) { continue; } Host host = hosts.get(sch.getHostName()); if (host == null) { throw new HostNotFoundException(cluster.getClusterName(), sch.getHostName()); } MaintenanceState effectiveMaintenanceState = maintenanceStateHelper.getEffectiveState(sch, host); if(filterByMaintenanceState(request, effectiveMaintenanceState)) { continue; } r.setMaintenanceState(effectiveMaintenanceState.name()); response.add(r); } } } } return response; }
AmbariManagementControllerImpl implements AmbariManagementController { private Set<ServiceComponentHostResponse> getHostComponents( ServiceComponentHostRequest request) throws AmbariException { LOG.debug("Processing request {}", request); if (request.getClusterName() == null || request.getClusterName().isEmpty()) { IllegalArgumentException e = new IllegalArgumentException("Invalid arguments, cluster name should not be null"); LOG.debug("Cluster not specified in request", e); throw e; } final Cluster cluster; try { cluster = clusters.getCluster(request.getClusterName()); } catch (ClusterNotFoundException e) { LOG.error("Cluster not found ", e); throw new ParentObjectNotFoundException("Parent Cluster resource doesn't exist", e); } if (request.getHostname() != null) { try { if (!clusters.getClustersForHost(request.getHostname()).contains(cluster)) { LOG.error("Host doesn't belong to cluster - " + request.getHostname()); throw new ParentObjectNotFoundException("Parent Host resource doesn't exist", new HostNotFoundException(request.getClusterName(), request.getHostname())); } } catch (HostNotFoundException e) { LOG.error("Host not found", e); throw new ParentObjectNotFoundException("Parent Host resource doesn't exist", new HostNotFoundException(request.getClusterName(), request.getHostname())); } } if (request.getComponentName() != null) { if (request.getServiceName() == null || request.getServiceName().isEmpty()) { StackId stackId = cluster.getDesiredStackVersion(); String serviceName = ambariMetaInfo.getComponentToService(stackId.getStackName(), stackId.getStackVersion(), request.getComponentName()); if (LOG.isDebugEnabled()) { LOG.debug("Looking up service name for component" + ", componentName=" + request.getComponentName() + ", serviceName=" + serviceName + ", stackInfo=" + stackId.getStackId()); } if (serviceName == null || serviceName.isEmpty()) { LOG.error("Unable to find service for component {}", request.getComponentName()); throw new ServiceComponentHostNotFoundException( cluster.getClusterName(), null, request.getComponentName(), request.getHostname()); } request.setServiceName(serviceName); } } Set<Service> services = new HashSet<>(); if (request.getServiceName() != null && !request.getServiceName().isEmpty()) { services.add(cluster.getService(request.getServiceName())); } else { services.addAll(cluster.getServices().values()); } Set<ServiceComponentHostResponse> response = new HashSet<>(); boolean checkDesiredState = false; State desiredStateToCheck = null; boolean checkState = false; State stateToCheck = null; boolean filterBasedConfigStaleness = false; boolean staleConfig = true; if (request.getStaleConfig() != null) { filterBasedConfigStaleness = true; staleConfig = "true".equals(request.getStaleConfig().toLowerCase()); } if (request.getDesiredState() != null && !request.getDesiredState().isEmpty()) { desiredStateToCheck = State.valueOf(request.getDesiredState()); if (!desiredStateToCheck.isValidDesiredState()) { throw new IllegalArgumentException("Invalid arguments, invalid desired" + " state, desiredState=" + desiredStateToCheck); } checkDesiredState = true; } if (!StringUtils.isEmpty(request.getState())) { stateToCheck = State.valueOf(request.getState()); if (stateToCheck == null) { throw new IllegalArgumentException("Invalid arguments, invalid state, State=" + request.getState()); } checkState = true; } Map<String, DesiredConfig> desiredConfigs = cluster.getDesiredConfigs(); Map<String, Host> hosts = clusters.getHostsForCluster(cluster.getClusterName()); for (Service s : services) { Set<ServiceComponent> components = new HashSet<>(); if (request.getComponentName() != null) { components.add(s.getServiceComponent(request.getComponentName())); } else { components.addAll(s.getServiceComponents().values()); } for (ServiceComponent sc : components) { if (request.getComponentName() != null) { if (!sc.getName().equals(request.getComponentName())) { continue; } } Map<String, ServiceComponentHost> serviceComponentHostMap = sc.getServiceComponentHosts(); if (request.getHostname() != null) { try { if (serviceComponentHostMap == null || !serviceComponentHostMap.containsKey(request.getHostname())) { throw new ServiceComponentHostNotFoundException(cluster.getClusterName(), s.getName(), sc.getName(), request.getHostname()); } ServiceComponentHost sch = serviceComponentHostMap.get(request.getHostname()); if (null == sch) { continue; } if (checkDesiredState && (desiredStateToCheck != sch.getDesiredState())) { continue; } if (checkState && stateToCheck != sch.getState()) { continue; } if (request.getAdminState() != null) { String stringToMatch = sch.getComponentAdminState() == null ? "" : sch.getComponentAdminState().name(); if (!request.getAdminState().equals(stringToMatch)) { continue; } } ServiceComponentHostResponse r = sch.convertToResponse(desiredConfigs); if (null == r || (filterBasedConfigStaleness && r.isStaleConfig() != staleConfig)) { continue; } Host host = hosts.get(sch.getHostName()); if (host == null) { throw new HostNotFoundException(cluster.getClusterName(), sch.getHostName()); } MaintenanceState effectiveMaintenanceState = maintenanceStateHelper.getEffectiveState(sch, host); if(filterByMaintenanceState(request, effectiveMaintenanceState)) { continue; } r.setMaintenanceState(effectiveMaintenanceState.name()); response.add(r); } catch (ServiceComponentHostNotFoundException e) { if (request.getServiceName() == null || request.getComponentName() == null) { LOG.debug("Ignoring not specified host_component ", e); } else { LOG.debug("ServiceComponentHost not found ", e); throw new ServiceComponentHostNotFoundException(cluster.getClusterName(), request.getServiceName(), request.getComponentName(), request.getHostname()); } } } else { for (ServiceComponentHost sch : serviceComponentHostMap.values()) { if (null == sch) { continue; } if (checkDesiredState && (desiredStateToCheck != sch.getDesiredState())) { continue; } if (checkState && stateToCheck != sch.getState()) { continue; } if (request.getAdminState() != null) { String stringToMatch = sch.getComponentAdminState() == null ? "" : sch.getComponentAdminState().name(); if (!request.getAdminState().equals(stringToMatch)) { continue; } } ServiceComponentHostResponse r = sch.convertToResponse(desiredConfigs); if (null == r || (filterBasedConfigStaleness && r.isStaleConfig() != staleConfig)) { continue; } Host host = hosts.get(sch.getHostName()); if (host == null) { throw new HostNotFoundException(cluster.getClusterName(), sch.getHostName()); } MaintenanceState effectiveMaintenanceState = maintenanceStateHelper.getEffectiveState(sch, host); if(filterByMaintenanceState(request, effectiveMaintenanceState)) { continue; } r.setMaintenanceState(effectiveMaintenanceState.name()); response.add(r); } } } } return response; } }
AmbariManagementControllerImpl implements AmbariManagementController { private Set<ServiceComponentHostResponse> getHostComponents( ServiceComponentHostRequest request) throws AmbariException { LOG.debug("Processing request {}", request); if (request.getClusterName() == null || request.getClusterName().isEmpty()) { IllegalArgumentException e = new IllegalArgumentException("Invalid arguments, cluster name should not be null"); LOG.debug("Cluster not specified in request", e); throw e; } final Cluster cluster; try { cluster = clusters.getCluster(request.getClusterName()); } catch (ClusterNotFoundException e) { LOG.error("Cluster not found ", e); throw new ParentObjectNotFoundException("Parent Cluster resource doesn't exist", e); } if (request.getHostname() != null) { try { if (!clusters.getClustersForHost(request.getHostname()).contains(cluster)) { LOG.error("Host doesn't belong to cluster - " + request.getHostname()); throw new ParentObjectNotFoundException("Parent Host resource doesn't exist", new HostNotFoundException(request.getClusterName(), request.getHostname())); } } catch (HostNotFoundException e) { LOG.error("Host not found", e); throw new ParentObjectNotFoundException("Parent Host resource doesn't exist", new HostNotFoundException(request.getClusterName(), request.getHostname())); } } if (request.getComponentName() != null) { if (request.getServiceName() == null || request.getServiceName().isEmpty()) { StackId stackId = cluster.getDesiredStackVersion(); String serviceName = ambariMetaInfo.getComponentToService(stackId.getStackName(), stackId.getStackVersion(), request.getComponentName()); if (LOG.isDebugEnabled()) { LOG.debug("Looking up service name for component" + ", componentName=" + request.getComponentName() + ", serviceName=" + serviceName + ", stackInfo=" + stackId.getStackId()); } if (serviceName == null || serviceName.isEmpty()) { LOG.error("Unable to find service for component {}", request.getComponentName()); throw new ServiceComponentHostNotFoundException( cluster.getClusterName(), null, request.getComponentName(), request.getHostname()); } request.setServiceName(serviceName); } } Set<Service> services = new HashSet<>(); if (request.getServiceName() != null && !request.getServiceName().isEmpty()) { services.add(cluster.getService(request.getServiceName())); } else { services.addAll(cluster.getServices().values()); } Set<ServiceComponentHostResponse> response = new HashSet<>(); boolean checkDesiredState = false; State desiredStateToCheck = null; boolean checkState = false; State stateToCheck = null; boolean filterBasedConfigStaleness = false; boolean staleConfig = true; if (request.getStaleConfig() != null) { filterBasedConfigStaleness = true; staleConfig = "true".equals(request.getStaleConfig().toLowerCase()); } if (request.getDesiredState() != null && !request.getDesiredState().isEmpty()) { desiredStateToCheck = State.valueOf(request.getDesiredState()); if (!desiredStateToCheck.isValidDesiredState()) { throw new IllegalArgumentException("Invalid arguments, invalid desired" + " state, desiredState=" + desiredStateToCheck); } checkDesiredState = true; } if (!StringUtils.isEmpty(request.getState())) { stateToCheck = State.valueOf(request.getState()); if (stateToCheck == null) { throw new IllegalArgumentException("Invalid arguments, invalid state, State=" + request.getState()); } checkState = true; } Map<String, DesiredConfig> desiredConfigs = cluster.getDesiredConfigs(); Map<String, Host> hosts = clusters.getHostsForCluster(cluster.getClusterName()); for (Service s : services) { Set<ServiceComponent> components = new HashSet<>(); if (request.getComponentName() != null) { components.add(s.getServiceComponent(request.getComponentName())); } else { components.addAll(s.getServiceComponents().values()); } for (ServiceComponent sc : components) { if (request.getComponentName() != null) { if (!sc.getName().equals(request.getComponentName())) { continue; } } Map<String, ServiceComponentHost> serviceComponentHostMap = sc.getServiceComponentHosts(); if (request.getHostname() != null) { try { if (serviceComponentHostMap == null || !serviceComponentHostMap.containsKey(request.getHostname())) { throw new ServiceComponentHostNotFoundException(cluster.getClusterName(), s.getName(), sc.getName(), request.getHostname()); } ServiceComponentHost sch = serviceComponentHostMap.get(request.getHostname()); if (null == sch) { continue; } if (checkDesiredState && (desiredStateToCheck != sch.getDesiredState())) { continue; } if (checkState && stateToCheck != sch.getState()) { continue; } if (request.getAdminState() != null) { String stringToMatch = sch.getComponentAdminState() == null ? "" : sch.getComponentAdminState().name(); if (!request.getAdminState().equals(stringToMatch)) { continue; } } ServiceComponentHostResponse r = sch.convertToResponse(desiredConfigs); if (null == r || (filterBasedConfigStaleness && r.isStaleConfig() != staleConfig)) { continue; } Host host = hosts.get(sch.getHostName()); if (host == null) { throw new HostNotFoundException(cluster.getClusterName(), sch.getHostName()); } MaintenanceState effectiveMaintenanceState = maintenanceStateHelper.getEffectiveState(sch, host); if(filterByMaintenanceState(request, effectiveMaintenanceState)) { continue; } r.setMaintenanceState(effectiveMaintenanceState.name()); response.add(r); } catch (ServiceComponentHostNotFoundException e) { if (request.getServiceName() == null || request.getComponentName() == null) { LOG.debug("Ignoring not specified host_component ", e); } else { LOG.debug("ServiceComponentHost not found ", e); throw new ServiceComponentHostNotFoundException(cluster.getClusterName(), request.getServiceName(), request.getComponentName(), request.getHostname()); } } } else { for (ServiceComponentHost sch : serviceComponentHostMap.values()) { if (null == sch) { continue; } if (checkDesiredState && (desiredStateToCheck != sch.getDesiredState())) { continue; } if (checkState && stateToCheck != sch.getState()) { continue; } if (request.getAdminState() != null) { String stringToMatch = sch.getComponentAdminState() == null ? "" : sch.getComponentAdminState().name(); if (!request.getAdminState().equals(stringToMatch)) { continue; } } ServiceComponentHostResponse r = sch.convertToResponse(desiredConfigs); if (null == r || (filterBasedConfigStaleness && r.isStaleConfig() != staleConfig)) { continue; } Host host = hosts.get(sch.getHostName()); if (host == null) { throw new HostNotFoundException(cluster.getClusterName(), sch.getHostName()); } MaintenanceState effectiveMaintenanceState = maintenanceStateHelper.getEffectiveState(sch, host); if(filterByMaintenanceState(request, effectiveMaintenanceState)) { continue; } r.setMaintenanceState(effectiveMaintenanceState.name()); response.add(r); } } } } return response; } @Inject  AmbariManagementControllerImpl(ActionManager actionManager,
      Clusters clusters, Injector injector); }
AmbariManagementControllerImpl implements AmbariManagementController { private Set<ServiceComponentHostResponse> getHostComponents( ServiceComponentHostRequest request) throws AmbariException { LOG.debug("Processing request {}", request); if (request.getClusterName() == null || request.getClusterName().isEmpty()) { IllegalArgumentException e = new IllegalArgumentException("Invalid arguments, cluster name should not be null"); LOG.debug("Cluster not specified in request", e); throw e; } final Cluster cluster; try { cluster = clusters.getCluster(request.getClusterName()); } catch (ClusterNotFoundException e) { LOG.error("Cluster not found ", e); throw new ParentObjectNotFoundException("Parent Cluster resource doesn't exist", e); } if (request.getHostname() != null) { try { if (!clusters.getClustersForHost(request.getHostname()).contains(cluster)) { LOG.error("Host doesn't belong to cluster - " + request.getHostname()); throw new ParentObjectNotFoundException("Parent Host resource doesn't exist", new HostNotFoundException(request.getClusterName(), request.getHostname())); } } catch (HostNotFoundException e) { LOG.error("Host not found", e); throw new ParentObjectNotFoundException("Parent Host resource doesn't exist", new HostNotFoundException(request.getClusterName(), request.getHostname())); } } if (request.getComponentName() != null) { if (request.getServiceName() == null || request.getServiceName().isEmpty()) { StackId stackId = cluster.getDesiredStackVersion(); String serviceName = ambariMetaInfo.getComponentToService(stackId.getStackName(), stackId.getStackVersion(), request.getComponentName()); if (LOG.isDebugEnabled()) { LOG.debug("Looking up service name for component" + ", componentName=" + request.getComponentName() + ", serviceName=" + serviceName + ", stackInfo=" + stackId.getStackId()); } if (serviceName == null || serviceName.isEmpty()) { LOG.error("Unable to find service for component {}", request.getComponentName()); throw new ServiceComponentHostNotFoundException( cluster.getClusterName(), null, request.getComponentName(), request.getHostname()); } request.setServiceName(serviceName); } } Set<Service> services = new HashSet<>(); if (request.getServiceName() != null && !request.getServiceName().isEmpty()) { services.add(cluster.getService(request.getServiceName())); } else { services.addAll(cluster.getServices().values()); } Set<ServiceComponentHostResponse> response = new HashSet<>(); boolean checkDesiredState = false; State desiredStateToCheck = null; boolean checkState = false; State stateToCheck = null; boolean filterBasedConfigStaleness = false; boolean staleConfig = true; if (request.getStaleConfig() != null) { filterBasedConfigStaleness = true; staleConfig = "true".equals(request.getStaleConfig().toLowerCase()); } if (request.getDesiredState() != null && !request.getDesiredState().isEmpty()) { desiredStateToCheck = State.valueOf(request.getDesiredState()); if (!desiredStateToCheck.isValidDesiredState()) { throw new IllegalArgumentException("Invalid arguments, invalid desired" + " state, desiredState=" + desiredStateToCheck); } checkDesiredState = true; } if (!StringUtils.isEmpty(request.getState())) { stateToCheck = State.valueOf(request.getState()); if (stateToCheck == null) { throw new IllegalArgumentException("Invalid arguments, invalid state, State=" + request.getState()); } checkState = true; } Map<String, DesiredConfig> desiredConfigs = cluster.getDesiredConfigs(); Map<String, Host> hosts = clusters.getHostsForCluster(cluster.getClusterName()); for (Service s : services) { Set<ServiceComponent> components = new HashSet<>(); if (request.getComponentName() != null) { components.add(s.getServiceComponent(request.getComponentName())); } else { components.addAll(s.getServiceComponents().values()); } for (ServiceComponent sc : components) { if (request.getComponentName() != null) { if (!sc.getName().equals(request.getComponentName())) { continue; } } Map<String, ServiceComponentHost> serviceComponentHostMap = sc.getServiceComponentHosts(); if (request.getHostname() != null) { try { if (serviceComponentHostMap == null || !serviceComponentHostMap.containsKey(request.getHostname())) { throw new ServiceComponentHostNotFoundException(cluster.getClusterName(), s.getName(), sc.getName(), request.getHostname()); } ServiceComponentHost sch = serviceComponentHostMap.get(request.getHostname()); if (null == sch) { continue; } if (checkDesiredState && (desiredStateToCheck != sch.getDesiredState())) { continue; } if (checkState && stateToCheck != sch.getState()) { continue; } if (request.getAdminState() != null) { String stringToMatch = sch.getComponentAdminState() == null ? "" : sch.getComponentAdminState().name(); if (!request.getAdminState().equals(stringToMatch)) { continue; } } ServiceComponentHostResponse r = sch.convertToResponse(desiredConfigs); if (null == r || (filterBasedConfigStaleness && r.isStaleConfig() != staleConfig)) { continue; } Host host = hosts.get(sch.getHostName()); if (host == null) { throw new HostNotFoundException(cluster.getClusterName(), sch.getHostName()); } MaintenanceState effectiveMaintenanceState = maintenanceStateHelper.getEffectiveState(sch, host); if(filterByMaintenanceState(request, effectiveMaintenanceState)) { continue; } r.setMaintenanceState(effectiveMaintenanceState.name()); response.add(r); } catch (ServiceComponentHostNotFoundException e) { if (request.getServiceName() == null || request.getComponentName() == null) { LOG.debug("Ignoring not specified host_component ", e); } else { LOG.debug("ServiceComponentHost not found ", e); throw new ServiceComponentHostNotFoundException(cluster.getClusterName(), request.getServiceName(), request.getComponentName(), request.getHostname()); } } } else { for (ServiceComponentHost sch : serviceComponentHostMap.values()) { if (null == sch) { continue; } if (checkDesiredState && (desiredStateToCheck != sch.getDesiredState())) { continue; } if (checkState && stateToCheck != sch.getState()) { continue; } if (request.getAdminState() != null) { String stringToMatch = sch.getComponentAdminState() == null ? "" : sch.getComponentAdminState().name(); if (!request.getAdminState().equals(stringToMatch)) { continue; } } ServiceComponentHostResponse r = sch.convertToResponse(desiredConfigs); if (null == r || (filterBasedConfigStaleness && r.isStaleConfig() != staleConfig)) { continue; } Host host = hosts.get(sch.getHostName()); if (host == null) { throw new HostNotFoundException(cluster.getClusterName(), sch.getHostName()); } MaintenanceState effectiveMaintenanceState = maintenanceStateHelper.getEffectiveState(sch, host); if(filterByMaintenanceState(request, effectiveMaintenanceState)) { continue; } r.setMaintenanceState(effectiveMaintenanceState.name()); response.add(r); } } } } return response; } @Inject  AmbariManagementControllerImpl(ActionManager actionManager,
      Clusters clusters, Injector injector); @Override String getAmbariServerURI(String path); @Override RoleCommandOrder getRoleCommandOrder(Cluster cluster); @Override void createCluster(ClusterRequest request); @Override synchronized void createHostComponents(Set<ServiceComponentHostRequest> requests); @Override void registerRackChange(String clusterName); @Override synchronized ConfigurationResponse createConfiguration(
      ConfigurationRequest request); @Override Config createConfig(Cluster cluster, String type, Map<String, String> properties,
                             String versionTag, Map<String, Map<String, String>> propertiesAttributes); @Override void createUsers(Set<UserRequest> requests); @Override void createGroups(Set<GroupRequest> requests); @Override void createMembers(Set<MemberRequest> requests); @Override Set<MemberResponse> getMembers(Set<MemberRequest> requests); @Override @SuppressWarnings("unchecked") synchronized void updateMembers(Set<MemberRequest> requests); @Override MaintenanceState getEffectiveMaintenanceState(ServiceComponentHost sch); @Override @Transactional synchronized RequestStatusResponse updateClusters(Set<ClusterRequest> requests,
                                                           Map<String, String> requestProperties); boolean isAttributeMapsEqual(Map<String, Map<String, String>> requestConfigAttributes,
          Map<String, Map<String, String>> clusterConfigAttributes); void saveClusterUpdate(ClusterRequest clusterRequest, ClusterResponse clusterResponse); @Override ClusterResponse getClusterUpdateResults(ClusterRequest clusterRequest); @Override String getJobTrackerHost(Cluster cluster); @Override Map<String, Map<String,String>> findConfigurationTagsWithOverrides(
          Cluster cluster, String hostName); @Override RequestExecutionFactory getRequestExecutionFactory(); @Override ExecutionScheduleManager getExecutionScheduleManager(); @Override List<ServiceOsSpecific.Package> getPackagesForServiceHost(ServiceInfo serviceInfo, Map<String, String> hostParams, String osFamily); @Override ExecutionCommand getExecutionCommand(Cluster cluster,
                                              ServiceComponentHost scHost,
                                              RoleCommand roleCommand); @Override Set<StackConfigurationDependencyResponse> getStackConfigurationDependencies(
          Set<StackConfigurationDependencyRequest> requests); @Override RequestStatusResponse createAndPersistStages(Cluster cluster, Map<String, String> requestProperties,
                                                      Map<String, String> requestParameters,
                                                      Map<State, List<Service>> changedServices,
                                                      Map<State, List<ServiceComponent>> changedComponents,
                                                      Map<String, Map<State, List<ServiceComponentHost>>> changedHosts,
                                                      Collection<ServiceComponentHost> ignoredHosts,
                                                      boolean runSmokeTest, boolean reconfigureClients); @Override RequestStageContainer addStages(RequestStageContainer requestStages, Cluster cluster, Map<String, String> requestProperties,
                                 Map<String, String> requestParameters, Map<State, List<Service>> changedServices,
                                 Map<State, List<ServiceComponent>> changedComponents,
                                 Map<String, Map<State, List<ServiceComponentHost>>> changedHosts,
                                 Collection<ServiceComponentHost> ignoredHosts, boolean runSmokeTest,
                                 boolean reconfigureClients); void validateServiceComponentHostRequest(ServiceComponentHostRequest request); @Override String findServiceName(Cluster cluster, String componentName); @Override synchronized void updateUsers(Set<UserRequest> requests); @Override synchronized void deleteCluster(ClusterRequest request); @Override DeleteStatusMetaData deleteHostComponents(
      Set<ServiceComponentHostRequest> requests); @Override void deleteUsers(Set<UserRequest> requests); @Override void deleteGroups(Set<GroupRequest> requests); @Override void deleteMembers(java.util.Set<MemberRequest> requests); @Override Set<ClusterResponse> getClusters(Set<ClusterRequest> requests); @Override Set<ServiceComponentHostResponse> getHostComponents(
      Set<ServiceComponentHostRequest> requests); @Override Set<ConfigurationResponse> getConfigurations(
      Set<ConfigurationRequest> requests); @Override Set<ServiceConfigVersionResponse> getServiceConfigVersions(Set<ServiceConfigVersionRequest> requests); @Override Set<UserResponse> getUsers(Set<UserRequest> requests); @Override Set<GroupResponse> getGroups(Set<GroupRequest> requests); @Override void updateGroups(Set<GroupRequest> requests); @Override List<String> selectHealthyHosts(Set<String> hostList); @Override String getHealthyHost(Set<String> hostList); @Override RequestStatusResponse createAction(ExecuteActionRequest actionRequest,
      Map<String, String> requestProperties); @Override Set<StackResponse> getStacks(Set<StackRequest> requests); @Override synchronized RequestStatusResponse updateStacks(); @Override Set<ExtensionResponse> getExtensions(Set<ExtensionRequest> requests); @Override Set<ExtensionVersionResponse> getExtensionVersions(
      Set<ExtensionVersionRequest> requests); @Override Set<RepositoryResponse> getRepositories(Set<RepositoryRequest> requests); @Override void updateRepositories(Set<RepositoryRequest> requests); @Override void verifyRepositories(Set<RepositoryRequest> requests); @Override Set<StackVersionResponse> getStackVersions(
      Set<StackVersionRequest> requests); @Override Set<StackServiceResponse> getStackServices(
      Set<StackServiceRequest> requests); @Override Set<StackConfigurationResponse> getStackLevelConfigurations(
      Set<StackLevelConfigurationRequest> requests); @Override Set<StackConfigurationResponse> getStackConfigurations(
      Set<StackConfigurationRequest> requests); @Override Set<StackServiceComponentResponse> getStackComponents(
      Set<StackServiceComponentRequest> requests); @Override Set<OperatingSystemResponse> getOperatingSystems(
      Set<OperatingSystemRequest> requests); @Override String getAuthName(); @Override int getAuthId(); @Override Set<RootServiceResponse> getRootServices(
      Set<RootServiceRequest> requests); @Override Set<RootServiceComponentResponse> getRootServiceComponents(
      Set<RootServiceComponentRequest> requests); @Override Clusters getClusters(); @Override ConfigHelper getConfigHelper(); @Override AmbariMetaInfo getAmbariMetaInfo(); @Override ServiceComponentFactory getServiceComponentFactory(); @Override ConfigGroupFactory getConfigGroupFactory(); @Override RoleGraphFactory getRoleGraphFactory(); @Override AbstractRootServiceResponseFactory getRootServiceResponseFactory(); @Override ActionManager getActionManager(); @Override String getJdkResourceUrl(); @Override String getJavaHome(); @Override String getJDKName(); @Override String getJCEName(); @Override String getServerDB(); @Override String getOjdbcUrl(); @Override String getMysqljdbcUrl(); @Override Map<String, String> getRcaParameters(); @Override boolean checkLdapConfigured(); @Override LdapSyncDto getLdapSyncInfo(); @Override boolean isLdapSyncInProgress(); @Override synchronized LdapBatchDto synchronizeLdapUsersAndGroups(
      LdapSyncRequest userRequest, LdapSyncRequest groupRequest); @SuppressWarnings("unchecked") @Override void initializeWidgetsAndLayouts(Cluster cluster, Service service); @Override TimelineMetricCacheProvider getTimelineMetricCacheProvider(); @Override MetricPropertyProviderFactory getMetricPropertyProviderFactory(); @Override LoggingSearchPropertyProvider getLoggingSearchPropertyProvider(); @Override LoggingService getLoggingService(String clusterName); @Override AmbariEventPublisher getAmbariEventPublisher(); @Override KerberosHelper getKerberosHelper(); @Override CredentialStoreService getCredentialStoreService(); Map<String,String> getCredentialStoreServiceProperties(); @Override MetricsCollectorHAManager getMetricsCollectorHAManager(); @Override void deleteExtensionLink(ExtensionLinkRequest request); @Override void createExtensionLink(ExtensionLinkRequest request); @Override void updateExtensionLink(ExtensionLinkRequest request); @Override void updateExtensionLink(ExtensionLinkEntity linkEntity); @Override QuickLinkVisibilityController getQuicklinkVisibilityController(); }
AmbariManagementControllerImpl implements AmbariManagementController { private Set<ServiceComponentHostResponse> getHostComponents( ServiceComponentHostRequest request) throws AmbariException { LOG.debug("Processing request {}", request); if (request.getClusterName() == null || request.getClusterName().isEmpty()) { IllegalArgumentException e = new IllegalArgumentException("Invalid arguments, cluster name should not be null"); LOG.debug("Cluster not specified in request", e); throw e; } final Cluster cluster; try { cluster = clusters.getCluster(request.getClusterName()); } catch (ClusterNotFoundException e) { LOG.error("Cluster not found ", e); throw new ParentObjectNotFoundException("Parent Cluster resource doesn't exist", e); } if (request.getHostname() != null) { try { if (!clusters.getClustersForHost(request.getHostname()).contains(cluster)) { LOG.error("Host doesn't belong to cluster - " + request.getHostname()); throw new ParentObjectNotFoundException("Parent Host resource doesn't exist", new HostNotFoundException(request.getClusterName(), request.getHostname())); } } catch (HostNotFoundException e) { LOG.error("Host not found", e); throw new ParentObjectNotFoundException("Parent Host resource doesn't exist", new HostNotFoundException(request.getClusterName(), request.getHostname())); } } if (request.getComponentName() != null) { if (request.getServiceName() == null || request.getServiceName().isEmpty()) { StackId stackId = cluster.getDesiredStackVersion(); String serviceName = ambariMetaInfo.getComponentToService(stackId.getStackName(), stackId.getStackVersion(), request.getComponentName()); if (LOG.isDebugEnabled()) { LOG.debug("Looking up service name for component" + ", componentName=" + request.getComponentName() + ", serviceName=" + serviceName + ", stackInfo=" + stackId.getStackId()); } if (serviceName == null || serviceName.isEmpty()) { LOG.error("Unable to find service for component {}", request.getComponentName()); throw new ServiceComponentHostNotFoundException( cluster.getClusterName(), null, request.getComponentName(), request.getHostname()); } request.setServiceName(serviceName); } } Set<Service> services = new HashSet<>(); if (request.getServiceName() != null && !request.getServiceName().isEmpty()) { services.add(cluster.getService(request.getServiceName())); } else { services.addAll(cluster.getServices().values()); } Set<ServiceComponentHostResponse> response = new HashSet<>(); boolean checkDesiredState = false; State desiredStateToCheck = null; boolean checkState = false; State stateToCheck = null; boolean filterBasedConfigStaleness = false; boolean staleConfig = true; if (request.getStaleConfig() != null) { filterBasedConfigStaleness = true; staleConfig = "true".equals(request.getStaleConfig().toLowerCase()); } if (request.getDesiredState() != null && !request.getDesiredState().isEmpty()) { desiredStateToCheck = State.valueOf(request.getDesiredState()); if (!desiredStateToCheck.isValidDesiredState()) { throw new IllegalArgumentException("Invalid arguments, invalid desired" + " state, desiredState=" + desiredStateToCheck); } checkDesiredState = true; } if (!StringUtils.isEmpty(request.getState())) { stateToCheck = State.valueOf(request.getState()); if (stateToCheck == null) { throw new IllegalArgumentException("Invalid arguments, invalid state, State=" + request.getState()); } checkState = true; } Map<String, DesiredConfig> desiredConfigs = cluster.getDesiredConfigs(); Map<String, Host> hosts = clusters.getHostsForCluster(cluster.getClusterName()); for (Service s : services) { Set<ServiceComponent> components = new HashSet<>(); if (request.getComponentName() != null) { components.add(s.getServiceComponent(request.getComponentName())); } else { components.addAll(s.getServiceComponents().values()); } for (ServiceComponent sc : components) { if (request.getComponentName() != null) { if (!sc.getName().equals(request.getComponentName())) { continue; } } Map<String, ServiceComponentHost> serviceComponentHostMap = sc.getServiceComponentHosts(); if (request.getHostname() != null) { try { if (serviceComponentHostMap == null || !serviceComponentHostMap.containsKey(request.getHostname())) { throw new ServiceComponentHostNotFoundException(cluster.getClusterName(), s.getName(), sc.getName(), request.getHostname()); } ServiceComponentHost sch = serviceComponentHostMap.get(request.getHostname()); if (null == sch) { continue; } if (checkDesiredState && (desiredStateToCheck != sch.getDesiredState())) { continue; } if (checkState && stateToCheck != sch.getState()) { continue; } if (request.getAdminState() != null) { String stringToMatch = sch.getComponentAdminState() == null ? "" : sch.getComponentAdminState().name(); if (!request.getAdminState().equals(stringToMatch)) { continue; } } ServiceComponentHostResponse r = sch.convertToResponse(desiredConfigs); if (null == r || (filterBasedConfigStaleness && r.isStaleConfig() != staleConfig)) { continue; } Host host = hosts.get(sch.getHostName()); if (host == null) { throw new HostNotFoundException(cluster.getClusterName(), sch.getHostName()); } MaintenanceState effectiveMaintenanceState = maintenanceStateHelper.getEffectiveState(sch, host); if(filterByMaintenanceState(request, effectiveMaintenanceState)) { continue; } r.setMaintenanceState(effectiveMaintenanceState.name()); response.add(r); } catch (ServiceComponentHostNotFoundException e) { if (request.getServiceName() == null || request.getComponentName() == null) { LOG.debug("Ignoring not specified host_component ", e); } else { LOG.debug("ServiceComponentHost not found ", e); throw new ServiceComponentHostNotFoundException(cluster.getClusterName(), request.getServiceName(), request.getComponentName(), request.getHostname()); } } } else { for (ServiceComponentHost sch : serviceComponentHostMap.values()) { if (null == sch) { continue; } if (checkDesiredState && (desiredStateToCheck != sch.getDesiredState())) { continue; } if (checkState && stateToCheck != sch.getState()) { continue; } if (request.getAdminState() != null) { String stringToMatch = sch.getComponentAdminState() == null ? "" : sch.getComponentAdminState().name(); if (!request.getAdminState().equals(stringToMatch)) { continue; } } ServiceComponentHostResponse r = sch.convertToResponse(desiredConfigs); if (null == r || (filterBasedConfigStaleness && r.isStaleConfig() != staleConfig)) { continue; } Host host = hosts.get(sch.getHostName()); if (host == null) { throw new HostNotFoundException(cluster.getClusterName(), sch.getHostName()); } MaintenanceState effectiveMaintenanceState = maintenanceStateHelper.getEffectiveState(sch, host); if(filterByMaintenanceState(request, effectiveMaintenanceState)) { continue; } r.setMaintenanceState(effectiveMaintenanceState.name()); response.add(r); } } } } return response; } @Inject  AmbariManagementControllerImpl(ActionManager actionManager,
      Clusters clusters, Injector injector); @Override String getAmbariServerURI(String path); @Override RoleCommandOrder getRoleCommandOrder(Cluster cluster); @Override void createCluster(ClusterRequest request); @Override synchronized void createHostComponents(Set<ServiceComponentHostRequest> requests); @Override void registerRackChange(String clusterName); @Override synchronized ConfigurationResponse createConfiguration(
      ConfigurationRequest request); @Override Config createConfig(Cluster cluster, String type, Map<String, String> properties,
                             String versionTag, Map<String, Map<String, String>> propertiesAttributes); @Override void createUsers(Set<UserRequest> requests); @Override void createGroups(Set<GroupRequest> requests); @Override void createMembers(Set<MemberRequest> requests); @Override Set<MemberResponse> getMembers(Set<MemberRequest> requests); @Override @SuppressWarnings("unchecked") synchronized void updateMembers(Set<MemberRequest> requests); @Override MaintenanceState getEffectiveMaintenanceState(ServiceComponentHost sch); @Override @Transactional synchronized RequestStatusResponse updateClusters(Set<ClusterRequest> requests,
                                                           Map<String, String> requestProperties); boolean isAttributeMapsEqual(Map<String, Map<String, String>> requestConfigAttributes,
          Map<String, Map<String, String>> clusterConfigAttributes); void saveClusterUpdate(ClusterRequest clusterRequest, ClusterResponse clusterResponse); @Override ClusterResponse getClusterUpdateResults(ClusterRequest clusterRequest); @Override String getJobTrackerHost(Cluster cluster); @Override Map<String, Map<String,String>> findConfigurationTagsWithOverrides(
          Cluster cluster, String hostName); @Override RequestExecutionFactory getRequestExecutionFactory(); @Override ExecutionScheduleManager getExecutionScheduleManager(); @Override List<ServiceOsSpecific.Package> getPackagesForServiceHost(ServiceInfo serviceInfo, Map<String, String> hostParams, String osFamily); @Override ExecutionCommand getExecutionCommand(Cluster cluster,
                                              ServiceComponentHost scHost,
                                              RoleCommand roleCommand); @Override Set<StackConfigurationDependencyResponse> getStackConfigurationDependencies(
          Set<StackConfigurationDependencyRequest> requests); @Override RequestStatusResponse createAndPersistStages(Cluster cluster, Map<String, String> requestProperties,
                                                      Map<String, String> requestParameters,
                                                      Map<State, List<Service>> changedServices,
                                                      Map<State, List<ServiceComponent>> changedComponents,
                                                      Map<String, Map<State, List<ServiceComponentHost>>> changedHosts,
                                                      Collection<ServiceComponentHost> ignoredHosts,
                                                      boolean runSmokeTest, boolean reconfigureClients); @Override RequestStageContainer addStages(RequestStageContainer requestStages, Cluster cluster, Map<String, String> requestProperties,
                                 Map<String, String> requestParameters, Map<State, List<Service>> changedServices,
                                 Map<State, List<ServiceComponent>> changedComponents,
                                 Map<String, Map<State, List<ServiceComponentHost>>> changedHosts,
                                 Collection<ServiceComponentHost> ignoredHosts, boolean runSmokeTest,
                                 boolean reconfigureClients); void validateServiceComponentHostRequest(ServiceComponentHostRequest request); @Override String findServiceName(Cluster cluster, String componentName); @Override synchronized void updateUsers(Set<UserRequest> requests); @Override synchronized void deleteCluster(ClusterRequest request); @Override DeleteStatusMetaData deleteHostComponents(
      Set<ServiceComponentHostRequest> requests); @Override void deleteUsers(Set<UserRequest> requests); @Override void deleteGroups(Set<GroupRequest> requests); @Override void deleteMembers(java.util.Set<MemberRequest> requests); @Override Set<ClusterResponse> getClusters(Set<ClusterRequest> requests); @Override Set<ServiceComponentHostResponse> getHostComponents(
      Set<ServiceComponentHostRequest> requests); @Override Set<ConfigurationResponse> getConfigurations(
      Set<ConfigurationRequest> requests); @Override Set<ServiceConfigVersionResponse> getServiceConfigVersions(Set<ServiceConfigVersionRequest> requests); @Override Set<UserResponse> getUsers(Set<UserRequest> requests); @Override Set<GroupResponse> getGroups(Set<GroupRequest> requests); @Override void updateGroups(Set<GroupRequest> requests); @Override List<String> selectHealthyHosts(Set<String> hostList); @Override String getHealthyHost(Set<String> hostList); @Override RequestStatusResponse createAction(ExecuteActionRequest actionRequest,
      Map<String, String> requestProperties); @Override Set<StackResponse> getStacks(Set<StackRequest> requests); @Override synchronized RequestStatusResponse updateStacks(); @Override Set<ExtensionResponse> getExtensions(Set<ExtensionRequest> requests); @Override Set<ExtensionVersionResponse> getExtensionVersions(
      Set<ExtensionVersionRequest> requests); @Override Set<RepositoryResponse> getRepositories(Set<RepositoryRequest> requests); @Override void updateRepositories(Set<RepositoryRequest> requests); @Override void verifyRepositories(Set<RepositoryRequest> requests); @Override Set<StackVersionResponse> getStackVersions(
      Set<StackVersionRequest> requests); @Override Set<StackServiceResponse> getStackServices(
      Set<StackServiceRequest> requests); @Override Set<StackConfigurationResponse> getStackLevelConfigurations(
      Set<StackLevelConfigurationRequest> requests); @Override Set<StackConfigurationResponse> getStackConfigurations(
      Set<StackConfigurationRequest> requests); @Override Set<StackServiceComponentResponse> getStackComponents(
      Set<StackServiceComponentRequest> requests); @Override Set<OperatingSystemResponse> getOperatingSystems(
      Set<OperatingSystemRequest> requests); @Override String getAuthName(); @Override int getAuthId(); @Override Set<RootServiceResponse> getRootServices(
      Set<RootServiceRequest> requests); @Override Set<RootServiceComponentResponse> getRootServiceComponents(
      Set<RootServiceComponentRequest> requests); @Override Clusters getClusters(); @Override ConfigHelper getConfigHelper(); @Override AmbariMetaInfo getAmbariMetaInfo(); @Override ServiceComponentFactory getServiceComponentFactory(); @Override ConfigGroupFactory getConfigGroupFactory(); @Override RoleGraphFactory getRoleGraphFactory(); @Override AbstractRootServiceResponseFactory getRootServiceResponseFactory(); @Override ActionManager getActionManager(); @Override String getJdkResourceUrl(); @Override String getJavaHome(); @Override String getJDKName(); @Override String getJCEName(); @Override String getServerDB(); @Override String getOjdbcUrl(); @Override String getMysqljdbcUrl(); @Override Map<String, String> getRcaParameters(); @Override boolean checkLdapConfigured(); @Override LdapSyncDto getLdapSyncInfo(); @Override boolean isLdapSyncInProgress(); @Override synchronized LdapBatchDto synchronizeLdapUsersAndGroups(
      LdapSyncRequest userRequest, LdapSyncRequest groupRequest); @SuppressWarnings("unchecked") @Override void initializeWidgetsAndLayouts(Cluster cluster, Service service); @Override TimelineMetricCacheProvider getTimelineMetricCacheProvider(); @Override MetricPropertyProviderFactory getMetricPropertyProviderFactory(); @Override LoggingSearchPropertyProvider getLoggingSearchPropertyProvider(); @Override LoggingService getLoggingService(String clusterName); @Override AmbariEventPublisher getAmbariEventPublisher(); @Override KerberosHelper getKerberosHelper(); @Override CredentialStoreService getCredentialStoreService(); Map<String,String> getCredentialStoreServiceProperties(); @Override MetricsCollectorHAManager getMetricsCollectorHAManager(); @Override void deleteExtensionLink(ExtensionLinkRequest request); @Override void createExtensionLink(ExtensionLinkRequest request); @Override void updateExtensionLink(ExtensionLinkRequest request); @Override void updateExtensionLink(ExtensionLinkEntity linkEntity); @Override QuickLinkVisibilityController getQuicklinkVisibilityController(); static final String SKIP_INSTALL_FOR_COMPONENTS; static final String DONT_SKIP_INSTALL_FOR_COMPONENTS; }