Package com.melitronic.domain.entity

Examples of com.melitronic.domain.entity.EnvironmentUsage


        ArrayList<EnvironmentUsage> list = new ArrayList<EnvironmentUsage>();
          for (EnvironmentUsage eu : implementationPhase.getEnvironmentUsage()) {
            list.add(eu);
          }
          for (int i=0; i<list.size(); i++) {
            EnvironmentUsage eu = list.get(i);
            eu.getProduct().iterator().next().getEnvironmentUsage().remove(eu);
            eu.getProduct().remove(eu);
            eu.getEnvironment().getEnvironmentUsage().remove(eu);
            eu.getImplementationPhase().getEnvironmentUsage().remove(eu);
            em.remove(eu);
          }
         
      }
     
      implementationPhase.setDeployment(deployment);
     
      persist(implementationPhase, em, context);
     
      EnvironmentUsage eu = new EnvironmentUsage();
      eu.setStartTime(implementationPhase.getStartTime());
      eu.setEndTime(implementationPhase.getEndTime());
      eu.getProduct().add(product);
      eu.setImplementationPhase(implementationPhase);
      eu.setEnvironment(environment);
      implementationPhase.getEnvironmentUsage().add(eu);
      persist(eu, em, context);
     
      return implementationPhase;
View Full Code Here


    environment.setName("Env1");
    environment.setDescription("edededede");
    environment.setIp("123.23.3.123");
    PmDeployment.instance().persist(environment, em, context);
   
    EnvironmentUsage eu = new EnvironmentUsage();
    eu.setStartTime(scal);
    eu.setEndTime(ecal);
    eu.setImplementationPhase(ip);
    eu.setEnvironment(environment);
    eu.getProduct().add(product);
    product.getEnvironmentUsage().add(eu);
    PmDeployment.instance().persist(eu, em, context);
   
    ip = new ImplementationPhase();
    ip.setPhaseType(ImplementationPhaseType.INTEGRATION_TEST);
    scal = GregorianCalendar.getInstance();
    scal.setTimeInMillis(System.currentTimeMillis() + (22*24*60*60*1000));
    ip.setStartTime(scal);
    ecal = GregorianCalendar.getInstance();
    ecal.setTimeInMillis(System.currentTimeMillis() + (30*24*60*60*1000));
    ip.setEndTime(ecal);
    ip.setDeployment(deployment);
    PmDeployment.instance().persist(ip, em, context);
   
    environment = new Environment();
    environment.setName("Env2");
    environment.setDescription("wwwwwwwwww");
    environment.setIp("123.23.3.125");
    PmDeployment.instance().persist(environment, em, context);
   
    eu = new EnvironmentUsage();
    eu.setStartTime(scal);
    eu.setEndTime(ecal);
    eu.setImplementationPhase(ip);
    eu.setEnvironment(environment);
    eu.getProduct().add(product);
    product.getEnvironmentUsage().add(eu);
    PmDeployment.instance().persist(eu, em, context);
   
  }
View Full Code Here

 
  public Environment getEnvironment(com.melitronic.rmapp.model.ImplementationPhase implementationPhase) {
    for (ImplementationPhase ip : getImplementationPhases(getSelectedDeployment())) {
      if (ip.getId() != null && implementationPhase.getId() != null && ip.getId().longValue() == implementationPhase.getId().longValue()) {
        if ( ip.getEnvironmentUsage() != null && ip.getEnvironmentUsage().size() > 0 ) {
          EnvironmentUsage eu = ip.getEnvironmentUsage().iterator().next();
          if (eu.getEnvironment() != null) {
            return eu.getEnvironment();
          }
        }
      }
     }
   
View Full Code Here

      setPhaseType(ip.getPhaseType());
      setStartTime(ip.getStartTime());
      setEndTime(ip.getEndTime());
     
      if ( ip.getEnvironmentUsage() != null && ip.getEnvironmentUsage().size() > 0 ) {
        EnvironmentUsage eu = ip.getEnvironmentUsage().iterator().next();
        if (eu.getEnvironment() != null) {
          setEnvironmentName(eu.getEnvironment().getName());
        }
      }

  }
View Full Code Here

TOP

Related Classes of com.melitronic.domain.entity.EnvironmentUsage

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.