/**
  * Factory method to create new LockssRepository instances.
  *
  * @param au the {@link ArchivalUnit}
  * @return the new LockssRepository instance
  */
 public static LockssRepository createNewLockssRepository(ArchivalUnit au) {
   String root = getRepositoryRoot(au);
   if (root == null || root.equals("null")) {
     logger.error("No repository dir set in config");
     throw new LockssRepository.RepositoryStateException("No repository dir set in config");
   }
   String auDir = LockssRepositoryImpl.mapAuToFileLocation(root, au);
   if (logger.isDebug2()) {
     logger.debug2("repo: " + auDir + ", au: " + au.getName());
   }
   staticCacheLocation = extendCacheLocation(root);
   LockssRepositoryImpl repo = new LockssRepositoryImpl(auDir);
   Plugin plugin = au.getPlugin();
   if (plugin != null) {
     LockssDaemon daemon = plugin.getDaemon();
     if (daemon != null) {
       RepositoryManager mgr = daemon.getRepositoryManager();
       if (mgr != null) {
         mgr.setRepositoryForPath(auDir, repo);
       }
     }
   }
   return repo;
 }
Пример #2
0
 public void init(ServletConfig config) throws ServletException {
   super.init(config);
   daemon = getLockssDaemon();
   pluginMgr = daemon.getPluginManager();
   pollManager = daemon.getPollManager();
   crawlMgr = daemon.getCrawlManager();
   cfgMgr = daemon.getConfigManager();
   rmtApi = daemon.getRemoteApi();
   try {
     dbMgr = daemon.getDbManager();
     metadataMgr = daemon.getMetadataManager();
   } catch (IllegalArgumentException ex) {
   }
 }