}
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();
}
}