Exemplo n.º 1
0
 /**
  * Add TdbAus for like (starts with) the specified TdbAu name.
  *
  * @param tdbAuName the name of the AU to select
  * @param tdbAus the collection to add to
  * @return <code>true</code> if TdbAus were added to the collection
  */
 public boolean getTdbAusLikeName(String tdbAuName, Collection<TdbAu> aus) {
   boolean added = false;
   for (TdbPublisher publisher : tdbPublisherMap.values()) {
     added |= publisher.getTdbAusLikeName(tdbAuName, aus);
   }
   return added;
 }
Exemplo n.º 2
0
 /**
  * Return the number of TdbTitles in this Tdb.
  *
  * @return the total TdbTitle count
  */
 public int getTdbTitleCount() {
   int titleCount = 0;
   for (TdbPublisher publisher : tdbPublisherMap.values()) {
     titleCount += publisher.getTdbTitleCount();
   }
   return titleCount;
 }
Exemplo n.º 3
0
 /**
  * Adds to a collection of TdbTitles like (starts with) the specified title name across all
  * publishers.
  *
  * @param titleName the title name
  * @param titles a collection of matching titles
  * @return a collection of TdbTitles that match the title name
  */
 public boolean getTdbTitlesLikeName(String titleName, Collection<TdbTitle> titles) {
   boolean added = false;
   if (titleName != null) {
     for (TdbPublisher publisher : tdbPublisherMap.values()) {
       added |= publisher.getTdbTitlesLikeName(titleName, titles);
     }
   }
   return added;
 }
Exemplo n.º 4
0
 /** Add to a collection of TdbAus for this TDB that match the ISBN. */
 public boolean getTdbAusByIsbn(String isbn, Collection<TdbAu> matchingTdbAus) {
   boolean added = false;
   if (isbn != null) {
     for (TdbPublisher tdbPublisher : tdbPublisherMap.values()) {
       added |= tdbPublisher.getTdbAusByIsbn(matchingTdbAus, isbn);
     }
   }
   return added;
 }
 void loadKeyStores() {
   List<LockssKeyStore> lst = new ArrayList<LockssKeyStore>(keystoreMap.values());
   for (LockssKeyStore lk : lst) {
     try {
       lk.load();
     } catch (Exception e) {
       log.error("Can't load keystore " + lk.getName(), e);
       keystoreMap.remove(lk.getName());
     }
   }
 }
Exemplo n.º 6
0
 /**
  * Get a title for the specified issn.
  *
  * @param issn the issn
  * @return the title for the titleId or <code>null</code. if not found
  */
 public TdbTitle getTdbTitleByIssn(String issn) {
   if (issn != null) {
     for (TdbPublisher publisher : tdbPublisherMap.values()) {
       TdbTitle title = publisher.getTdbTitleByIssn(issn);
       if (title != null) {
         return title;
       }
     }
   }
   return null;
 }
Exemplo n.º 7
0
 /**
  * Get the title for the specified titleId.
  *
  * @param titleId the titleID
  * @return the title for the titleId or <code>null</code. if not found
  */
 public TdbTitle getTdbTitleById(String titleId) {
   if (titleId != null) {
     for (TdbPublisher publisher : tdbPublisherMap.values()) {
       TdbTitle title = publisher.getTdbTitleById(titleId);
       if (title != null) {
         return title;
       }
     }
   }
   return null;
 }
Exemplo n.º 8
0
  /**
   * Adds a collection of pluginIds for TdbAus that are different from those in this Tdb.
   *
   * @param pluginIds the set of pluginIds
   * @param otherTdb a Tdb
   */
  private void addPluginIdsForDifferences(Set<String> pluginIds, Tdb otherTdb) {
    Map<String, TdbPublisher> tdbPublishers = otherTdb.getAllTdbPublishers();

    for (TdbPublisher tdbPublisher : tdbPublishers.values()) {
      if (!this.tdbPublisherMap.containsKey(tdbPublisher.getName())) {
        // add pluginIds for publishers in tdb that are not in this Tdb
        tdbPublisher.addAllPluginIds(pluginIds);
      }
    }

    for (TdbPublisher thisPublisher : tdbPublisherMap.values()) {
      TdbPublisher tdbPublisher = tdbPublishers.get(thisPublisher.getName());
      if (tdbPublisher == null) {
        // add pluginIds for publisher in this Tdb that is not in tdb
        thisPublisher.addAllPluginIds(pluginIds);
      } else {
        // add pluginIds for publishers in both Tdbs that are different
        thisPublisher.addPluginIdsForDifferences(pluginIds, tdbPublisher);
      }
    }
  }