Package models.data

Examples of models.data.NodeData


    Map<String, NodeData> nodeDataMapInProgress = ngdm
        .getNodeDataMapInProgress();

    for (Entry<String, NodeData> entry : nodeDataMapInProgress.entrySet()) {

      NodeData nodeData = entry.getValue();

      if (nodeData == null) {

        models.utils.LogUtils.printLogError("nodeData ==null in clearDataInProgress");
      } else {
        nodeData.getDataMap().remove(agentCommandType);
      }

    }// end for loop

    lastRefreshDataInProgress = new Date();
View Full Code Here


    for (Entry<String, NodeData> entry : nodeDataMapInProgress.entrySet()) {

      String fqdn = entry.getKey();

      NodeData nodeDataInProgress = entry.getValue();

      if (nodeDataInProgress == null) {

         models.utils.LogUtils.printLogError
             ("nodeData ==null in updateDataValidFromInProgress");
      } else {
        // deep copy
        NodeData nodeDataInProgressClone = new NodeData(
            nodeDataInProgress);

        NodeReqResponse nrr = nodeDataInProgressClone.getDataMap().get(
            agentCommandType);
        // replace with the new data
        if (nodeDataMapValid != null && fqdn != null && nrr != null) {

          // check if the valid has nodeData too?
          if (nodeDataMapValid.containsKey(fqdn)) {
            NodeData nodeDataValid = nodeDataMapValid.get(fqdn);

            if (!copyRequestContentOnly) {

              // this will replace the nodeDataValid
              nodeDataValid.getDataMap().put(agentCommandType,
                  nrr);

              // only copy the request content.
            } else {
              // check if valid nodeData have this
              // agentCommandType in dataMap?

              if (nodeDataValid.getDataMap().containsKey(
                  agentCommandType)) {
                // just copy the requestParameters
                nodeDataValid.getDataMap()
                    .get(agentCommandType)
                    .getRequestParameters().clear();
                nodeDataValid.getDataMap()
                    .get(agentCommandType)
                    .getRequestParameters();

                for (Entry<String, String> entryLocal : nrr
                    .getRequestParameters().entrySet()) {

                  // replacement from inProgress Clone to
                  // valid
                  nodeDataValid
                      .getDataMap()
                      .get(agentCommandType)
                      .getRequestParameters()
                      .put(entryLocal.getKey(),
                          entryLocal.getValue());

                }

              } else {
                // copy the whole nrr from inProgress.
                nodeDataValid.getDataMap().put(
                    agentCommandType, nrr);
              }

            }
View Full Code Here

          ++requestNotFireCount;
          continue;
        }

       
        final NodeData nodeData = entry.getValue();
        final ActorRef worker = getContext().system().actorOf(
            Props.create(AggregationWorker.class,
                  new RequestToAggregationWorker(
                      nodeData, agentCommandType,
                      errorMsgPatternStr, patternStr),
View Full Code Here

      Map<String, NodeData> nodeDataMapValidSafe, String agentCommandType) {

    for (Entry<String, NodeData> entry : nodeDataMapValidSource.entrySet()) {

      String fqdn = entry.getKey();
      NodeData nd = entry.getValue();

      if (nd == null) {
        // bad entry; skip
        models.utils.LogUtils.printLogError("NodeData is NULL!! in filterUnsafeRequest");
        continue;
      }

      NodeReqResponse nrr = nd.getDataMap().get(agentCommandType);
      if (nrr == null) {
        models.utils.LogUtils.printLogError("nrr is NULL!! in filterUnsafeRequest");
        continue;
      }
      // now get the content.
View Full Code Here

      String fqdn = gap.getHost();

      NodeGroupDataMap ngdm = dataStore
          .get(nodeGroupType);
      if (ngdm != null) {
        NodeData nodeData = ngdm.getNodeDataMapValid().get(fqdn);

        if (nodeData != null) {
          NodeReqResponse nrr = nodeData.getDataMap().get(
              agentCommandType);
          ResponseContent responseContent = new ResponseContent(gap);
          nrr.setResponseContent(responseContent);

        } else {
View Full Code Here

  public static void updateAgentDataForNode(NodeGroupDataMap ngdm,
      String fqdn, NodeReqResponse nodeReqResponse,
      String agentCommandType) {

    NodeData nd = null;

    // check if the node has already has a NodeData Object

    // ASSUMPTION: When the key is not empty, there must be a value of
    // NodeData
    if (ngdm.getNodeDataMapInProgress().containsKey(fqdn)
        && ngdm.getNodeDataMapInProgress().get(fqdn) != null) {
      // use existing
      nd = ngdm.getNodeDataMapInProgress().get(fqdn);
    } else {
      nd = new NodeData(fqdn);
    }
    nd.getDataMap().put(agentCommandType, nodeReqResponse);
    // push this back to map ; needed for the newly constructed NodeData
    ngdm.getNodeDataMapInProgress().put(fqdn, nd);
  }
View Full Code Here

        // TODO: not tested target must already have NodeData
       
        if(! adp.allAgentData.get(nodeGroupTypeTarget).getNodeDataMapValid()
            .containsKey(fqdn)){
           NodeData nd = new NodeData(fqdn);
           adp.allAgentData.get(nodeGroupTypeTarget).getNodeDataMapValid()
            .put(fqdn, nd);
        }
       
        adp.allAgentData.get(nodeGroupTypeTarget).getNodeDataMapValid()
        .get(fqdn).getDataMap().put(agentCommandType, nrrNew);
       
       
       
        // now copy the inProgress;
       

        // Hahh.. catch NPE !!
        NodeReqResponse nrrSourceInProgress = adp.allAgentData
            .get(nodeGroupTypeSource).getNodeDataMapInProgress()
            .get(fqdn).getDataMap().get(agentCommandType);
        // deep copy
        NodeReqResponse nrrNewInProgress = new NodeReqResponse(nrrSourceInProgress);
        // TODO: not tested target must already have NodeData
       
        if(! adp.allAgentData.get(nodeGroupTypeTarget).getNodeDataMapInProgress()
            .containsKey(fqdn)){
           NodeData nd = new NodeData(fqdn);
           adp.allAgentData.get(nodeGroupTypeTarget).getNodeDataMapInProgress()
            .put(fqdn, nd);
        }
       
        adp.allAgentData.get(nodeGroupTypeTarget).getNodeDataMapInProgress()
View Full Code Here

     * From Valid NodeDataMap; and only update the valid data
     */
    for (Entry<String, NodeData> entry : ngdm.getNodeDataMapValid()
        .entrySet()) {

      NodeData nodeData = entry.getValue();
      if (nodeData.getDataMap().containsKey(agentCommand)) {

        NodeReqResponse nodeReqResponse = nodeData.getDataMap().get(
            agentCommand);

        if (nodeReqResponse == null) {
          nodeReqResponse = new NodeReqResponse();
          nodeReqResponse.setDefaultEmptyReqestContent();

          nodeData.getDataMap().put(agentCommand, nodeReqResponse);
        }

        // Safeguard!! When the wisbVarValue is "NA" (e.g. fail to get
        // the wisb) should alert that
        // Safeguard: if NA, then dont run it!
View Full Code Here

          .getMap().entrySet()) {

        String replaceVarKey = entryReplaceMap.getKey();
        String replaceVarValue = entryReplaceMap.getValue();

        NodeData nodeData = entry.getValue();
        if (nodeData.getDataMap().containsKey(agentCommand)) {

          NodeReqResponse nodeReqResponse = nodeData.getDataMap()
              .get(agentCommand);

          if (nodeReqResponse == null) {
            nodeReqResponse = new NodeReqResponse();
            nodeReqResponse.setDefaultEmptyReqestContent();

            nodeData.getDataMap()
                .put(agentCommand, nodeReqResponse);
          }

          // Safeguard!! When the wisbVarValue is "NA" (e.g. fail to
          // get
View Full Code Here

TOP

Related Classes of models.data.NodeData

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.