Package com.alu.e3.data.model

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


    while (itKeys.hasNext()) {
      Instance[] tabInstances = new Instance[0];
      tabInstances = cachingTableTopology.get(itKeys.next()).toArray(tabInstances);

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

        if (CommonTools.isLocal(inst.getExternalIP()) || CommonTools.isLocal(inst.getInternalIP())) {
          currentArea = inst.getArea();
          return currentArea;
        }
      }
    }
View Full Code Here


              if (logger.isDebugEnabled()) {
                logger.debug("Checking IP : " + myIp);
              }
             
              //if there is an instance associated with myIP, that is me
              Instance instance = ipToInstance.get(myIp);
              if (instance != null) {
                whoIAm.put(type, instance);
                if (logger.isDebugEnabled()) {
                  logger.debug("Found an IP match with Instance " + instance.getName());
                }
                return instance;
              }
            }
          }
View Full Code Here

 
  private TDRCollectorInstanceWatcher tdrCollectorInstanceWatcher;
  private ITopologyClient topologyClient;

  private Instance createInstance(String type, String intIP, String extIP, SSHKey key) {
    Instance instance = new Instance();
   
    instance.setType(type);
    instance.setArea("myArea");
    instance.setInternalIP(intIP);
    instance.setExternalIP(extIP);
    instance.setSSHKey(key);
    instance.setUser(USER_NAME);
   
    return instance;
  }
View Full Code Here

    initializeTestSetup(1, 1, 1, true);
    tdrCollectorInstanceWatcher.init();
    assertTrue("Key file was not created.", verifyKeyExists());
    assertTrue("Config file was not created.", verifyConfigExists());
    assertTrue("Config file was not correctly built.", verifyValidConfig(1));
    Instance gate = createInstance(E3Constant.E3GATEWAY, "1.1.1.1", "2.1.1.1", null);
    Instance manager = createInstance(E3Constant.E3MANAGER, "1.1.2.1", "2.1.2.1", null);
    addInstance(gate);
    addInstance(manager);
    assertTrue("Key file did not remain after adding non-collection instances.", verifyKeyExists());
    assertTrue("Config file did not remain after adding non-collection instances.", verifyConfigExists());
    assertTrue("Config file did not remain correctly built after adding non-collection instances.", verifyValidConfig(1));
View Full Code Here

    tdrCollectorInstanceWatcher.init();

    assertTrue("Key file was not created.", verifyKeyExists());
    assertTrue("Config file was not created.", verifyConfigExists());
    assertTrue("Config file was not correctly built.", verifyValidConfig(2));
    Instance inst1 = createInstance(E3Constant.TDR_COLLECTOR, "1.1.3.2", "2.1.3.2", null);
    Instance inst2 = createInstance(E3Constant.TDR_COLLECTOR, "1.1.3.3", "2.1.3.3", null);
    addInstance(inst1);
    addInstance(inst2);
    assertTrue("Key file did not remain after adding collection instances.", verifyKeyExists());
    assertTrue("Config file did not remain after adding collection instances.", verifyConfigExists());
    assertTrue("Config file did not remain correctly built after adding collection instances.", verifyValidConfig(4));
View Full Code Here

    props.putAll(identity.getApi().getProperties());
    Iterator<CallDescriptor> it = identity.getCallDescriptors().iterator();
    while(it.hasNext()){
      CallDescriptor cd = it.next();
      Policy policy = cd.getPolicy();
      if(policy != null){
        props.putAll(policy.getProperties());
      }
    }

    if(identity.getAuth() != null)
      props.putAll(identity.getAuth().getProperties());
View Full Code Here

  }

  private static final LoadBalancing toDataModel(com.alu.e3.prov.restapi.model.LoadBalancing loadBalancing) {
    if (loadBalancing==null) throw new IllegalArgumentException("loadBalancing must not be null");

    LoadBalancing lb = new LoadBalancing();
    lb.setLoadBalancingType(toDataModel(loadBalancing.getLoadBalancingType()));

    if(loadBalancing.getTargetHealthCheck() != null)
      lb.setTargetHealthCheck(toDataModel(loadBalancing.getTargetHealthCheck()));

    if(loadBalancing.getFailOver() != null)
      lb.setFailOver(toDataModel(loadBalancing.getFailOver()));

    return lb;
  }
View Full Code Here

  }

  public static final QuotaRLBucket toDataModel(com.alu.e3.prov.restapi.model.AuthIdsNoIdType authIds) {
    if (authIds==null) throw new IllegalArgumentException("authIds must not be null");

    QuotaRLBucket ids = new QuotaRLBucket();
    ids.getAuthIds().addAll(authIds.getAuthIds());
    ids.setId(authIds.getId());

    return ids;
  }
View Full Code Here

  private static final QuotaRLBucket toDataModel(com.alu.e3.prov.restapi.model.AuthIdsType authIds) {
    if (authIds==null) throw new IllegalArgumentException("authIds must not be null");
    if (authIds.getId()==null) throw new IllegalArgumentException("id must not be null");

    QuotaRLBucket ids = new QuotaRLBucket();
    ids.getAuthIds().addAll(authIds.getAuthIds());
    ids.setId(authIds.getId());

    return ids;
  }
View Full Code Here

    return t;
  }

  private static final SBAuthentication toDataModel(Authentication authentication) {
    if (authentication==null) return null; // throw new IllegalArgumentException("authentication must not be null");
    SBAuthentication s = new SBAuthentication();
    s.setType(authentication.getType());
    for (Key k : authentication.getData().getKey())
      s.getKeys().put(k.getName(), k.getValue());
    return s;
  }
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.