Package org.apache.ambari.server.api.services

Examples of org.apache.ambari.server.api.services.NamedPropertySet


        Iterator<JsonNode> iterator = root.getElements();
        while (iterator.hasNext()) {
          JsonNode            node             = iterator.next();
          Map<String, Object> mapProperties    = new HashMap<String, Object>();
          Map<String, String> requestInfoProps = new HashMap<String, String>();
          NamedPropertySet    propertySet      = new NamedPropertySet("", mapProperties);

          processNode(node, "", propertySet, requestInfoProps);

          if (!requestInfoProps.isEmpty()) {
            // If this node has request info properties then add it as a
            // separate request body
            RequestBody requestBody = new RequestBody();
            requestBody.setBody(body);

            for (Map.Entry<String, String> entry : requestInfoProps.entrySet()) {
              String key   = entry.getKey();
              String value = entry.getValue();

              requestBody.addRequestInfoProperty(key, value);

              if (key.equals(QUERY_FIELD_NAME)) {
                requestBody.setQueryString(value);
              }
            }
            if (!propertySet.getProperties().isEmpty()) {
              requestBody.addPropertySet(propertySet);
            }
            requestBodySet.add(requestBody);
          } else {
            // If this node does not have request info properties then add it
            // as a new property set to the root request body
            if (!propertySet.getProperties().isEmpty()) {
              rootBody.addPropertySet(propertySet);
            }
            requestBodySet.add(rootBody);
          }
        }
View Full Code Here


        //array
        Iterator<JsonNode>       arrayIter = child.getElements();
        Set<Map<String, Object>> arraySet  = new HashSet<Map<String, Object>>();

        while (arrayIter.hasNext()) {
          NamedPropertySet arrayPropertySet = new NamedPropertySet(name, new HashMap<String, Object>());
          processNode(arrayIter.next(), "", arrayPropertySet, requestInfoProps);
          arraySet.add(arrayPropertySet.getProperties());
        }
        propertySet.getProperties().put(PropertyHelper.getPropertyId(path, name), arraySet);
      } else if (child.isContainerNode()) {
        // object
        if (name.equals(BODY_TITLE)) {
View Full Code Here

        Iterator<JsonNode> iterator = root.getElements();
        while (iterator.hasNext()) {
          JsonNode            node             = iterator.next();
          Map<String, Object> mapProperties    = new HashMap<String, Object>();
          Map<String, String> requestInfoProps = new HashMap<String, String>();
          NamedPropertySet    propertySet      = new NamedPropertySet("", mapProperties);

          processNode(node, "", propertySet, requestInfoProps);

          if (!requestInfoProps.isEmpty()) {
            // If this node has request info properties then add it as a
            // separate request body
            RequestBody requestBody = new RequestBody();
            requestBody.setBody(body);

            for (Map.Entry<String, String> entry : requestInfoProps.entrySet()) {
              String key   = entry.getKey();
              String value = entry.getValue();

              requestBody.addRequestInfoProperty(key, value);

              if (key.equals(QUERY_FIELD_NAME)) {
                requestBody.setQueryString(value);
              }
            }
            if (!propertySet.getProperties().isEmpty()) {
              requestBody.addPropertySet(propertySet);
            }
            requestBodySet.add(requestBody);
          } else {
            // If this node does not have request info properties then add it
            // as a new property set to the root request body
            if (!propertySet.getProperties().isEmpty()) {
              rootBody.addPropertySet(propertySet);
            }
            requestBodySet.add(rootBody);
          }
        }
View Full Code Here

        //array
        Iterator<JsonNode>       arrayIter = child.getElements();
        Set<Map<String, Object>> arraySet  = new HashSet<Map<String, Object>>();

        while (arrayIter.hasNext()) {
          NamedPropertySet arrayPropertySet = new NamedPropertySet(name, new HashMap<String, Object>());
          processNode(arrayIter.next(), "", arrayPropertySet, requestInfoProps);
          arraySet.add(arrayPropertySet.getProperties());
        }
        propertySet.getProperties().put(PropertyHelper.getPropertyId(path, name), arraySet);
      } else if (child.isContainerNode()) {
        // object
        if (name.equals(BODY_TITLE)) {
View Full Code Here

        Iterator<JsonNode> iterator = root.getElements();
        while (iterator.hasNext()) {
          JsonNode            node             = iterator.next();
          Map<String, Object> mapProperties    = new HashMap<String, Object>();
          Map<String, String> requestInfoProps = new HashMap<String, String>();
          NamedPropertySet    propertySet      = new NamedPropertySet("", mapProperties);

          processNode(node, "", propertySet, requestInfoProps);

          if (!requestInfoProps.isEmpty()) {
            // If this node has request info properties then add it as a
            // separate request body
            RequestBody requestBody = new RequestBody();
            requestBody.setBody(body);

            for (Map.Entry<String, String> entry : requestInfoProps.entrySet()) {
              String key   = entry.getKey();
              String value = entry.getValue();

              requestBody.addRequestInfoProperty(key, value);

              if (key.equals(QUERY_FIELD_NAME)) {
                requestBody.setQueryString(value);
              }
            }
            if (!propertySet.getProperties().isEmpty()) {
              requestBody.addPropertySet(propertySet);
            }
            requestBodySet.add(requestBody);
          } else {
            // If this node does not have request info properties then add it
            // as a new property set to the root request body
            if (!propertySet.getProperties().isEmpty()) {
              rootBody.addPropertySet(propertySet);
            }
            requestBodySet.add(rootBody);
          }
        }
View Full Code Here

        //array
        Iterator<JsonNode>       arrayIter = child.getElements();
        Set<Map<String, Object>> arraySet  = new HashSet<Map<String, Object>>();

        while (arrayIter.hasNext()) {
          NamedPropertySet arrayPropertySet = new NamedPropertySet(name, new HashMap<String, Object>());
          processNode(arrayIter.next(), "", arrayPropertySet, requestInfoProps);
          arraySet.add(arrayPropertySet.getProperties());
        }
        propertySet.getProperties().put(PropertyHelper.getPropertyId(path, name), arraySet);
      } else if (child.isContainerNode()) {
        // object
        if (name.equals(BODY_TITLE)) {
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.api.services.NamedPropertySet

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.