Package uk.ac.bbsrc.tgac.miso.core.manager

Examples of uk.ac.bbsrc.tgac.miso.core.manager.MisoRequestManager


    }

    //set up alerting
    if ("true".equals(misoProperties.get("miso.alerting.enabled"))) {
      //set up indexers and alerters
      MisoRequestManager rm = new MisoRequestManager();
      rm.setProjectStore((ProjectStore)context.getBean("projectStore"));
      rm.setRunStore((RunStore)context.getBean("runStore"));
      rm.setRunQcStore((RunQcStore) context.getBean("runQcStore"));
      rm.setPoolStore((PoolStore)context.getBean("poolStore"));

      SecurityManager sm = (com.eaglegenomics.simlims.core.manager.SecurityManager)context.getBean("securityManager");

      RunAlertManager ram = (RunAlertManager)context.getBean("runAlertManager");
      ram.setRequestManager(rm);
      ram.setSecurityManager(sm);

      ProjectAlertManager pam = (ProjectAlertManager)context.getBean("projectAlertManager");
      pam.setRequestManager(rm);
      pam.setSecurityManager(sm);

      PoolAlertManager poam = (PoolAlertManager)context.getBean("poolAlertManager");
      poam.setRequestManager(rm);
      poam.setSecurityManager(sm);
    }

    if (misoProperties.containsKey("miso.db.caching.mappers.enabled")) {
      boolean mapperCachingEnabled = Boolean.parseBoolean(misoProperties.get("miso.db.caching.mappers.enabled"));
      //TODO do something with this - probably set caching throughout DAOs
    }

    if ("true".equals(misoProperties.get("miso.db.caching.precache.enabled"))) {
      log.info("Precaching. This may take a while.");
      try {
        RequestManager rm = (RequestManager)context.getBean("requestManager");

        User userdetails = new User("precacher", "none", true, true, true, true, AuthorityUtils.createAuthorityList("ROLE_ADMIN,ROLE_INTERNAL"));
        PreAuthenticatedAuthenticationToken newAuthentication = new PreAuthenticatedAuthenticationToken(userdetails, userdetails.getPassword(), userdetails.getAuthorities());
        newAuthentication.setAuthenticated(true);
        newAuthentication.setDetails(userdetails);

        try {
          SecurityContext sc = SecurityContextHolder.getContextHolderStrategy().getContext();
          sc.setAuthentication(newAuthentication);
          SecurityContextHolder.getContextHolderStrategy().setContext(sc);
        }
        catch (AuthenticationException a) {
          a.printStackTrace();
        }

        log.info("\\_ projects...");
        log.info("" + rm.listAllProjects().size());
        log.info("\\_ samples...");
        log.info("" + rm.listAllSamples().size());
        log.info("\\_ libraries...");
        log.info("" + rm.listAllLibraries().size());
        log.info("\\_ dilutions...");
        log.info("" + rm.listAllLibraryDilutions().size());
        log.info("" + rm.listAllEmPcrDilutions().size());
        log.info("\\_ pools...");
        log.info("" + rm.listAllPools().size());
        log.info("\\_ plates...");
        log.info("" + rm.listAllPlates().size());
        log.info("\\_ runs...");
        log.info("" + rm.listAllRuns().size());
      }
      catch (IOException e) {
        e.printStackTrace();
      }
    }
View Full Code Here

TOP

Related Classes of uk.ac.bbsrc.tgac.miso.core.manager.MisoRequestManager

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.