Class RepositoryManager

java.lang.Object
org.dlese.dpc.repository.RepositoryManager

public class RepositoryManager extends Object
Manages a repository of metadata files for use in discovery, cataloging, OAI and other applications. Provides and maintains a Lucene index of the metadata, with support for multiple collections and metadata formats.

Version:
$Id: RepositoryManager.java,v 1.187.2.1 2012/02/15 23:28:03 jweather Exp $
Author:
John Weatherley
  • Field Details

  • Constructor Details

    • RepositoryManager

      public RepositoryManager(File repositoryConfigDir, String repositoryDataDir, int updateFrequency, int maxFilesToIndex, boolean removeDocs)
      Constructor for the RepositoryManager. Known uses: OAIProviderServlet.
      Parameters:
      repositoryConfigDir - The directory where config files reside (default search/boosting fields, other config)
      repositoryDataDir - The directory where the repository data and certain configs resides.
      updateFrequency - How often to update the index, in minutes.
      maxFilesToIndex - Max files to index per block.
      removeDocs - True to remove documents completely from the index, false to keep the documents in the index but marked as deleted.
    • RepositoryManager

      public RepositoryManager(File repositoryConfigDir, File itemIndexerConfigDir, String repositoryDataDir, String indexLocation, String indexingStartTime, String indexingDaysOfWeek, RecordDataService recordDataService, boolean removeDocs, boolean reindexAllFiles)
      Constructor for the RepositoryManager. Known uses: DDSServlet.
      Parameters:
      repositoryConfigDir - The directory where config files reside (default search/boosting fields, other config)
      itemIndexerConfigDir - The directory where ItemIndexer configs are located
      repositoryDataDir - Directory where admin data is stored.
      indexLocation - Directory where index is stored.
      indexingStartTime - The time of day to start the indexer, in H:mm, for example 0:11 or 23:11.
      indexingDaysOfWeek - The days of week to run the indexer as a comma separated list of integers, for example 1,3,5 where 1=Sunday, 2=Monday, 7=Saturday etc. or null for all days.
      recordDataService - The RecordDataService to use, or null if none is needed.
      removeDocs - True to remove documents completely from the index, false to keep the documents in the index but marked as deleted.
      reindexAllFiles - True to instruct the indexer to delete and reindex each file during each indexing pass, false to only reindex those files whoes mod time have changed (more efficient).
  • Method Details

    • setAdditionalIndices

      public void setAdditionalIndices(Hashtable additionalIndexers)
    • init

      public int init(boolean indexCollectionRecords)
      Init method initializes the data for serving.
      Parameters:
      indexCollectionRecords - True to index the collections records when called
      Returns:
      1 iff successful.
    • destroy

      public void destroy()
      Tear down and clean up by gracefully stopping threads.
    • getIndex

      public SimpleLuceneIndex getIndex()
      Gets the index attribute of the RepositoryManager object
      Returns:
      The index value
    • deleteIndex

      public void deleteIndex()
      Deletes the repository index and re-initializes a new, empty one in its place.
    • stopIndexing

      public void stopIndexing()
      Instructs the indexer to stop indexing wherever its at in the process. This method may take several seconds to return.
    • isIndexing

      public boolean isIndexing()
      Determins whether indexing is in progress.
      Returns:
      True if indexing is in progress, false if not
    • setDupItemsIndex

      public void setDupItemsIndex(SimpleLuceneIndex dupItemsIndex)
      Sets the de-duping index to use.
      Parameters:
      dupItemsIndex - The new dupItemsIndex value
    • getIndexLastModifiedCount

      public long getIndexLastModifiedCount()
      Gets the version number of the last time the repository index was modified by adding, deleting or changing an item. The version number counts the number of times the index was modified.
      Returns:
      The indexLastModifiedCount value
    • getSetStatusModifiedTime

      public long getSetStatusModifiedTime()
      Gets the time the sets configuation status was last modified (enabled, disabled, added, deleted).
      Returns:
      The setStatusModifiedTime value
    • getIndexingMessages

      public ArrayList getIndexingMessages()
      Gets the indexingMessages attribute of the RepositoryManager object
      Returns:
      The indexingMessages value
    • getConfigDir

      public File getConfigDir()
      Gets the directory where the RepositoryManager config files reside.
      Returns:
      The configDir value
    • getIdMapperExclusionFilePath

      public String getIdMapperExclusionFilePath()
      Gets the path to an XML file the defines IDs that the IDMapper service should exclude from its list of duplicates.
      Returns:
      The idMapperExclusionFilePath, or null if none used
    • setIdMapperExclusionFilePath

      public void setIdMapperExclusionFilePath(String filePath)
      Sets the path to an XML file the defines IDs that the IDMapper service should exclude from its list of duplicates. Set to null to use none
      Parameters:
      filePath - The new idMapperExclusionFilePath value, or null to specify none
    • getUpdateFrequency

      public int getUpdateFrequency()
      Gets the interval by which the index is updated to check for changes in the meatdata files, in minutes. A value of 0 indicates the index is not updated automatically.
      Returns:
      The updateFrequency in minutes.
    • getIndexingStartTime

      public Date getIndexingStartTime()
      Gets the date the indexer scheduled to start.
      Returns:
      The the date the indexer scheduled to start, or null if not available.
    • getIndexingDaysOfWeek

      public int[] getIndexingDaysOfWeek()
      Gets the days of the week the indexer will run as an array of Calendar.DAY_OF_WEEK fields, or null to indicate all days of the week.
      Returns:
      The indexingDaysOfWeek or null for all days
    • updateVocab

      public void updateVocab(MetadataVocab newVocab)
      Update the current MetadataVocab with a new one.
      Parameters:
      newVocab - The new MetadataVocab object.
    • setMetadataVocabAudienceDefault

      public void setMetadataVocabAudienceDefault(String audience)
      Sets the metadataVocabAudienceDefault attribute of the RepositoryManager object
      Parameters:
      audience - The new metadataVocabAudienceDefault value
    • getMetadataVocabAudienceDefault

      public String getMetadataVocabAudienceDefault()
      Gets the metadataVocabAudienceDefault attribute of the RepositoryManager object
      Returns:
      The metadataVocabAudienceDefault value
    • setMetadataVocabLanguageDefault

      public void setMetadataVocabLanguageDefault(String language)
      Sets the metadataVocabLanguageDefault attribute of the RepositoryManager object
      Parameters:
      language - The new metadataVocabLanguageDefault value
    • getMetadataVocabLanguageDefault

      public String getMetadataVocabLanguageDefault()
      Gets the metadataVocabLanguageDefault attribute of the RepositoryManager object
      Returns:
      The metadataVocabLanguageDefault value
    • getFileIndexingService

      public FileIndexingService getFileIndexingService()
      Gets the fileIndexingService attribute.
      Returns:
      The fileIndexingService.
    • getNumIdentifiersResults

      public String getNumIdentifiersResults()
      Gets the numIdentifiersResults per resumptionToken to be returned in OAI ListIdentifiers requests.
      Returns:
      The numIdentifiersResults value
    • setNumIdentifiersResults

      public void setNumIdentifiersResults(String value)
      Sets the numIdentifiersResults per resumptionToken to be returned in OAI ListIdentifiers requests.
      Parameters:
      value - The new numIdentifiersResults value
    • getRemoveInvalidRecords

      public String getRemoveInvalidRecords()
      Gets the removeInvalidRecords attribute, which is true|false.
      Returns:
      true|false or null if not found.
    • setRemoveInvalidRecords

      public void setRemoveInvalidRecords(String value)
      Sets the removeInvalidRecords attribute. The input must be "true" or "false".
      Parameters:
      value - The String "true" or "false".
    • getValidateRecords

      public String getValidateRecords()
      Gets the getValidateRecords attribute, which is true|false.
      Returns:
      true|false or null if not found.
    • setValidateRecords

      public void setValidateRecords(String value)
      Sets the setValidateRecords attribute. The input must be "true" or "false".
      Parameters:
      value - The String "true" or "false".
    • getNumRecordsResults

      public String getNumRecordsResults()
      Gets the numRecordsResults per resumptionToken to be returned in OAI ListRecords requests.
      Returns:
      The numRecordsResults value
    • setNumRecordsResults

      public void setNumRecordsResults(String value)
      Sets the numRecordsResults per resumptionToken to be returned in OAI ListRecords requests.
      Parameters:
      value - The new numRecordsResults value
    • getExampleID

      public String getExampleID()
      Get an example ID that might be disiminated from this repository.
      Returns:
      An example ID from this repository.
    • getProviderStatus

      public String getProviderStatus()
      Gets the status of the OAI data provider.
      Returns:
      The providerStatus value [ENABLED or DISABLED]
    • setProviderStatus

      public void setProviderStatus(String value) throws Exception
      Sets the status of the OAI data provider.
      Parameters:
      value - The new providerStatus value [ENABLED or DISABLED]
      Throws:
      Exception - NOT YET DOCUMENTED
    • getHarvesterStatus

      public String getHarvesterStatus()
      Gets the harvesterStatus attribute of the RepositoryManager object
      Returns:
      The harvesterStatus value [ENABLED or DISABLED]
    • setHarvesterStatus

      public void setHarvesterStatus(String value)
      Sets the harvesterStatus attribute of the RepositoryManager object
      Parameters:
      value - The new harvesterStatus value [ENABLED or DISABLED]
    • getRepositoryIdentifier

      public String getRepositoryIdentifier()
      Gets the repositoryIdentifier for this provider, for example 'dlese.org'. This equates to the namespace-identifier portion of the OAI Identifier Format. An example namespace-identifier is 'dlese.org'. See OAI Identifier Format for information.
      Returns:
      The repositoryIdentifier, which is the namespace-identifier portion of the OAI identifier format.
    • getOaiIdPrefix

      public String getOaiIdPrefix()
      Gets the OAI Identifier Format's scheme and namespace-identifier prefix, for example 'oai:dlese.org:'. This prefix should be appended to the beginning of the local-identifier to create the fully-qualified OAI Identifier for a given item in the repository. See OAI Identifier Format for information.
      Returns:
      The OAI Identifier Format's scheme and namespace-identifier prefix, for example 'oai:dlese.org:'.
    • setRepositoryIdentifier

      public void setRepositoryIdentifier(String value)
      Sets the oaiIdentifier attribute of the RepositoryManager object
      Parameters:
      value - The new oaiIdentifier value
    • getProtocolVersion

      public String getProtocolVersion()
      Gets the protocolVersion attribute of the RepositoryManager object
      Returns:
      The protocolVersion value
    • getRepositoryName

      public String getRepositoryName()
      Gets the repositoryName attribute of the RepositoryManager object
      Returns:
      The repositoryName value
    • setRepositoryName

      public void setRepositoryName(String value)
      Sets the repositoryName attribute of the RepositoryManager object
      Parameters:
      value - The new repositoryName value
    • getEarliestDatestamp

      public String getEarliestDatestamp()
      Gets the earliestDatestamp attribute of the RepositoryManager object
      Returns:
      The earliestDatestamp value
    • getDeletedRecord

      public String getDeletedRecord()
      Gets the OAI-PMH deletedRecord support, which depends on whether deleted records are removed from the repository index or kept as status deleted. Valid responses include "no" (deletions not keept or advertised) or "transient" (deletions are kept and advertised, unless the repository index is reset).
      Returns:
      The String "no" or "transient"
    • getGranularity

      public String getGranularity()
      Gets the granularity attribute of the RepositoryManager object. Legitimate values are YYYY-MM-DD and YYYY-MM-DDThh:mm:ssZ with meanings as defined in ISO8601.
      Returns:
      The granularity value
    • setGranularity

      public void setGranularity(String value)
      Sets the granularity attribute of the RepositoryManager object. Legitimate values are YYYY-MM-DD and YYYY-MM-DDThh:mm:ssZ with meanings as defined in ISO8601.
      Parameters:
      value - The new granularity value
    • setProviderBaseUrlEnding

      public void setProviderBaseUrlEnding(String baseUrlEnding)
      Sets the end portion of the OAI baseURL that is being used, for example 'provider'.
      Parameters:
      baseUrlEnding - The new providerBaseUrlEnding value
    • setServerUrl

      public void setServerUrl(String serverUrl)
      Sets the serverUrl (scheme, hostname and port) displayed in the OAI data provider baseUrl and elsewhere. Example values: 'http://www.example.com' or 'http://www.example.com:8080'. If set to null (default), then the scheme, hostname and port number will be determined automatically by examining the URL that was requested by the client.
      Parameters:
      serverUrl - The new serverUrl value
    • getProviderBaseUrl

      public String getProviderBaseUrl(HttpServletRequest req)
      Gets the Base URL that refers to the current OAI provider, for example "http://host:8080/my_oai_context/provider".
      Parameters:
      req - The request.
      Returns:
      The providerBaseUrl value.
    • getCompressions

      public ArrayList getCompressions()
      Gets the compressions attribute of the RepositoryManager object.
      Returns:
      The compressions value
    • addCompression

      public void addCompression(String value)
      Adds a feature to the Compression attribute of the RepositoryManager object. "none" indicates no compression is supported. Others: gzip ; compress.
      Parameters:
      value - The feature to be added to the Compression attribute
    • removeCompression

      public void removeCompression(String value)
      Removes the given compression value.
      Parameters:
      value - The compression value to remove.
    • removeCompression

      public void removeCompression(int i)
      Removes the given compression item.
      Parameters:
      i - The compression ArrayList item to remove.
    • getDescriptions

      public ArrayList getDescriptions()
      Gets the descriptions availalable for this repository.
      Returns:
      The descriptions value
    • getDescription

      public String getDescription(int i)
      Gets the description attribute of the RepositoryManager object
      Parameters:
      i - The index of the description to remove
      Returns:
      The description value
    • addDescription

      public void addDescription(String value)
      Adds a feature to the Description attribute of the RepositoryManager object
      Parameters:
      value - The feature to be added to the Description attribute
    • replaceDescription

      public void replaceDescription(int index, String value)
      Add the given admin Description to the repository. The aDescription is used in the Identify request. If the given Description already exists, nothing is changed.
      Parameters:
      index - The index.
      value - The new description
    • removeDescription

      public void removeDescription(String value)
      Remove the given desctiption from the repository.
      Parameters:
      value - The description to remove.
    • removeDescription

      public void removeDescription(int i)
      Remove the given descrtiption item from the repository.
      Parameters:
      i - The description ArrayList index to remove.
    • getTrustedWsIpsArray

      public String[] getTrustedWsIpsArray()
      Gets an array of IP address regular expressions that are trusted for access to non-discoverable items through the web service. The regular expressions may be used directly in the String.matches() method. For example:

      String IP = "128.66.45.88";
      boolean isAuthorized = IP.matches(getTrustedWsIpsArray()[0]);

      Returns:
      array of IP address regular expressions.
    • getTrustedWsIps

      public String getTrustedWsIps()
      Gets a Comma-separated String of IP address regular expressions that are trusted for access to non-discoverable items through the web service.
      Returns:
      Comma-separated String of IP address regular expressions.
    • setTrustedWsIps

      public void setTrustedWsIps(String value)
      Sets the trustedWsIps attribute of the RepositoryManager, which should contain a comma-separated list of IP addresses for IPs that may access non-discoverable items through the web service. These may contain numbers, periods and the * wildcard only, for example 128.166.26.*.
      Parameters:
      value - The new trustedWsIps value
    • getRecord

      public ResultDoc getRecord(String id)
      Gets a single record from the repository by ID.
      Parameters:
      id - The ID for the item
      Returns:
      The record or null if not available
    • getDisabledSetsQuery

      public org.apache.lucene.search.Query getDisabledSetsQuery()
      Gets a Lucene Query for all disabled sets, or null if none.
      Returns:
      The disabledSetsQuery
    • getRecordOai

      public ResultDoc getRecordOai(String id)
      Gets a single record from the repository by ID, restricted to those records that are avaiable/discoverable for OAI.
      Parameters:
      id - The ID for the item
      Returns:
      The record or null if not available
      See Also:
    • getOaiQueryResults

      public ResultDocList getOaiQueryResults(String format, String set, String from, String until) throws Exception
      Gets the results from a standard OAI-PMH ListIdentifiers or ListRecords query or an ODL search request.
      Parameters:
      format - The metadata format.
      set - The set, or null.
      from - The from time, or null.
      until - The until time, or null.
      Returns:
      The queryResults value.
      Throws:
      Exception - If error occues, exception will contain a message
      See Also:
    • getOdlQueryResults

      public ResultDocList getOdlQueryResults(String format, String set, String from, String until, String queryString) throws Exception
      Gets the results of an OAI-PMH ListRecords or ListIdentifiers request or an OLD search. Set queryString to null to perform a standard OAI-PMH search and non-null for ODL search.
      Parameters:
      format - The metadata format.
      set - The set to search over, or null.
      from - The from time, or null.
      until - The until time, or null.
      queryString - Must be non-null to indicate ODL search and null to indicate regular OAI-PMH request.
      Returns:
      The queryResults value.
      Throws:
      Exception - If error occues, exception will contain a message meant for human consumption in response error messages.
      See Also:
    • setOaiFilterQuery

      public void setOaiFilterQuery(String luceneQuery) throws org.apache.lucene.queryParser.ParseException
      Sets a Lucene query that filters the records served by the OAI data provider. Records that match this query will not be served by the OAI data provider. The given filter query persists until this method is called again or the RepositoryManager is reinstantiated. Pass null to this method to remove the filter query.
      Parameters:
      luceneQuery - The Lucene query to filter records
      Throws:
      org.apache.lucene.queryParser.ParseException - If query parse error
    • getFormatsThatCanBeConvertedToFormat

      public ArrayList getFormatsThatCanBeConvertedToFormat(String format)
      Gets all formats that can be converted to the given Format.
      Parameters:
      format - The target format.
      Returns:
      The formatsThatCanBeConvertedToFormat list.
    • getFormatsThatCanBeConvertedToFormats

      public ArrayList getFormatsThatCanBeConvertedToFormats(String[] formats)
      Gets all formats that can be converted to the given Formats.
      Parameters:
      formats - Formats that we want converted to.
      Returns:
      The formatsThatCanBeConvertedToFormats list.
    • getConvertableFormatsQuery

      public final String getConvertableFormatsQuery(String toFormat)
      Gets a query that limits a search to only those xml formats that can be converted to the format indicated. The conversion is done using the XmlConversionService.
      Parameters:
      toFormat - The xml format to convert to
      Returns:
      A query that will return only records that can be converted to the given format, or null if no convertable formats are avialable.
    • getIndexedSets

      public ArrayList getIndexedSets()
      Gets the sets that are in the index.
      Returns:
      A list of set setSecs.
      See Also:
    • getSetSearchKeys

      public List getSetSearchKeys()
      Gets a list of all search keys used to search for sets.
      Returns:
      The setSearchKeys value.
      See Also:
    • getIndexedAccessionStatuses

      public List getIndexedAccessionStatuses()
      Gets a list of all accession statusus in the index.
      Returns:
      All accession statusus in the index.
    • getIndexedIdMapperErrors

      public List getIndexedIdMapperErrors()
      Gets a list of all ID mapper errors that have been indexed.
      Returns:
      The available ID mapper errors, as integer strings.
    • isIdInRepository

      public boolean isIdInRepository(String id)
      Determines whether the given ID is in the repository. Note that if given document was indexed but is not valid, this method MAY return false.
      Parameters:
      id - An ID.
      Returns:
      True if the given ID is in the repository.
    • isSetInIndex

      public boolean isSetInIndex(String set)
      Determines whether the given set is in the repository index. Note that if the set is in the index it may also be disabled or all records in the set may have been moved to status deleted, if the set was removed from the repository.
      Parameters:
      set - A set.
      Returns:
      True if the the given set is in the repository index.
      See Also:
    • canDisseminateFormat

      public boolean canDisseminateFormat(String format)
      Determines whether this repository can disseminate the given format.
      Parameters:
      format - The format.
      Returns:
      True if this repository can dissiminate the format.
    • getAvailableFormats

      public final Hashtable getAvailableFormats()
      Gets all possible metadata formats that may be disiminated by this RepositoryManager. This includes formats that are available by conversion from the native format via the XMLConversionService.
      Returns:
      The metadataFormats available.
      See Also:
    • getAvailableFormatsList

      public List getAvailableFormatsList(String id)
      Gets all possible metadata formats that are available for a given ID.
      Parameters:
      id - The id for the record.
      Returns:
      The metadataFormats available.
    • getAvailableFormatsList

      public List getAvailableFormatsList()
      Gets all possible metadata formats that may be disiminated by this RepositoryManager. This includes formats that are available via the XMLConversionService.
      Returns:
      The metadataFormats available.
    • getIndexedFormats

      public List getIndexedFormats()
      Gets all formats that exist natively in the index. If none exist, and empty list is returned.
      Returns:
      The indexedFormats value or an empty list.
    • getAvailableFormats

      public Hashtable getAvailableFormats(String id)
      Gets all possible metadata formats that are available for a given ID.
      Parameters:
      id - The id for the record.
      Returns:
      The metadataFormats available.
    • isSetConfigured

      public boolean isSetConfigured(String set)
      Determines whether the given set is currently configured in this repository.
      Parameters:
      set - The set key, for example 'dcc'
      Returns:
      True if the given set is currently configured in this repository.
      See Also:
    • isDirectoryConfigured

      public boolean isDirectoryConfigured(File sourceDirectory)
      Determines whether the given directory is configured in the repository. Note: Each directory should only be configured in the repository once. This method can be used to check prior to adding a directory.
      Parameters:
      sourceDirectory - A directory of metadata files.
      Returns:
      True if this directory is configured, false otherwise.
    • isSetEnabled

      public boolean isSetEnabled(String set)
      Determines whether the given set is currently enabled in this repository.
      Parameters:
      set - The name of the set or, if the vocab mgr is being used, the name of the encoded set key.
      Returns:
      True if the given set is currently configured in this repository and is enabled.
    • isSetDisabled

      public boolean isSetDisabled(String set)
      Determines whether the given set is currently disabled in this repository.
      Parameters:
      set - The name of the set or, if the vocab mgr is being used, the name of the encoded set key.
      Returns:
      True if the given set is currently configured in this repository and is disabled.
    • getConfiguredSets

      public ArrayList getConfiguredSets()
      Gets a List of file set key Strings such as 'dcc' or 'comet' that are currently configured in this repository.
      Returns:
      The configuredSets key values, for example 'dcc', 'comet'
    • getConfiguredSetInfos

      public HashMap getConfiguredSetInfos()
      Gets a HashMap of SetInfos (directories of files) that are currently configured in this repository keyed by their set spec, for example dcc. If non, then empty Map is returned.
      Returns:
      The configuredSetInfos
    • getConfiguredFormats

      public ArrayList getConfiguredFormats()
      Gets a List of native file format Strings that are currently configured in this repository. This does not include formats that may be converted from the native formats via the XMLConversionService.
      Returns:
      The file formats in the repository.
      See Also:
    • getEnabledSets

      public ArrayList getEnabledSets()
      Gets the configured sets (directories of files) that are currently enabled in this repository. If the vacab manager is being used then the setSpec will be encoded into the vocab key, else it will not.
      Returns:
      The enabledSets value.
    • getEnabledSetsHashMap

      public HashMap getEnabledSetsHashMap()
      Gets the configured sets that are currently enabled in this repository. If the vocab manager is being used then the setSpecs are encoded, else they are not. Both the key and the values in the HashMap are the same.
      Returns:
      The enabledSets value.
    • getDisabledSetsHashMap

      public HashMap getDisabledSetsHashMap()
      Gets the configured sets that are currently disabled in this repository. If the vocab manager is being used then the setSpecs are encoded, else they are not. Both the key and the values in the HashMap are the same.
      Returns:
      The disabled sets
    • getEnabledSetsQuery

      public final String getEnabledSetsQuery()
      Gets the configured sets that are currently enabled in this repository as a String suitable for use in s Lucene query, or an empty string if no sets are enabled.
      Returns:
      The enabledSetsQuery value.
    • getDiscoverableItemsQuery

      public final String getDiscoverableItemsQuery()
      Gets the query string used to limit searches to only those ADN items-level records that should be displayed in discovery.
      Returns:
      The query used to get only item-level records that are discoverable. The value returned is always non-null.
    • getDiscoverableRecordsQuery

      public final String getDiscoverableRecordsQuery()
      Gets the query string used to limit searches to only those records, of any format (item, collection, anno, etc.), that should be accessable in discovery or via the web service.
      Returns:
      The query used to get only records that are discoverable. The value returned is always non-null.
    • getDiscoverableOaiRecordsQuery

      public final org.apache.lucene.search.Query getDiscoverableOaiRecordsQuery()
      Gets the query string used to limit searches to only those records, of any format (item, collection, anno, etc.), that should be accessable for OAI including 'enabled' deleted records. Removes all records in disabled file directories.

      Refactoring note: Consider using this for method getDiscoverableRecordsQuery() instead.

      Returns:
      The Query used to get only records that are not disabled
    • getNumDiscoverableADNResources

      public final int getNumDiscoverableADNResources()
      Gets the number of descrete ADN item-level resources that have been indexed and are currently discoverable.
      Returns:
      The number of ADN resources that are currently discoverable.
    • getNumDiscoverableResources

      public final int getNumDiscoverableResources()
      Gets the number of descrete resources of any format (adn, dlese_anno, news_opps, etc) that have been indexed and are currently discoverable.
      Returns:
      The number of resources of any format that are currently discoverable.
    • getDrcBoostingQuery

      public final String getDrcBoostingQuery()
      Boost items in the DRC.
      Returns:
      A query String used to boost results that have DRC reviews.
    • getAbsoluteDrcBoostingQuery

      public final String getAbsoluteDrcBoostingQuery()
      Boost items in the DRC absolutely.
      Returns:
      A query String used to boost results that have DRC reviews above all other criteria.
    • getMultiDocBoostingQuery

      public final String getMultiDocBoostingQuery()
      Boost items that have multiple records associated with them.
      Returns:
      A query String used to boost multi-record resources.
    • getDrcBoostFactor

      public String getDrcBoostFactor()
      Gets the boosting factor used to rank items in the DRC.
      Returns:
      The boosting factor used to rank items in the DRC.
    • getMultiDocBoostFactor

      public String getMultiDocBoostFactor()
      Gets the boosting factor used to rank resources that are referenced by more than one record.
      Returns:
      The boosting factor used to rank items in multiple records.
    • setMultiDocBoostFactor

      public void setMultiDocBoostFactor(double boostFactor) throws Exception
      Sets the boosting factor used to rank resources that are referenced by more than one record.
      Parameters:
      boostFactor - The new boosting factor used to rank items in multiple records.
      Throws:
      Exception - If error.
    • setIsOaiPmhEnabled

      public void setIsOaiPmhEnabled(boolean isEnabled)
      Sets whether OAI-PMH ListRecords and ListIdentifiers functionality is enabled for this repository. Set to false to disable regular OAI-PMH ListRecord and ListIdentifier resonses. QDL ListRecord and ListIdentifier requests are not effected.
      Parameters:
      isEnabled - False to disable regular ListRecord and ListIdentifier OAI-PMH responses
    • getIsOaiPmhEnabled

      public boolean getIsOaiPmhEnabled()
      Gets whether OAI-PMH ListRecords and ListIdentifiers functionality is enabled for this repository. False means regular ListRecord and ListIdentifier responses are disabled. QDL ListRecord and ListIdentifier are always available, regardless.
      Returns:
      False means regular ListRecord and ListIdentifier OAI-PMH responses are disabled
    • setDrcBoostFactor

      public void setDrcBoostFactor(double boostFactor) throws Exception
      Sets the boosting factor used to rank items in the DRC. Value must be zero or greater.
      Parameters:
      boostFactor - The new boosting factor used to rank items in the DRC.
      Throws:
      Exception - If error.
    • getTitleBoostFactor

      public String getTitleBoostFactor()
      Deprecated.
      As of 12/2004, boosting behavior is controlled by properties set in the RepositoryManager config.
      Gets the boosting factor used to rank items with matching terms in the title field.
      Returns:
      The boosting factor used to rank items with matching terms in the title field.
    • setTitleBoostFactor

      public void setTitleBoostFactor(double boostFactor) throws Exception
      Deprecated.
      As of 12/2004, boosting behavior is controlled by properties set in the RepositoryManager config.
      Sets the boosting factor used to rank items with matching terms in the title field. Value must be zero or greater.
      Parameters:
      boostFactor - The boosting factor used to rank items with matching terms in the title field.
      Throws:
      Exception - If error
    • resetBoostingFactorDefaults

      public void resetBoostingFactorDefaults() throws Exception
      Resets the boosting factors to the default values.
      Throws:
      Exception - If error
    • getStemmingBoostFactor

      public String getStemmingBoostFactor()
      Deprecated.
      As of 12/2004, stemming behavior is controlled by properties set in the RepositoryManager config.
      Gets the boosting factor used to rank items with matching stemmed terms.
      Returns:
      The boosting factor used to rank items with matching stemmed terms.
    • setStemmingBoostFactor

      public void setStemmingBoostFactor(double boostFactor) throws Exception
      Deprecated.
      As of 12/2004, stemming behavior is controlled by properties set in the RepositoryManager config.
      Sets the boosting factor used to rank items with matching stemmed terms. Value must be zero or greater.
      Parameters:
      boostFactor - The boosting factor used to rank items with matching stemmed terms.
      Throws:
      Exception - If error.
    • isStemmingEnabled

      public boolean isStemmingEnabled()
      Deprecated.
      As of 12/2004, stemming behavior is controlled by properties set in the RepositoryManager config.
      Indicates whether stemming support is enabled.
      Returns:
      true if stemming is enabled, false otherwise.
    • setStemmingEnabled

      public void setStemmingEnabled(boolean stemmingEnabled)
      Deprecated.
      As of 12/2004, stemming behavior is controlled by properties set in the RepositoryManager config.
      Sets whether stemming is enabled.
      Parameters:
      stemmingEnabled - true to enable stemming, false to disable it.
    • getExpandedSearchQuery

      public org.apache.lucene.search.Query getExpandedSearchQuery(String queryString) throws org.apache.lucene.queryParser.ParseException
      Gets a Query for the given Lucene query String that is expanded using the default search fields, boosting fields and virtual search field mappings that are configured in this RepositoryManager. The Query may then be used to search the index to find matching results.
      Parameters:
      queryString - The query String
      Returns:
      The Query, expanded
      Throws:
      org.apache.lucene.queryParser.ParseException - If error parsing the query String
      See Also:
    • getDefaultSearchFields

      public String[] getDefaultSearchFields()
      Gets the names of the fields that are serched for terms that match a users query. These are defined in the file named search_fields.properties found in the repository config directory.
      Returns:
      The defaultSearchFields value
      See Also:
    • getFieldsUsedForBoosting

      public String[] getFieldsUsedForBoosting()
      Gets the names of the index fields that are used to boost records that match a users query. These are defined in the file named search_fields.properties found in the repository config directory.
      Returns:
      The fieldsUsedForBoosting value
      See Also:
    • getBoostingValues

      public Map getBoostingValues()
      Gets the boosting values for fields used to boost search results. These are defined in the file named search_fields.properties found in the repository config directory.
      Returns:
      The boostingValues value
      See Also:
    • reloadConfigFiles

      public void reloadConfigFiles()
      Instructs the RepositoryManager to re-read and re-load the values found in it's configuration files.
    • getDisabledSets

      public ArrayList getDisabledSets()
      Gets the configured file sets that are currently disabled in this repository.
      Returns:
      The disabledSets value
    • getSetInfos

      public ArrayList getSetInfos()
      Gets the SetInfos (directories of files) that are currently configured in the repository.
      Returns:
      The setInfos.
      See Also:
    • enableSet

      public void enableSet(String setUid)
      Enables the given set of files for discovery.
      Parameters:
      setUid - The set Uid
    • disableSet

      public void disableSet(String setUid)
      Disabled the given set of files from discovery.
      Parameters:
      setUid - The set Uid
    • getSetInfosHashMap

      public HashMap getSetInfosHashMap()
      Gets the SetInfos (directories of files) that are currently configured in the repository as a HashMap keyed by setInfo.directory().
      Returns:
      The setInfos HashMap.
      See Also:
    • getSetInfosCopy

      public ArrayList getSetInfosCopy()
      Gets a copy of the SetInfos (directories of files) that are currently configured in the repository. The copy is suitable for modifying without effecting the data in the repository.
      Returns:
      The setInfosCopy value.
      See Also:
    • getSetInfo

      public SetInfo getSetInfo(int i)
      Gets the SetInfo (directory of files) at the give index, suitable for reading but not modifying.
      Parameters:
      i - The index into the SetInfo.
      Returns:
      The setInfo value.
    • getSetInfo

      public SetInfo getSetInfo(String key)
      Gets the SetInfo (directory of files) by the given set key, for example 'dcc'.
      Parameters:
      key - The set key, for example 'dcc'
      Returns:
      The setInfo, or null if not available
    • getSetInfoCopy

      public SetInfo getSetInfoCopy(int i)
      Gets the setInfo at the give index, safe for modifying.
      Parameters:
      i - The index into the SetInfo.
      Returns:
      The setInfo value.
    • addSetInfo

      public void addSetInfo(SetInfo setInfo) throws Exception
      Adds a new set of files to the repository configuration, but does not index them.
      Parameters:
      setInfo - The SetInfo to add to the reposigory configuration.
      Throws:
      Exception - If one of the directories is already configured or none is specified.
    • removeSetInfo

      public void removeSetInfo(SetInfo setInfo)
      Remove the given set of files from the repository.
      Parameters:
      setInfo - The set info to remove.
      See Also:
    • removeSetInfo

      public void removeSetInfo(int i)
      Removes the given set of files form the repository.
      Parameters:
      i - The index of the SetInfo to remove.
      See Also:
    • removeSetBySetSpec

      public SetInfo removeSetBySetSpec(String setSpec)
      Removes the cofiguration (SetInfo) for the given set of files from the repository and deletes the index entries for that set of files.
      Parameters:
      setSpec - The setSpec, or collection, to remove for example 'dcc'
      Returns:
      The removed SetInfo if successful, null if the given set was not found
    • replaceSetInfo

      public void replaceSetInfo(String key, SetInfo newSetInfo)
      Replace a given SetInfo object with a new one, updating the index as appropriate.
      Parameters:
      key - The set key for the set to replace, for example 'dcc'
      newSetInfo - The new SetInfo
    • replaceSetInfo

      public void replaceSetInfo(int i, SetInfo newSetInfo)
      Replace a given SetInfo object with a new one, updating the index as appropriate.
      Parameters:
      i - The index into the array of SetInfos to remove
      newSetInfo - The new SetInfo
    • getNumIndexingErrors

      public int getNumIndexingErrors()
      Gets the number of records that had indexing errors.
      Returns:
      The number of indexing errors
    • getIndexingErrorDocs

      public ResultDocList getIndexingErrorDocs()
      Gets the ResultDocs for those records that had errors and could not be indexed, or null if none exist.
      Returns:
      The indexing error ResultDocs, or null if none
      See Also:
    • getNumRecordsInIndex

      public int getNumRecordsInIndex()
      Gets the number of records in the index, excluding records with errors.
      Returns:
      The number of records in the index
      See Also:
    • getAllRecordsInIndex

      public ResultDocList getAllRecordsInIndex()
      Gets the ResultDocs for all records in the index, excluding records with errors, or null if none exist.
      Returns:
      All records ResultDocs, or null if none
      See Also:
    • getNumDeletedDocs

      public int getNumDeletedDocs()
      Gets the total number of OAI status deleted records. Records are set to status deleted when their source file has been removed (if removeDocs has been set to false in the RepositoryManager).
      Returns:
      The number of OAI status deleted records
    • getNumNonDeletedDocs

      public int getNumNonDeletedDocs()
      Gets the total number of records that are not OAI status deleted. Records are set to status deleted when their source file has been removed (if removeDocs has been set to false in the RepositoryManager).
      Returns:
      The number of records not OAI status deleted
    • getNumDeletedDocsNotFromAnyDirectory

      public int getNumDeletedDocsNotFromAnyDirectory()
      Gets the total number of all OAI status deleted records that did not come from any of the existing file directories configured in the RepositoryManager.
      Returns:
      Number of deleted documents not from any directory
      See Also:
    • getDeletedDocsNotFromAnyDirectory

      public final ResultDocList getDeletedDocsNotFromAnyDirectory()
      Gets the ResultDocs for all OAI status deleted records that did not come from any of the existing file directories configured in the RepositoryManager.
      Returns:
      Deleted documents not from any directory, or null if none
      See Also:
    • getDeletedDocsNotFromAnyDirectoryQuery

      public final org.apache.lucene.search.Query getDeletedDocsNotFromAnyDirectoryQuery()
      Gets a Query that will return all OAI status deleted records that did not come from any of the existing file directories configured in the RepositoryManager.
      Returns:
      A Query for deleted documents not from any directory
      See Also:
    • setFileIndexingPlugin

      public final void setFileIndexingPlugin(String xmlFormat, FileIndexingPlugin plugin)
      Sets the fileIndexingPlugin that will be used during indexing. In order to take effect, this method MUST be called prior to calling the
      invalid reference
      #init()
      method. An individual plugin may be specified for each XML format and a global plugin may also be specified for use with all formats. Plugin precedence is determined as follows: if a plugin has been set for a specific XML format, use it; else if a plugin has been set for all formats, use it; else if a plugin has not been set for either, use none.

      To configure one or more Lucene Analyzers to use on a per-field basis for your plugins, provide a properties file within your application's class path named 'FileIndexingPluginLuceneAnalyzers.properties'. See PerFieldAnalyzer for details.

      Parameters:
      xmlFormat - The XML format for which this plugin is used or PLUGIN_ALL_FORMATS to specify that the plugin should be used with all formats
      plugin - The FileIndexingPlugin that will be used
      See Also:
    • putRecord

      public String putRecord(String recordXml, String xmlFormat, String collection, String id, boolean saveXmlAsFile) throws RecordUpdateException
      Puts a record into the repository, replacing the existing record if one exists. If the record format is dlese_anno then the annotated record itemID will be reindexed to include the annotation data.
      Parameters:
      recordXml - The record XML as a String
      xmlFormat - The XML format of the record, for example 'adn'
      collection - The collection vocab for the collection or set, for example 'dcc'
      id - A unique identifier for the record, for example DLESE-000-000-000-001. This parameter is ignored and may be null if the ID can be derived from the record XML.
      saveXmlAsFile - True to save the XML record as a file on disc as well as in the index, false to only save it in the index
      Returns:
      The ID of the record as inserted, which may be different than the ID requested
      Throws:
      RecordUpdateException - If unable to insert the record for any reason
    • putRecord

      public String putRecord(String recordXml, String xmlFormat, String collection, String id, FileIndexingPlugin indexingPlugin, boolean saveXmlAsFile) throws RecordUpdateException
      Puts a record into the repository, replacing the existing record if one exists. If the record format is dlese_anno then the annotated record itemID will be reindexed to include the annotation data.
      Parameters:
      recordXml - The record XML as a String
      xmlFormat - The XML format of the record, for example 'adn'
      collection - The collection vocab for the collection or set, for example 'dcc'
      id - A unique identifier for the record, for example DLESE-000-000-000-001. This parameter is ignored and may be null if the ID can be derived from the record XML.
      indexingPlugin - A plugin to use while indexing, or null to specify none. This plugin takes precedence over a previously configured plugin. If none is supplied here, the previously configured plugin will be used if available.
      saveXmlAsFile - True to save the XML record as a file on disc as well as in the index, false to only save it in the index
      Returns:
      The ID of the record as inserted, which may be different than the ID requested
      Throws:
      RecordUpdateException - If unable to insert the record for any reason
    • deleteRecord

      public boolean deleteRecord(String id) throws Exception
      Deletes a record from the repository if one exists with the given ID. Returns false if no such record exists, else true if the deletion was successful. Reindexes all records that were related to the item, such as annotations, to remove related fields from the index.
      Parameters:
      id - The unique identifier for the record, for example DLESE-000-000-000-001.
      Returns:
      True if the deletion was successful, false if no such record exists.
      Throws:
      Exception - If unable to delete the record for any reason
    • reindexRecord

      public String reindexRecord(String id, FileIndexingPlugin indexingPlugin, boolean saveXmlAsFile, boolean indexRelations) throws RecordUpdateException
      Reindexes an existing record in the repository, updating any related data from outside of the record XML such as annotations or data from a FileIndexingPlugin, replacing the existing index entry. This is equivilent to calling #getRecord to fetch the record XML and then calling #putRecord with the same XML.
      Parameters:
      id - A unique identifier for the record, for example DLESE-000-000-000-001.
      indexingPlugin - A plugin to use while indexing, or null to specify none. This plugin takes precedence over a previously configured plugin. If none is supplied here, the previously configured plugin will be used if available.
      saveXmlAsFile - True to save the XML record as a file on disc as well as in the index, false to only save it in the index
      indexRelations - True to index the records that this item assigns a relation for
      Returns:
      The ID of the record that was reindexed.
      Throws:
      RecordUpdateException - If record ID does not exist or unable to reindex the record for any reason
    • indexFiles

      public final void indexFiles(FileIndexingObserver observer, boolean indexAll)
      Instructs the repository to index all of it's files. The index will add, update or delete the entries for each file in the repository. The indexAll parameter indicates whether to index all files regardless of modification or only those files that have been modified, added or deleted since the last index update. This method returns immediately and execution occurs in a background thread. Progress may be monitored using method getIndexingMessages().
      Parameters:
      observer - The FileIndexingObserver that will be notified when indexing is complete, or null to use none
      indexAll - True to index all files, false to index modified files only
    • indexCollection

      public final boolean indexCollection(String set, FileIndexingObserver observer, boolean indexAll)
      Instructs the repository to index all of the files for the given set/collection. The index will add, update or delete the entries for each file in the collection. The indexAll parameter indicates whether to index all files regardless of modification or only those files that have been modified, added or deleted since the last index update. This method returns immediately and execution occurs in a background thread. Progress may be monitored using method getIndexingMessages().
      Parameters:
      set - The set key, for example 'dcc'
      observer - The FileIndexingObserver that will be notified when indexing is complete, or null to use none
      indexAll - True to index all files, false to index modified files only
      Returns:
      True if the collection exists in the repository, false if the collection does not exist in the repository.
    • setRecordsLocation

      public final void setRecordsLocation(String collectionRecordsLocation, String metadataRecordsLocation)
      Sets the absolute path to the collectionRecordsLocation and the metadataRecordsLocation. If supplied, the RepositoryManager will index the Collecton Records and they can then be used to configure the collections found in this repository. This must be called prior to calling the init() method.
      Parameters:
      collectionRecordsLocation - The absolute path to a directory of DLESE collection-level XML records.
      metadataRecordsLocation - The absolute path to a directory containing item-level metadata. All metadata files must reside in sub-directores by format and collection, for example: metadataRecordsLocation + /adn/dcc/DLESE-000-000-000-001.xml.
    • getCollectionRecordsLocation

      public String getCollectionRecordsLocation()
      Gets the path for the directory of collect-level records this RepositoryManager is using, or empty string if none is configured.
      Returns:
      The collectionRecordsLocation value
    • getMetadataRecordsLocation

      public String getMetadataRecordsLocation()
      Gets the path for the directory of metadata records this RepositoryManager is using, or empty string if none is configured.
      Returns:
      The metadataRecordsLocation value
    • putCollection

      public String putCollection(String collectionKey, String xmlFormat, String title, String description, String additionalMetadata) throws PutCollectionException
      Put a collection in the repository. The collection can then have items added to it with the putRecord method.
      Parameters:
      collectionKey - The unique collection key, for example 'dcc'. The key and record ID are set to the same value.
      xmlFormat - The xml format of the records in this collection, for example 'nsdl_dc'
      title - The title
      description - The description
      additionalMetadata - A text or XML string to be inserted into the additionalMetadata element of the collection record, or null for none
      Returns:
      The collection record ID
      Throws:
      PutCollectionException - If error occurs, indicates the type of error
    • deleteCollection

      public boolean deleteCollection(String collectionKey) throws Exception
      Delete a collection and all its records from the repository.
      Parameters:
      collectionKey - The unique collection key, for example 'dcc'
      Returns:
      True if the collection existed and was deleted, false if no such collection exists
      Throws:
      Exception - Description of the Exception
    • loadCollectionRecords

      public void loadCollectionRecords(boolean indexCollectionRecs)
      Loads the collections found in the collection-level records.
      Parameters:
      indexCollectionRecs - True to index the collection records, false not to.
    • getRecordDataService

      public RecordDataService getRecordDataService()
      Gets the recordDataService attribute of the RepositoryManager object
      Returns:
      The recordDataService value
    • getAdminEmails

      public ArrayList getAdminEmails()
      Gets the adminEmails attribute of the RepositoryManager object
      Returns:
      The adminEmails value
    • getAdminEmail

      public String getAdminEmail(int i)
      Gets the adminEmail attribute of the RepositoryManager object
      Parameters:
      i - The index of the e-mail to get
      Returns:
      The adminEmails value
    • addAdminEmail

      public void addAdminEmail(String email)
      Add the given admin e-mail to the repository. The admin e-mail is used in the Identify request. If the given e-mail already exists, nothing is changed.
      Parameters:
      email - The admin e-mail to be added.
    • replaceAdminEmail

      public void replaceAdminEmail(int index, String email)
      Add the given admin e-mail to the repository. The admin e-mail is used in the Identify request. If the given e-mail already exists, nothing is changed.
      Parameters:
      index - DESCRIPTION
      email - The admin e-mail to be added.
    • removeAdminEmail

      public void removeAdminEmail(String email)
      Removes the given admin e-mail from the repository. The admin e-mail is used in the Identify request. If no such e-mail exists, nothing is done.
      Parameters:
      email - The admin e-mail to be removed.
    • removeAdminEmail

      public void removeAdminEmail(int i)
      Removes the given admin e-mail at the given ArrayList index from the repository. If no such e-mail exists, nothing is done.
      Parameters:
      i - The admin e-mail ArrayList index to be removed.
    • setMetadataNamespace

      public boolean setMetadataNamespace(String metadataPrefix, String metadataNamespace)
      Sets the metadata namespace for the given metadataPrefix (XML format). If a metadata namespace is already configured it will be replaced with the new value. These are used in the OAI ListMetadataFormats response.
      Parameters:
      metadataPrefix - The metadata specifier, for example oai_dc, adn, dlese_anno
      metadataNamespace - The namspace URI for the given XML format
      Returns:
      True if successful
    • getMetadataNamespace

      public String getMetadataNamespace(String metadataPrefix)
      Gets the metadata namespace for the given metadataPrefix (XML format). These are used in the OAI ListMetadataFormats response.
      Parameters:
      metadataPrefix - The metadata specifier, for example oai_dc, adn, dlese_anno
      Returns:
      The namspace URI for the given XML format, or null if not available
    • removeMetadataNamespace

      public boolean removeMetadataNamespace(String metadataPrefix)
      Removes the metadata namespace for the given metadataPrefix (XML format). These are used in the OAI ListMetadataFormats response.
      Parameters:
      metadataPrefix - The metadata specifier, for example oai_dc, adn, dlese_anno
      Returns:
      True if successful
    • getMetadataNamespaces

      public Map getMetadataNamespaces()
      Gets a Map of metadata namespaces for all metadataPrefixes (XML formats) in the repository, or null if none exist. These are used in the OAI ListMetadataFormats response.
      Returns:
      A Map of all metadata namespaces, keyed by metadataPrefix
    • setMetadataSchemaURL

      public boolean setMetadataSchemaURL(String metadataPrefix, String metadataSchema)
      Sets the metadata schema URL for the given metadataPrefix (XML format). If a schema URL is already configured it will be replaced with the new value. These are used in the OAI ListMetadataFormats response.
      Parameters:
      metadataPrefix - The metadata specifier, for example oai_dc, adn, dlese_anno
      metadataSchema - The schema URL for the given XML format
      Returns:
      True if successful
    • getMetadataSchemaURL

      public String getMetadataSchemaURL(String metadataPrefix)
      Gets the metadata schema URL for the given metadataPrefix (XML format). These are used in the OAI ListMetadataFormats response.
      Parameters:
      metadataPrefix - The metadata specifier, for example oai_dc, adn, dlese_anno
      Returns:
      The schema URL for the given XML format, or null if not available
    • removeMetadataSchemaURL

      public boolean removeMetadataSchemaURL(String metadataPrefix)
      Removes the metadata schema URL for the given metadataPrefix (XML format). These are used in the OAI ListMetadataFormats response.
      Parameters:
      metadataPrefix - The metadata specifier, for example oai_dc, adn, dlese_anno
      Returns:
      True if successful
    • getMetadataSchemaURLs

      public Map getMetadataSchemaURLs()
      Gets a Map of metadata schema URLs for all metadataPrefixes (XML formats) in the repository, or null if none exist. These are used in the OAI ListMetadataFormats response.
      Returns:
      A Map of all metadata schema URLs, keyed by metadataPrefix
    • setDefaultXmlFormatInfo

      public void setDefaultXmlFormatInfo(String info) throws Exception
      Sets the default schema and namespace for the given XML format, used in the OAI ListMetadataFormats response. Value passed in must be of the form [metadataPrefix]|[schema]|[namespace], for example 'oai_dc|http://www.openarchives.org/OAI/2.0/oai_dc.xsd|http://www.openarchives.org/OAI/2.0/oai_dc/'. If a namespace or schema value is already configured for the given metadataPrefix, no change will be made. Values may be changed later using #setMetadataSchemaURL and #setMetadataNamespace.
      Parameters:
      info - String of the form [metadataPrefix]|[schema]|[namespace]
      Throws:
      Exception - If unable to parse the String properly
    • setXMLConversionService

      public void setXMLConversionService(XMLConversionService cs)
      Sets the XMLConversionService used by this RepositoryManager and puts it into the index as an attribute under the key xmlConversionService for use in the XMLDocReaders.
      Parameters:
      cs - The new XMLConversionService.
    • getXMLConversionService

      public XMLConversionService getXMLConversionService()
      Gets the XMLConversionService used by this RepositoryManager, or null if none available.
      Returns:
      The XMLConversionService or null
    • getRepositoryDataDir

      public File getRepositoryDataDir() throws Exception
      Get the directory where the repository persistent data and certain configs resides, including the collections configs, specified by the init param repositoryData.
      Returns:
      The directory where the repository data and certain configs resides.
      Throws:
      Exception - If error
    • getItemIndexerConfigDir

      public File getItemIndexerConfigDir() throws Exception
      Get the directory where the repository ItemIndexer configs are located.
      Returns:
      The directory where the repository ItemIndexer configs are located
      Throws:
      Exception - If error
    • getListSetsConfigXml

      public String getListSetsConfigXml()
      Gets the OAI sets configuration XML for this repository, used to generate the ListSets OAI response. See sample ListSets XML config file .
      Returns:
      The listSetsConfigXml String, or null if none are configured
    • loadListSetsConfigFile

      public void loadListSetsConfigFile() throws Exception
      Loads the OAI sets configuration from file and configures the corresponding set mappings in this repository. See sample ListSets XML config file . If not file exists, nothing is done.
      Throws:
      Exception - If error parsing or loading the config
    • removeOAISetSpecDefinition

      public boolean removeOAISetSpecDefinition(String setSpec)
      Removes the given OAI set definition from repository configuration.
      Parameters:
      setSpec - The set to remove
      Returns:
      True if the set was removed
    • setOAISetSpecDefinition

      public void setOAISetSpecDefinition(SetDefinitionsForm setDefinitionsForm) throws Exception
      Sets the definition for a given OAI set, initializing it in the repository and writing the ListSets config XML to persistent file. If the given set already exists, it will be re-defined, if not, a new set will be added to the existsing sets in the config XML file.
      Parameters:
      setDefinitionsForm - A bean holding the set definiton info
      Throws:
      Exception - If error
    • getHasOaiSetsConfigured

      public boolean getHasOaiSetsConfigured()
      Determines whether one or more OAI sets are configured for this repository.
      Returns:
      True if one or more OAI sets are configured for this repository
    • getHasOaiSetConfigured

      public boolean getHasOaiSetConfigured(String setSpec)
      Determines whether the given OAI set is configured in this repository.
      Parameters:
      setSpec - The OAI setSpec
      Returns:
      True if the OAI set is configured in this repository
    • getOaiSets

      public String[] getOaiSets()
      Gets the OAI sets configured in this repository.
      Returns:
      The OAI sets configured in this repository, or null
    • getOaiSetQuery

      public org.apache.lucene.search.Query getOaiSetQuery(String setSpec)
      Gets the Lucene Query for the given setSpec, or null if none exists.
      Parameters:
      setSpec - The OAI setSpec
      Returns:
      The Query for the given setSpec or null
    • getOaiSetsForId

      public List getOaiSetsForId(String id)
      Gets the OAI sets associated with this record ID as a List of Strings, for example 'mySet' or null.
      Parameters:
      id - The record ID (without OAI prefix)
      Returns:
      A List of OAI set Strings, or null if none
    • getNumRecordsInSet

      public int getNumRecordsInSet(String setSpec)
      Gets the number of records that are in the given OAI set excluding deletions, or -1 if no such set is configured.
      Parameters:
      setSpec - The OAI setSpec
      Returns:
      The number of non-deleted records in the set or -1 if the given set does not exist
      See Also:
    • getNumDeletedRecordsInSet

      public int getNumDeletedRecordsInSet(String setSpec)
      Gets the number of deleted records that are in the given OAI, or -1 if no such set is configured.
      Parameters:
      setSpec - The OAI setSpec
      Returns:
      The number of deleted records in the set or -1 if the given set does not exist
      See Also:
    • getVirtualSearchFieldMapper

      public VirtualSearchFieldMapper getVirtualSearchFieldMapper()
      Gets the VirtualSearchFieldMapper that defines the virtual field/term definitions for this RepositoryManager. Dev note: may want to add RM methods to update/add stuff to the VirtualSearchFieldMapper, but for now this method can be used to get and then modify it.
      Returns:
      The virtualSearchFieldMapper or null if none
    • getDateStamp

      protected static final String getDateStamp()
      Return a string for the current time and date, sutiable for display in log files and output to standout:
      Returns:
      The dateStamp value
    • prtlnErr

      protected final void prtlnErr(String s)
      Output a line of text to error out, with datestamp.
      Parameters:
      s - The text that will be output to error out.
    • prtln

      protected final void prtln(String s)
      Output a line of text to standard out, with datestamp, if debug is set to true.
      Parameters:
      s - The String that will be output.
    • setDebug

      public static void setDebug(boolean db)
      Sets the debug attribute of the object
      Parameters:
      db - The new debug value