Package models.data

Examples of models.data.NodeGroupSourceMetadata


 
  public void generateAgentCommandInNodeGroupDataMap(String nodeGroupType,
      String agentCommandType, Map<String, NodeGroupDataMap> dataStore,
      Map<String, NodeGroupSourceMetadata> nodeGroupStore) {

    NodeGroupSourceMetadata nodeGroupSourceMetadata = nodeGroupStore
        .get(nodeGroupType);

    AgentCommandMetadata agentCommandMetadata = agentCommandMetadatas
        .get(agentCommandType);

    if(agentCommandMetadata==null){
      models.utils.LogUtils.printLogError("agentCommandMetadata iS NULL in generateAgentCommandInNodeGroupDataMap(); RETURN at time " + DateUtils.getNowDateTimeStrSdsm());
     
      return;
    }
   
    String requestContentTemplate = agentCommandMetadata
        .getRequestContentTemplate();
    String requestContent = AgentCommandMetadata
        .replaceDefaultFullRequestContent(requestContentTemplate);

    if (nodeGroupSourceMetadata == null || agentCommandMetadata == null) {
       models.utils.LogUtils.printLogError
           ("nodeGroupSourceMetadata or agentCommandMetadata is NULL in generateAgentCommandInNodeGroupDataMap. EXIT!!");
      return;
    }

    NodeGroupDataMap ngdm = dataStore.get(nodeGroupType);

    // will automatically replace the old NodeRequestResponse when
    // updateAgentDataForNode
    // using not the nodeGroupSourceMetadata.getNodeList; but the actual
    // data.
    try {

      for (String fqdn : nodeGroupSourceMetadata.getNodeList()) {

        NodeReqResponse nodeReqResponse = new NodeReqResponse();
        nodeReqResponse.setDefaultReqestContent(requestContent);
        AgentDataProviderHelper.updateAgentDataForNode(ngdm, fqdn,
            nodeReqResponse, agentCommandType);
View Full Code Here


  public synchronized void updateDataValidFromInProgressAll() {

    for (Entry<String, NodeGroupSourceMetadata> entry : nodeGroupSourceMetadatas
        .entrySet()) {

      NodeGroupSourceMetadata ngsm = entry.getValue();
      NodeGroupDataMap ngdm = allAgentData.get(ngsm.getNodeGroupType());
      ngdm.getNodeDataMapValid().clear();
      ngdm.getNodeDataMapValid().putAll(ngdm.getNodeDataMapInProgress());

    }
View Full Code Here

                  .toString())) {
            nodeGroupType = wordsInLine[1];
            statehubUrlPrefix = wordsInLine[2];
            envStr = wordsInLine[3];

            NodeGroupSourceMetadata ngsm = new NodeGroupSourceMetadata(
                dataSourceType, nodeGroupType,
                statehubUrlPrefix, envStr);

            List<String> nodeList = new ArrayList<String>();

            boolean startTagParsed = false;
            boolean endTagParsed = false;
            while ((line = reader.readLine()) != null) {
              if (line.equalsIgnoreCase(VarUtils.NODEGROUP_CONF_TAG_ADHOC_NODE_LIST_START)) {
                startTagParsed = true;
              } else if (line
                  .equalsIgnoreCase(VarUtils.NODEGROUP_CONF_TAG_ADHOC_NODE_LIST_END)) {
                endTagParsed = true;
                break;
              } else if (startTagParsed == true
                  && endTagParsed == false) {
                // fixed bug: when fqdn has a space in the end.
                // Assuming FQDN dont have a space in the middle
                nodeList.add(line.trim());
              }
            }

            // now should completes
            if (startTagParsed == false || endTagParsed == false) {
              models.utils.LogUtils.printLogError("ERROR in parsing");
            }

            // filtering duplicated nodes:
            int removedDuplicatedNodeCount = AgentUtils
                .removeDuplicateNodeList(nodeList);

            models.utils.LogUtils.printLogNormal(" Removed duplicated node #: "
                + removedDuplicatedNodeCount);
            models.utils.LogUtils.printLogNormal(" Total node count after removing duplicate : "
                    + nodeList.size());

            ngsm.addNodesToNodeList(nodeList);

            if (nodeGroupType != null) {

              adp.nodeGroupSourceMetadatas.put(nodeGroupType,
                  ngsm);
View Full Code Here

      // make sure allAgentData has at least nodeGroup as
      // NodeGroupSourceMetadata
      for (Entry<String, NodeGroupSourceMetadata> entry : nodeGroupStore
          .entrySet()) {

        NodeGroupSourceMetadata ngsm = entry.getValue();
        if (!dataStore.containsKey(ngsm.getNodeGroupType())
            || dataStore.get(ngsm.getNodeGroupType()) == null) {
          NodeGroupDataMap ngdm = new NodeGroupDataMap(
              ngsm.getNodeGroupType());

          dataStore.put(ngsm.getNodeGroupType(), ngdm);
        }

      }

      // make sure allAgentData has no more nodeGroup as
View Full Code Here

  }
 
  public static NodeGroupSourceMetadata getNodeGroupSourceMetadata(boolean isAdhoc, String nodeGroupType){
   
    if(isAdhoc){
      NodeGroupSourceMetadata nodeGroupSourceMetadata = AgentDataProvider.adhocNodeGroups.get(nodeGroupType);
     
   
      return nodeGroupSourceMetadata;
         
     
View Full Code Here

 
 
  public static List<String> getNodeList(boolean isAdhoc, String nodeGroupType){
   
    List<String> nodeList = new ArrayList<String>();
    NodeGroupSourceMetadata nodeGroupSourceMetadata = null;
    if(isAdhoc){
      nodeGroupSourceMetadata =  AgentDataProvider.adhocNodeGroups.get(nodeGroupType);
    }else{
      nodeGroupSourceMetadata = AgentDataProvider.nodeGroupSourceMetadatas.get(nodeGroupType);
    }
    if(nodeGroupSourceMetadata!=null){
     
      nodeList = nodeGroupSourceMetadata.getNodeList();
    }else{
      models.utils.LogUtils.printLogError("ERROR FINDING NODE GROUP TYPE " + nodeGroupType + " in NodeGroupProvider.getNodeList() at time " + DateUtils.getNowDateTimeStrSdsm() );
     
    }
    return nodeList;
View Full Code Here

  public static String generateAdhocNodeGroupHelper(List<String> nodeList) {

    String nodeGroupType = VarUtils.ADHOC_NODEGROUP_PREFIX
        + DateUtils.getNowDateTimeStrConcise();

    NodeGroupSourceMetadata metadata = new NodeGroupSourceMetadata(
        VarUtils.ADHOC, nodeGroupType, nodeList);

    AgentDataProvider.adhocNodeGroups.put(nodeGroupType, metadata);

    //20130924: put into the folder
View Full Code Here

      /**
       * CATCH EXCEPTION: fixed 20130828. LESSON: for none existing node
       * group; must have check
       */

      NodeGroupSourceMetadata nodeGroupSourceMetadata = nodeGroupStore
          .get(nodeGroupType);
      if (nodeGroupSourceMetadata == null) {

        String errMessage = "nodeGroupSourceMetadata  is NULL in generateUpdateSendAgentCommandToNodeGroupHelper. EXIT!!"
            + DateUtils.getNowDateTimeStrSdsm();
View Full Code Here

      /**
       * CATCH EXCEPTION: fixed 20130828. LESSON: for none existing node
       * group; must have check
       */

      NodeGroupSourceMetadata nodeGroupSourceMetadata = nodeGroupStore
          .get(nodeGroupType);
      if (nodeGroupSourceMetadata == null) {

        String errMessage = "nodeGroupSourceMetadata  is NULL in generateUpdateSendAgentCommandToNodeGroupHelper. EXIT!!"
            + DateUtils.getNowDateTimeStrSdsm();
View Full Code Here

      /**
       * CATCH EXCEPTION: fixed 20130828. LESSON: for none existing node
       * group; must have check
       */
      NodeGroupSourceMetadata nodeGroupSourceMetadata = nodeGroupStore
          .get(nodeGroupType);
      if (nodeGroupSourceMetadata == null
          ||   agentCommandType == null
          ) {

View Full Code Here

TOP

Related Classes of models.data.NodeGroupSourceMetadata

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.