Package org.apache.ambari.server.controller

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


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

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

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

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

    for (StackVersionResponse response : responses) {
      Resource resource = new ResourceImpl(Resource.Type.StackVersion);

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

      setResourceProperty(resource, STACK_VERSION_PROPERTY_ID,
          response.getStackVersion(), requestedIds);
     
      setResourceProperty(resource, STACK_MIN_VERSION_PROPERTY_ID,
View Full Code Here


    return resources;
  }

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

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

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

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

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

    for (StackVersionResponse response : responses) {
      Resource resource = new ResourceImpl(Resource.Type.StackVersion);

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

      setResourceProperty(resource, STACK_VERSION_PROPERTY_ID,
          response.getStackVersion(), requestedIds);
     
      setResourceProperty(resource, STACK_MIN_VERSION_PROPERTY_ID,
View Full Code Here

    return resources;
  }

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

    return resources;
  }

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

TOP

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

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.