Package com.alu.e3.data.model

Examples of com.alu.e3.data.model.Instance


    synchronized (this) {
      nodes = upGateways.toArray(nodes);
    }
   
    for (int i = 0; i < nodes.length; i++) {
      Instance node = nodes[i];
     
      if (!upGatewaysActive.contains(node) && checkIfUp(getIPWithArea(node), E3Constant.E3GATEWAY_ACTIVE)) {
        logger.info("A gateway became active: {}", node);
       
        upGatewaysActive.add(node); // keep the node
        Instance newNode = new Instance(node);
        newNode.setType(E3Constant.E3GATEWAY_ACTIVE);
        topologyClient.addInstance(newNode);
      }
    }
  }
View Full Code Here


    Instance[] nodes = new Instance[0];
   
    nodes = upSpeakers.toArray(nodes);
   
    for (int i = 0; i < nodes.length; i++) {
      Instance node = nodes[i];
      if (!upSpeakersActive.contains(node) && checkIfUp(getIPWithArea(node), E3Constant.E3SPEAKER_ACTIVE)) {
        logger.info("A speaker became elected: {}", node);
       
        upSpeakersActive.add(node); // keep the node
        Instance newNode = new Instance(node);
        newNode.setType(E3Constant.E3SPEAKER_ACTIVE);
        topologyClient.addInstance(newNode);
      }
    }
  }
View Full Code Here

    Instance[] nodes = new Instance[0];
   
    nodes = upNodes.toArray(nodes);
   
    for (int i = 0; i < nodes.length; i++) {
      Instance node = nodes[i];
      if (!checkIfUp(getIPWithArea(node), type)) {
        logger.info("A node became down: {}", node);
       
        upNodes.remove(node);
       
        if (downNodes != null) {
          downNodes.add(node);
        }
       
        Instance newNode = new Instance(node);
        newNode.setType(type);
        topologyClient.deleteInstance(newNode);
      }
    }
  }
View Full Code Here

    Instance[] nodes = new Instance[0];
   
    nodes = downNodes.toArray(nodes);
   
    for (int i = 0; i < nodes.length; i++) {
      Instance node = nodes[i];
      if (checkIfUp(getIPWithArea(node), type)) {
        logger.info("A node became up: {}", node);

        downNodes.remove(node);
        upNodes.add(node);
View Full Code Here

  public static Instance getManagerByIP(String managerHostName, String managerIP, List<Instance> instances, final CategoryLogger logger) throws NonExistingManagerException {
   
    boolean found = false;
    Iterator<Instance> iter = instances.iterator();
   
    Instance manager = null;
    logger.debug("Calling getManagerByIP with hostName='{}' and ip='{}'", managerHostName, managerIP);
    while (!found && iter.hasNext()) {
      Instance currentInstance = iter.next();
      String currentIP = currentInstance.getInternalIP();
      if (currentIP == null) {
        logger.warn("Encountered instance in topology with null internal IP: {}", currentInstance);
        continue;
      }
      logger.debug("Comparing manager ip '{}' with current instance internal ip '{}'", managerIP, currentIP);
View Full Code Here

    }

    // Instance type added need to be filtered
    if(E3Constant.E3GATEWAY.equals(event.getType())) {
     
      Instance gateway = event.getInstance();
     
      if (gateway == null) {
        logger.warn("No instance set on event");
        return;
      }
View Full Code Here

        if(logger.isDebugEnabled()){
          logger.debug("DataManager initializing cache tables");
        }

        Instance dsInfo = dsInfoList.get(0);

        Map<String, String> properties = new HashMap<String, String>();

        properties.put("map-store-ip", dsInfo.getInternalIP());
        properties.put("map-store-port", dsInfo.getPort());
        properties.put("map-store-user", dsInfo.getUser());
        properties.put("map-store-password", dsInfo.getPassword());

        properties.put("map-store-name", "apiDetails");
        setCachingTableApiDetails(cacheManager.createTable("cachingTableApiDetails", false, properties));
        properties.put("map-store-name", "authDetails");
        setCachingTableAuthDetails(cacheManager.createTable("cachingTableAuthDetails", false, properties));
View Full Code Here

      /* copy now the array to avoid concurency problems. */
      Instance[] tabInstances = new Instance[0];
      tabInstances = list.toArray(tabInstances);

      for (int i = 0; i < tabInstances.length; i++) {
        Instance inst = tabInstances[i];

        if (area == null || area.equals(inst.getArea()))
          set.add(inst.getInternalIP());
      }
    }

    return set;
  }
View Full Code Here

      /* copy now the array to avoid concurency problems. */
      Instance[] tabInstances = new Instance[0];
      tabInstances = list.toArray(tabInstances);

      for (int i = 0; i < tabInstances.length; i++) {
        Instance inst = tabInstances[i];

        if (area == null || area.equals(inst.getArea()))
          set.add(inst.getExternalIP());
      }
    }

    return set;
  }
View Full Code Here

   
   
    ArrayList<Instance> list = new ArrayList<Instance>();

    for (int i = 0; i < tabInstances.length; i++) {
      Instance inst = tabInstances[i];

      if (area == null || area.equals(inst.getArea()))
        list.add(inst);
    }

    return list;
  }
View Full Code Here

TOP

Related Classes of com.alu.e3.data.model.Instance

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.