Package org.apache.ambari.server.controller

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


  @Override
  public Set<Resource> getResources(Request request, Predicate predicate)
      throws SystemException, UnsupportedPropertyException,
      NoSuchResourceException, NoSuchParentResourceException {
    final OperatingSystemRequest operatingSystemRequest = getRequest(PredicateHelper
        .getProperties(predicate));
    Set<String> requestedIds = getRequestPropertyIds(request, predicate);

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

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

    for (OperatingSystemResponse response : responses) {
      Resource resource = new ResourceImpl(Resource.Type.OperatingSystem);

      setResourceProperty(resource, STACK_NAME_PROPERTY_ID,
          operatingSystemRequest.getStackName(), requestedIds);
     
      setResourceProperty(resource, STACK_VERSION_PROPERTY_ID,
          operatingSystemRequest.getStackVersion(), requestedIds);
     
      setResourceProperty(resource, OS_TYPE_PROPERTY_ID,
          response.getOsType(), requestedIds);

      resources.add(resource);
View Full Code Here


    return resources;
  }

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

    return resources;
  }

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

TOP

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

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.