Package org.apache.ambari.server.controller

Examples of org.apache.ambari.server.controller.StackServiceRequest


    public Stack(String name, String version) throws AmbariException {
      this.name = name;
      this.version = version;

      Set<StackServiceResponse> stackServices = getManagementController().getStackServices(
          Collections.singleton(new StackServiceRequest(name, version, null)));

      for (StackServiceResponse stackService : stackServices) {
        String serviceName = stackService.getServiceName();
        parseComponents(serviceName);
        parseConfigurations(serviceName);
View Full Code Here


    assertEquals(RequestStatus.Status.InProgress, requestStatus.getStatus());

    Set<StackServiceRequest> stackServiceRequests = stackServiceRequestCapture.getValue();
    assertEquals(1, stackServiceRequests.size());
    StackServiceRequest ssr = stackServiceRequests.iterator().next();
    assertNull(ssr.getServiceName());
    assertEquals("test", ssr.getStackName());
    assertEquals("1.23", ssr.getStackVersion());

    Set<StackServiceComponentRequest> stackServiceComponentRequests1 = serviceComponentRequestCapture1.getValue();
    Set<StackServiceComponentRequest> stackServiceComponentRequests2 = serviceComponentRequestCapture2.getValue();
    assertEquals(1, stackServiceComponentRequests1.size());
    assertEquals(1, stackServiceComponentRequests2.size());
View Full Code Here

  @Override
  public Set<Resource> getResources(Request request, Predicate predicate)
      throws SystemException, UnsupportedPropertyException,
      NoSuchResourceException, NoSuchParentResourceException {

    final StackServiceRequest stackServiceRequest = getRequest(PredicateHelper
        .getProperties(predicate));
    Set<String> requestedIds = getRequestPropertyIds(request, predicate);

    Set<StackServiceResponse> responses = getResources(new Command<Set<StackServiceResponse>>() {
      @Override
      public Set<StackServiceResponse> invoke() throws AmbariException {
        return getManagementController().getStackServices(
            Collections.singleton(stackServiceRequest));
      }
    });

    Set<Resource> resources = new HashSet<Resource>();

    for (StackServiceResponse response : responses) {
      Resource resource = new ResourceImpl(Resource.Type.StackService);

      setResourceProperty(resource, STACK_NAME_PROPERTY_ID,
          stackServiceRequest.getStackName(), requestedIds);

      setResourceProperty(resource, STACK_VERSION_PROPERTY_ID,
          stackServiceRequest.getStackVersion(), requestedIds);

      setResourceProperty(resource, SERVICE_NAME_PROPERTY_ID,
          response.getServiceName(), requestedIds);

      setResourceProperty(resource, USER_NAME_PROPERTY_ID,
View Full Code Here

    return resources;
  }

  private StackServiceRequest getRequest(Map<String, Object> properties) {
    return new StackServiceRequest(
        (String) properties.get(STACK_NAME_PROPERTY_ID),
        (String) properties.get(STACK_VERSION_PROPERTY_ID),
        (String) properties.get(SERVICE_NAME_PROPERTY_ID));
  }
View Full Code Here

    assertEquals(RequestStatus.Status.InProgress, requestStatus.getStatus());

    Set<StackServiceRequest> stackServiceRequests = stackServiceRequestCapture.getValue();
    assertEquals(1, stackServiceRequests.size());
    StackServiceRequest ssr = stackServiceRequests.iterator().next();
    assertNull(ssr.getServiceName());
    assertEquals("test", ssr.getStackName());
    assertEquals("1.23", ssr.getStackVersion());

    Set<StackServiceComponentRequest> stackServiceComponentRequests1 = serviceComponentRequestCapture1.getValue();
    Set<StackServiceComponentRequest> stackServiceComponentRequests2 = serviceComponentRequestCapture2.getValue();
    assertEquals(1, stackServiceComponentRequests1.size());
    assertEquals(1, stackServiceComponentRequests2.size());
View Full Code Here

    assertEquals(RequestStatus.Status.InProgress, requestStatus.getStatus());

    Set<StackServiceRequest> stackServiceRequests = stackServiceRequestCapture.getValue();
    assertEquals(1, stackServiceRequests.size());
    StackServiceRequest ssr = stackServiceRequests.iterator().next();
    assertNull(ssr.getServiceName());
    assertEquals("test", ssr.getStackName());
    assertEquals("1.23", ssr.getStackVersion());

    Set<StackServiceComponentRequest> stackServiceComponentRequests1 = serviceComponentRequestCapture1.getValue();
    Set<StackServiceComponentRequest> stackServiceComponentRequests2 = serviceComponentRequestCapture2.getValue();
    assertEquals(1, stackServiceComponentRequests1.size());
    assertEquals(1, stackServiceComponentRequests2.size());
View Full Code Here

    public Stack(String name, String version) throws AmbariException {
      this.name = name;
      this.version = version;

      Set<StackServiceResponse> stackServices = getManagementController().getStackServices(
          Collections.singleton(new StackServiceRequest(name, version, null)));

      for (StackServiceResponse stackService : stackServices) {
        String serviceName = stackService.getServiceName();
        parseComponents(serviceName);
        parseConfigurations(serviceName);
View Full Code Here

    public Stack(String name, String version) throws AmbariException {
      this.name = name;
      this.version = version;

      Set<StackServiceResponse> stackServices = getManagementController().getStackServices(
          Collections.singleton(new StackServiceRequest(name, version, null)));

      for (StackServiceResponse stackService : stackServices) {
        String serviceName = stackService.getServiceName();
        parseComponents(serviceName);
        parseConfigurations(serviceName);
View Full Code Here

    assertEquals(RequestStatus.Status.InProgress, requestStatus.getStatus());

    Set<StackServiceRequest> stackServiceRequests = stackServiceRequestCapture.getValue();
    assertEquals(1, stackServiceRequests.size());
    StackServiceRequest ssr = stackServiceRequests.iterator().next();
    assertNull(ssr.getServiceName());
    assertEquals("test", ssr.getStackName());
    assertEquals("1.23", ssr.getStackVersion());

    Set<StackServiceComponentRequest> stackServiceComponentRequests1 = serviceComponentRequestCapture1.getValue();
    Set<StackServiceComponentRequest> stackServiceComponentRequests2 = serviceComponentRequestCapture2.getValue();
    assertEquals(1, stackServiceComponentRequests1.size());
    assertEquals(1, stackServiceComponentRequests2.size());
View Full Code Here

    assertEquals(RequestStatus.Status.InProgress, requestStatus.getStatus());

    Set<StackServiceRequest> stackServiceRequests = stackServiceRequestCapture.getValue();
    assertEquals(1, stackServiceRequests.size());
    StackServiceRequest ssr = stackServiceRequests.iterator().next();
    assertNull(ssr.getServiceName());
    assertEquals("test", ssr.getStackName());
    assertEquals("1.23", ssr.getStackVersion());

    Set<StackServiceComponentRequest> stackServiceComponentRequests1 = serviceComponentRequestCapture1.getValue();
    Set<StackServiceComponentRequest> stackServiceComponentRequests2 = serviceComponentRequestCapture2.getValue();
    assertEquals(1, stackServiceComponentRequests1.size());
    assertEquals(1, stackServiceComponentRequests2.size());
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.controller.StackServiceRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.