Package org.apache.ambari.server.api.query

Examples of org.apache.ambari.server.api.query.QueryInfo


  @Override
  public TreeNode<Set<String>> finalizeProperties(
      TreeNode<QueryInfo> queryTree, boolean isCollection) {

    QueryInfo queryInfo = queryTree.getObject();
    TreeNode<Set<String>> resultTree = new TreeNodeImpl<Set<String>>(
        null, queryInfo.getProperties(), queryTree.getName());

    copyPropertiesToResult(queryTree, resultTree);

    boolean addKeysToEmptyResource = true;
    if (! isCollection && isRequestWithNoProperties(queryTree)) {
View Full Code Here


    expect(schemaFactory.getSchema(Resource.Type.Component)).andReturn(schema).anyTimes();
    expect(schema.getKeyPropertyId(Resource.Type.Component)).andReturn("ServiceComponentInfo/component_name").anyTimes();

    replay(schemaFactory, schema);

    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), new HashSet<String>());
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");

    MinimalRenderer renderer = new MinimalRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, false);
View Full Code Here

    replay(schemaFactory, schema);

    HashSet<String> serviceProperties = new HashSet<String>();
    serviceProperties.add("foo/bar");
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");

    MinimalRenderer renderer = new MinimalRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, false);
View Full Code Here

    expect(schema.getKeyPropertyId(Resource.Type.Service)).andReturn("ServiceInfo/service_name").anyTimes();

    replay(schemaFactory, schema);

    HashSet<String> serviceProperties = new HashSet<String>();
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");

    MinimalRenderer renderer = new MinimalRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, true);
View Full Code Here

    replay(schemaFactory, schema);

    HashSet<String> serviceProperties = new HashSet<String>();
    serviceProperties.add("foo/bar");
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");

    MinimalRenderer renderer = new MinimalRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, true);
View Full Code Here

    expect(componentSchema.getKeyPropertyId(Resource.Type.Component)).andReturn("ServiceComponentInfo/component_name").anyTimes();

    replay(schemaFactory, serviceSchema, componentSchema);

    HashSet<String> serviceProperties = new HashSet<String>();
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");
    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");

    MinimalRenderer renderer = new MinimalRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, false);
View Full Code Here

    replay(schemaFactory, serviceSchema, componentSchema);

    HashSet<String> serviceProperties = new HashSet<String>();
    serviceProperties.add("foo/bar");
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");
    HashSet<String> componentProperties = new HashSet<String>();
    componentProperties.add("goo/car");
    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), componentProperties), "Component");

    MinimalRenderer renderer = new MinimalRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, false);
View Full Code Here

    expect(componentSchema.getKeyPropertyId(Resource.Type.Component)).andReturn("ServiceComponentInfo/component_name").anyTimes();

    replay(schemaFactory, serviceSchema, componentSchema);

    HashSet<String> serviceProperties = new HashSet<String>();
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");
    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");

    MinimalRenderer renderer = new MinimalRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, true);
View Full Code Here

   * @param propertyTree  property tree
   */
  protected void addSubResources(TreeNode<QueryInfo> queryTree,
                                 TreeNode<Set<String>> propertyTree) {

    QueryInfo queryInfo = queryTree.getObject();
    ResourceDefinition resource = queryInfo.getResource();
    Set<SubResourceDefinition> subResources = resource.getSubResourceDefinitions();
    for (SubResourceDefinition subResource : subResources) {
      Set<String> resourceProperties = new HashSet<String>();
      populateSubResourceDefaults(subResource, resourceProperties);
      propertyTree.addChild(resourceProperties, subResource.getType().name());
View Full Code Here

    replay(schemaFactory, serviceSchema, componentSchema);

    HashSet<String> serviceProperties = new HashSet<String>();
    serviceProperties.add("foo/bar");
    QueryInfo rootQuery = new QueryInfo(new ServiceResourceDefinition(), serviceProperties);
    TreeNode<QueryInfo> queryTree = new TreeNodeImpl<QueryInfo>(null, rootQuery, "Service");
    queryTree.addChild(new QueryInfo(new ComponentResourceDefinition(), new HashSet<String>()), "Component");

    MinimalRenderer renderer = new MinimalRenderer();
    renderer.init(schemaFactory);
    TreeNode<Set<String>> propertyTree = renderer.finalizeProperties(queryTree, true);
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.api.query.QueryInfo

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.