|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.repository.RepositoryManager
public class RepositoryManager
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.
Field Summary | |
---|---|
static String |
PLUGIN_ALL_FORMATS
Specifies in the setFileIndexingPlugin(String xmlFormat, FileIndexingPlugin plugin) method that
the given plugin should be used when indexing all XML formats. |
Constructor Summary | |
---|---|
RepositoryManager(File repositoryConfigDir,
File itemIndexerConfigDir,
String repositoryDataDir,
String indexLocation,
String indexingStartTime,
String indexingDaysOfWeek,
RecordDataService recordDataService,
boolean removeDocs,
boolean reindexAllFiles)
Constructor for the RepositoryManager. |
|
RepositoryManager(File repositoryConfigDir,
String repositoryDataDir,
int updateFrequency,
int maxFilesToIndex,
boolean removeDocs)
Constructor for the RepositoryManager. |
Method Summary | |
---|---|
void |
addAdminEmail(String email)
Add the given admin e-mail to the repository. |
void |
addCompression(String value)
Adds a feature to the Compression attribute of the RepositoryManager object. |
void |
addDescription(String value)
Adds a feature to the Description attribute of the RepositoryManager object |
void |
addSetInfo(SetInfo setInfo)
Adds a new set of files to the repository configuration, but does not index them. |
boolean |
canDisseminateFormat(String format)
Determines whether this repository can disseminate the given format. |
boolean |
deleteCollection(String collectionKey)
Delete a collection and all its records from the repository. |
void |
deleteIndex()
Deletes the repository index and re-initializes a new, empty one in its place. |
boolean |
deleteRecord(String id)
Deletes a record from the repository if one exists with the given ID. |
void |
destroy()
Tear down and clean up by gracefully stopping threads. |
void |
disableSet(String setUid)
Disabled the given set of files from discovery. |
void |
enableSet(String setUid)
Enables the given set of files for discovery. |
String |
getAbsoluteDrcBoostingQuery()
Boost items in the DRC absolutely. |
String |
getAdminEmail(int i)
Gets the adminEmail attribute of the RepositoryManager object |
ArrayList |
getAdminEmails()
Gets the adminEmails attribute of the RepositoryManager object |
ResultDocList |
getAllRecordsInIndex()
Gets the ResultDocs for all records in the index, excluding records with errors, or null if none exist. |
Hashtable |
getAvailableFormats()
Gets all possible metadata formats that may be disiminated by this RepositoryManager. |
Hashtable |
getAvailableFormats(String id)
Gets all possible metadata formats that are available for a given ID. |
List |
getAvailableFormatsList()
Gets all possible metadata formats that may be disiminated by this RepositoryManager. |
List |
getAvailableFormatsList(String id)
Gets all possible metadata formats that are available for a given ID. |
Map |
getBoostingValues()
Gets the boosting values for fields used to boost search results. |
String |
getCollectionRecordsLocation()
Gets the path for the directory of collect-level records this RepositoryManager is using, or empty string if none is configured. |
ArrayList |
getCompressions()
Gets the compressions attribute of the RepositoryManager object. |
File |
getConfigDir()
Gets the directory where the RepositoryManager config files reside. |
ArrayList |
getConfiguredFormats()
Gets a List of native file format Strings that are currently configured in this repository. |
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. |
ArrayList |
getConfiguredSets()
Gets a List of file set key Strings such as 'dcc' or 'comet' that are currently configured in this repository. |
String |
getConvertableFormatsQuery(String toFormat)
Gets a query that limits a search to only those xml formats that can be converted to the format indicated. |
protected static String |
getDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout: |
String[] |
getDefaultSearchFields()
Gets the names of the fields that are serched for terms that match a users query. |
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. |
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. |
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. |
String |
getDescription(int i)
Gets the description attribute of the RepositoryManager object |
ArrayList |
getDescriptions()
Gets the descriptions availalable for this repository. |
ArrayList |
getDisabledSets()
Gets the configured file sets that are currently disabled in this repository. |
HashMap |
getDisabledSetsHashMap()
Gets the configured sets that are currently disabled in this repository. |
org.apache.lucene.search.Query |
getDisabledSetsQuery()
Gets a Lucene Query for all disabled sets, or null if none. |
String |
getDiscoverableItemsQuery()
Gets the query string used to limit searches to only those ADN items-level records that should be displayed in discovery. |
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. |
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. |
String |
getDrcBoostFactor()
Gets the boosting factor used to rank items in the DRC. |
String |
getDrcBoostingQuery()
Boost items in the DRC. |
String |
getEarliestDatestamp()
Gets the earliestDatestamp attribute of the RepositoryManager object |
ArrayList |
getEnabledSets()
Gets the configured sets (directories of files) that are currently enabled in this repository. |
HashMap |
getEnabledSetsHashMap()
Gets the configured sets that are currently enabled in this repository. |
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. |
String |
getExampleID()
Get an example ID that might be disiminated from this repository. |
org.apache.lucene.search.Query |
getExpandedSearchQuery(String queryString)
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. |
String[] |
getFieldsUsedForBoosting()
Gets the names of the index fields that are used to boost records that match a users query. |
FileIndexingService |
getFileIndexingService()
Gets the fileIndexingService attribute. |
ArrayList |
getFormatsThatCanBeConvertedToFormat(String format)
Gets all formats that can be converted to the given Format. |
ArrayList |
getFormatsThatCanBeConvertedToFormats(String[] formats)
Gets all formats that can be converted to the given Formats. |
String |
getGranularity()
Gets the granularity attribute of the RepositoryManager object. |
String |
getHarvesterStatus()
Gets the harvesterStatus attribute of the RepositoryManager object |
boolean |
getHasOaiSetConfigured(String setSpec)
Determines whether the given OAI set is configured in this repository. |
boolean |
getHasOaiSetsConfigured()
Determines whether one or more OAI sets are configured for this repository. |
String |
getIdMapperExclusionFilePath()
Gets the path to an XML file the defines IDs that the IDMapper service should exclude from its list of duplicates. |
SimpleLuceneIndex |
getIndex()
Gets the index attribute of the RepositoryManager object |
List |
getIndexedAccessionStatuses()
Gets a list of all accession statusus in the index. |
List |
getIndexedFormats()
Gets all formats that exist natively in the index. |
List |
getIndexedIdMapperErrors()
Gets a list of all ID mapper errors that have been indexed. |
ArrayList |
getIndexedSets()
Gets the sets that are in the index. |
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. |
ResultDocList |
getIndexingErrorDocs()
Gets the ResultDocs for those records that had errors and could not be indexed, or null if none exist. |
ArrayList |
getIndexingMessages()
Gets the indexingMessages attribute of the RepositoryManager object |
Date |
getIndexingStartTime()
Gets the date the indexer scheduled to start. |
long |
getIndexLastModifiedCount()
Gets the version number of the last time the repository index was modified by adding, deleting or changing an item. |
boolean |
getIsOaiPmhEnabled()
Gets whether OAI-PMH ListRecords and ListIdentifiers functionality is enabled for this repository. |
File |
getItemIndexerConfigDir()
Get the directory where the repository ItemIndexer configs are located. |
String |
getListSetsConfigXml()
Gets the OAI sets configuration XML for this repository, used to generate the ListSets OAI response. |
String |
getMetadataNamespace(String metadataPrefix)
Gets the metadata namespace for the given metadataPrefix (XML format). |
Map |
getMetadataNamespaces()
Gets a Map of metadata namespaces for all metadataPrefixes (XML formats) in the repository, or null if none exist. |
String |
getMetadataRecordsLocation()
Gets the path for the directory of metadata records this RepositoryManager is using, or empty string if none is configured. |
String |
getMetadataSchemaURL(String metadataPrefix)
Gets the metadata schema URL for the given metadataPrefix (XML format). |
Map |
getMetadataSchemaURLs()
Gets a Map of metadata schema URLs for all metadataPrefixes (XML formats) in the repository, or null if none exist. |
String |
getMetadataVocabAudienceDefault()
Gets the metadataVocabAudienceDefault attribute of the RepositoryManager object |
String |
getMetadataVocabLanguageDefault()
Gets the metadataVocabLanguageDefault attribute of the RepositoryManager object |
String |
getMultiDocBoostFactor()
Gets the boosting factor used to rank resources that are referenced by more than one record. |
String |
getMultiDocBoostingQuery()
Boost items that have multiple records associated with them. |
int |
getNumDeletedDocs()
Gets the total number of OAI status deleted records. |
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. |
int |
getNumDeletedRecordsInSet(String setSpec)
Gets the number of deleted records that are in the given OAI, or -1 if no such set is configured. |
int |
getNumDiscoverableADNResources()
Gets the number of descrete ADN item-level resources that have been indexed and are currently discoverable. |
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. |
String |
getNumIdentifiersResults()
Gets the numIdentifiersResults per resumptionToken to be returned in OAI ListIdentifiers requests. |
int |
getNumIndexingErrors()
Gets the number of records that had indexing errors. |
int |
getNumNonDeletedDocs()
Gets the total number of records that are not OAI status deleted. |
int |
getNumRecordsInIndex()
Gets the number of records in the index, excluding records with errors. |
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. |
String |
getNumRecordsResults()
Gets the numRecordsResults per resumptionToken to be returned in OAI ListRecords requests. |
String |
getOaiIdPrefix()
Gets the OAI Identifier Format's scheme and namespace-identifier prefix, for example 'oai:dlese.org:'. |
ResultDocList |
getOaiQueryResults(String format,
String set,
String from,
String until)
Gets the results from a standard OAI-PMH ListIdentifiers or ListRecords query or an ODL search request. |
org.apache.lucene.search.Query |
getOaiSetQuery(String setSpec)
Gets the Lucene Query for the given setSpec, or null if none exists. |
String[] |
getOaiSets()
Gets the OAI sets configured in this repository. |
List |
getOaiSetsForId(String id)
Gets the OAI sets associated with this record ID as a List of Strings, for example 'mySet' or null. |
ResultDocList |
getOdlQueryResults(String format,
String set,
String from,
String until,
String queryString)
Gets the results of an OAI-PMH ListRecords or ListIdentifiers request or an OLD search. |
String |
getProtocolVersion()
Gets the protocolVersion attribute of the RepositoryManager object |
String |
getProviderBaseUrl(HttpServletRequest req)
Gets the Base URL that refers to the current OAI provider, for example "http://host:8080/my_oai_context/provider". |
String |
getProviderStatus()
Gets the status of the OAI data provider. |
ResultDoc |
getRecord(String id)
Gets a single record from the repository by ID. |
RecordDataService |
getRecordDataService()
Gets the recordDataService attribute of the RepositoryManager object |
ResultDoc |
getRecordOai(String id)
Gets a single record from the repository by ID, restricted to those records that are avaiable/discoverable for OAI. |
String |
getRemoveInvalidRecords()
Gets the removeInvalidRecords attribute, which is true|false. |
File |
getRepositoryDataDir()
Get the directory where the repository persistent data and certain configs resides, including the collections configs, specified by the init param repositoryData. |
String |
getRepositoryIdentifier()
Gets the repositoryIdentifier for this provider, for example 'dlese.org'. |
String |
getRepositoryName()
Gets the repositoryName attribute of the RepositoryManager object |
SetInfo |
getSetInfo(int i)
Gets the SetInfo (directory of files) at the give index, suitable for reading but not modifying. |
SetInfo |
getSetInfo(String key)
Gets the SetInfo (directory of files) by the given set key, for example 'dcc'. |
SetInfo |
getSetInfoCopy(int i)
Gets the setInfo at the give index, safe for modifying. |
ArrayList |
getSetInfos()
Gets the SetInfos (directories of files) that are currently configured in the repository. |
ArrayList |
getSetInfosCopy()
Gets a copy of the SetInfos (directories of files) that are currently configured in the repository. |
HashMap |
getSetInfosHashMap()
Gets the SetInfos (directories of files) that are currently configured in the repository as a HashMap keyed by setInfo.directory(). |
List |
getSetSearchKeys()
Gets a list of all search keys used to search for sets. |
long |
getSetStatusModifiedTime()
Gets the time the sets configuation status was last modified (enabled, disabled, added, deleted). |
String |
getStemmingBoostFactor()
Deprecated. As of 12/2004, stemming behavior is controlled by properties set in the RepositoryManager config. |
String |
getTitleBoostFactor()
Deprecated. As of 12/2004, boosting behavior is controlled by properties set in the RepositoryManager config. |
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. |
String[] |
getTrustedWsIpsArray()
Gets an array of IP address regular expressions that are trusted for access to non-discoverable items through the web service. |
int |
getUpdateFrequency()
Gets the interval by which the index is updated to check for changes in the meatdata files, in minutes. |
String |
getValidateRecords()
Gets the getValidateRecords attribute, which is true|false. |
VirtualSearchFieldMapper |
getVirtualSearchFieldMapper()
Gets the VirtualSearchFieldMapper that defines the virtual field/term definitions for this RepositoryManager. |
XMLConversionService |
getXMLConversionService()
Gets the XMLConversionService used by this RepositoryManager, or null if none available. |
boolean |
indexCollection(String set,
FileIndexingObserver observer,
boolean indexAll)
Instructs the repository to index all of the files for the given set/collection. |
void |
indexFiles(FileIndexingObserver observer,
boolean indexAll)
Instructs the repository to index all of it's files. |
int |
init(boolean indexCollectionRecords)
Init method initializes the data for serving. |
boolean |
isDirectoryConfigured(File sourceDirectory)
Determines whether the given directory is configured in the repository. |
boolean |
isIdInRepository(String id)
Determines whether the given ID is in the repository. |
boolean |
isIndexing()
Determins whether indexing is in progress. |
boolean |
isSetConfigured(String set)
Determines whether the given set is currently configured in this repository. |
boolean |
isSetDisabled(String set)
Determines whether the given set is currently disabled in this repository. |
boolean |
isSetEnabled(String set)
Determines whether the given set is currently enabled in this repository. |
boolean |
isSetInIndex(String set)
Determines whether the given set is in the repository index. |
boolean |
isStemmingEnabled()
Deprecated. As of 12/2004, stemming behavior is controlled by properties set in the RepositoryManager config. |
void |
loadCollectionRecords(boolean indexCollectionRecs)
Loads the collections found in the collection-level records. |
void |
loadListSetsConfigFile()
Loads the OAI sets configuration from file and configures the corresponding set mappings in this repository. |
protected void |
prtln(String s)
Output a line of text to standard out, with datestamp, if debug is set to true. |
protected void |
prtlnErr(String s)
Output a line of text to error out, with datestamp. |
String |
putCollection(String collectionKey,
String xmlFormat,
String title,
String description,
String additionalMetadata)
Put a collection in the repository. |
String |
putRecord(String recordXml,
String xmlFormat,
String collection,
String id,
boolean saveXmlAsFile)
Puts a record into the repository, replacing the existing record if one exists. |
String |
putRecord(String recordXml,
String xmlFormat,
String collection,
String id,
FileIndexingPlugin indexingPlugin,
boolean saveXmlAsFile)
Puts a record into the repository, replacing the existing record if one exists. |
String |
reindexRecord(String id,
FileIndexingPlugin indexingPlugin,
boolean saveXmlAsFile,
boolean indexRelations)
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. |
void |
reloadConfigFiles()
Instructs the RepositoryManager to re-read and re-load the values found in it's configuration files. |
void |
removeAdminEmail(int i)
Removes the given admin e-mail at the given ArrayList index from the repository. |
void |
removeAdminEmail(String email)
Removes the given admin e-mail from the repository. |
void |
removeCompression(int i)
Removes the given compression item. |
void |
removeCompression(String value)
Removes the given compression value. |
void |
removeDescription(int i)
Remove the given descrtiption item from the repository. |
void |
removeDescription(String value)
Remove the given desctiption from the repository. |
boolean |
removeMetadataNamespace(String metadataPrefix)
Removes the metadata namespace for the given metadataPrefix (XML format). |
boolean |
removeMetadataSchemaURL(String metadataPrefix)
Removes the metadata schema URL for the given metadataPrefix (XML format). |
boolean |
removeOAISetSpecDefinition(String setSpec)
Removes the given OAI set definition from repository configuration. |
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. |
void |
removeSetInfo(int i)
Removes the given set of files form the repository. |
void |
removeSetInfo(SetInfo setInfo)
Remove the given set of files from the repository. |
void |
replaceAdminEmail(int index,
String email)
Add the given admin e-mail to the repository. |
void |
replaceDescription(int index,
String value)
Add the given admin Description to the repository. |
void |
replaceSetInfo(int i,
SetInfo newSetInfo)
Replace a given SetInfo object with a new one, updating the index as appropriate. |
void |
replaceSetInfo(String key,
SetInfo newSetInfo)
Replace a given SetInfo object with a new one, updating the index as appropriate. |
void |
resetBoostingFactorDefaults()
Resets the boosting factors to the default values. |
void |
setAdditionalIndices(Hashtable additionalIndexers)
|
static void |
setDebug(boolean db)
Sets the debug attribute of the object |
void |
setDefaultXmlFormatInfo(String info)
Sets the default schema and namespace for the given XML format, used in the OAI ListMetadataFormats response. |
void |
setDrcBoostFactor(double boostFactor)
Sets the boosting factor used to rank items in the DRC. |
void |
setDupItemsIndex(SimpleLuceneIndex dupItemsIndex)
Sets the de-duping index to use. |
void |
setFileIndexingPlugin(String xmlFormat,
FileIndexingPlugin plugin)
Sets the fileIndexingPlugin that will be used during indexing. |
void |
setGranularity(String value)
Sets the granularity attribute of the RepositoryManager object. |
void |
setHarvesterStatus(String value)
Sets the harvesterStatus attribute of the RepositoryManager object |
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. |
void |
setIsOaiPmhEnabled(boolean isEnabled)
Sets whether OAI-PMH ListRecords and ListIdentifiers functionality is enabled for this repository. |
boolean |
setMetadataNamespace(String metadataPrefix,
String metadataNamespace)
Sets the metadata namespace for the given metadataPrefix (XML format). |
boolean |
setMetadataSchemaURL(String metadataPrefix,
String metadataSchema)
Sets the metadata schema URL for the given metadataPrefix (XML format). |
void |
setMetadataVocabAudienceDefault(String audience)
Sets the metadataVocabAudienceDefault attribute of the RepositoryManager object |
void |
setMetadataVocabLanguageDefault(String language)
Sets the metadataVocabLanguageDefault attribute of the RepositoryManager object |
void |
setMultiDocBoostFactor(double boostFactor)
Sets the boosting factor used to rank resources that are referenced by more than one record. |
void |
setNumIdentifiersResults(String value)
Sets the numIdentifiersResults per resumptionToken to be returned in OAI ListIdentifiers requests. |
void |
setNumRecordsResults(String value)
Sets the numRecordsResults per resumptionToken to be returned in OAI ListRecords requests. |
void |
setOaiFilterQuery(String luceneQuery)
Sets a Lucene query that filters the records served by the OAI data provider. |
void |
setOAISetSpecDefinition(SetDefinitionsForm setDefinitionsForm)
Sets the definition for a given OAI set, initializing it in the repository and writing the ListSets config XML to persistent file. |
void |
setProviderBaseUrlEnding(String baseUrlEnding)
Sets the end portion of the OAI baseURL that is being used, for example 'provider'. |
void |
setProviderStatus(String value)
Sets the status of the OAI data provider. |
void |
setRecordsLocation(String collectionRecordsLocation,
String metadataRecordsLocation)
Sets the absolute path to the collectionRecordsLocation and the metadataRecordsLocation. |
void |
setRemoveInvalidRecords(String value)
Sets the removeInvalidRecords attribute. |
void |
setRepositoryIdentifier(String value)
Sets the oaiIdentifier attribute of the RepositoryManager object |
void |
setRepositoryName(String value)
Sets the repositoryName attribute of the RepositoryManager object |
void |
setServerUrl(String serverUrl)
Sets the serverUrl (scheme, hostname and port) displayed in the OAI data provider baseUrl and elsewhere. |
void |
setStemmingBoostFactor(double boostFactor)
Deprecated. As of 12/2004, stemming behavior is controlled by properties set in the RepositoryManager config. |
void |
setStemmingEnabled(boolean stemmingEnabled)
Deprecated. As of 12/2004, stemming behavior is controlled by properties set in the RepositoryManager config. |
void |
setTitleBoostFactor(double boostFactor)
Deprecated. As of 12/2004, boosting behavior is controlled by properties set in the RepositoryManager config. |
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. |
void |
setValidateRecords(String value)
Sets the setValidateRecords attribute. |
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. |
void |
stopIndexing()
Instructs the indexer to stop indexing wherever its at in the process. |
void |
updateVocab(MetadataVocab newVocab)
Update the current MetadataVocab with a new one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PLUGIN_ALL_FORMATS
setFileIndexingPlugin(String xmlFormat, FileIndexingPlugin plugin)
method that
the given plugin should be used when indexing all XML formats.
Constructor Detail |
---|
public RepositoryManager(File repositoryConfigDir, String repositoryDataDir, int updateFrequency, int maxFilesToIndex, boolean removeDocs)
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.public RepositoryManager(File repositoryConfigDir, File itemIndexerConfigDir, String repositoryDataDir, String indexLocation, String indexingStartTime, String indexingDaysOfWeek, RecordDataService recordDataService, boolean removeDocs, boolean reindexAllFiles)
repositoryConfigDir
- The directory where config files reside (default search/boosting fields,
other config)itemIndexerConfigDir
- The directory where ItemIndexer configs are locatedrepositoryDataDir
- 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 Detail |
---|
public void setAdditionalIndices(Hashtable additionalIndexers)
public int init(boolean indexCollectionRecords)
indexCollectionRecords
- True to index the collections records when called
public void destroy()
public SimpleLuceneIndex getIndex()
public void deleteIndex()
public void stopIndexing()
public boolean isIndexing()
public void setDupItemsIndex(SimpleLuceneIndex dupItemsIndex)
dupItemsIndex
- The new dupItemsIndex valuepublic long getIndexLastModifiedCount()
public long getSetStatusModifiedTime()
public ArrayList getIndexingMessages()
public File getConfigDir()
public String getIdMapperExclusionFilePath()
public void setIdMapperExclusionFilePath(String filePath)
filePath
- The new idMapperExclusionFilePath value, or null to specify nonepublic int getUpdateFrequency()
public Date getIndexingStartTime()
public int[] getIndexingDaysOfWeek()
public void updateVocab(MetadataVocab newVocab)
newVocab
- The new MetadataVocab object.public void setMetadataVocabAudienceDefault(String audience)
audience
- The new metadataVocabAudienceDefault valuepublic String getMetadataVocabAudienceDefault()
public void setMetadataVocabLanguageDefault(String language)
language
- The new metadataVocabLanguageDefault valuepublic String getMetadataVocabLanguageDefault()
public FileIndexingService getFileIndexingService()
public String getNumIdentifiersResults()
public void setNumIdentifiersResults(String value)
value
- The new numIdentifiersResults valuepublic String getRemoveInvalidRecords()
public void setRemoveInvalidRecords(String value)
value
- The String "true" or "false".public String getValidateRecords()
public void setValidateRecords(String value)
value
- The String "true" or "false".public String getNumRecordsResults()
public void setNumRecordsResults(String value)
value
- The new numRecordsResults valuepublic String getExampleID()
public String getProviderStatus()
public void setProviderStatus(String value) throws Exception
value
- The new providerStatus value [ENABLED or DISABLED]
Exception
- NOT YET DOCUMENTEDpublic String getHarvesterStatus()
public void setHarvesterStatus(String value)
value
- The new harvesterStatus value [ENABLED or DISABLED]public String getRepositoryIdentifier()
public String getOaiIdPrefix()
public void setRepositoryIdentifier(String value)
value
- The new oaiIdentifier valuepublic String getProtocolVersion()
public String getRepositoryName()
public void setRepositoryName(String value)
value
- The new repositoryName valuepublic String getEarliestDatestamp()
public String getDeletedRecord()
public String getGranularity()
public void setGranularity(String value)
value
- The new granularity valuepublic void setProviderBaseUrlEnding(String baseUrlEnding)
baseUrlEnding
- The new providerBaseUrlEnding valuepublic void setServerUrl(String serverUrl)
serverUrl
- The new serverUrl valuepublic String getProviderBaseUrl(HttpServletRequest req)
req
- The request.
public ArrayList getCompressions()
public void addCompression(String value)
value
- The feature to be added to the Compression attributepublic void removeCompression(String value)
value
- The compression value to remove.public void removeCompression(int i)
i
- The compression ArrayList item to remove.public ArrayList getDescriptions()
public String getDescription(int i)
i
- The index of the description to remove
public void addDescription(String value)
value
- The feature to be added to the Description attributepublic void replaceDescription(int index, String value)
index
- The index.value
- The new descriptionpublic void removeDescription(String value)
value
- The description to remove.public void removeDescription(int i)
i
- The description ArrayList index to remove.public String[] getTrustedWsIpsArray()
String IP = "128.66.45.88";
boolean isAuthorized = IP.matches(getTrustedWsIpsArray()[0]);
public String getTrustedWsIps()
public void setTrustedWsIps(String value)
value
- The new trustedWsIps valuepublic ResultDoc getRecord(String id)
id
- The ID for the item
public org.apache.lucene.search.Query getDisabledSetsQuery()
public ResultDoc getRecordOai(String id)
id
- The ID for the item
setOaiFilterQuery(java.lang.String)
,
getOaiQueryResults(String format,String set,String from,String until)
public ResultDocList getOaiQueryResults(String format, String set, String from, String until) throws Exception
format
- The metadata format.set
- The set, or null.from
- The from time, or null.until
- The until time, or null.
Exception
- If error occues, exception will contain a messagegetRecord(String id)
public ResultDocList getOdlQueryResults(String format, String set, String from, String until, String queryString) throws Exception
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.
Exception
- If error occues, exception will contain a message meant for human consumption in
response error messages.setOaiFilterQuery(java.lang.String)
public void setOaiFilterQuery(String luceneQuery) throws org.apache.lucene.queryParser.ParseException
luceneQuery
- The Lucene query to filter records
org.apache.lucene.queryParser.ParseException
- If query parse errorpublic ArrayList getFormatsThatCanBeConvertedToFormat(String format)
format
- The target format.
public ArrayList getFormatsThatCanBeConvertedToFormats(String[] formats)
formats
- Formats that we want converted to.
public final String getConvertableFormatsQuery(String toFormat)
toFormat
- The xml format to convert to
public ArrayList getIndexedSets()
getSetSearchKeys()
public List getSetSearchKeys()
getIndexedSets()
public List getIndexedAccessionStatuses()
public List getIndexedIdMapperErrors()
public boolean isIdInRepository(String id)
id
- An ID.
public boolean isSetInIndex(String set)
set
- A set.
isSetConfigured(String set)
public boolean canDisseminateFormat(String format)
format
- The format.
public final Hashtable getAvailableFormats()
getConfiguredFormats()
public List getAvailableFormatsList(String id)
id
- The id for the record.
public List getAvailableFormatsList()
public List getIndexedFormats()
public Hashtable getAvailableFormats(String id)
id
- The id for the record.
public boolean isSetConfigured(String set)
set
- The set key, for example 'dcc'
isSetInIndex(String set)
public boolean isDirectoryConfigured(File sourceDirectory)
sourceDirectory
- A directory of metadata files.
public boolean isSetEnabled(String set)
set
- The name of the set or, if the vocab mgr is being used, the name of the encoded set key.
public boolean isSetDisabled(String set)
set
- The name of the set or, if the vocab mgr is being used, the name of the encoded set key.
public ArrayList getConfiguredSets()
public HashMap getConfiguredSetInfos()
public ArrayList getConfiguredFormats()
getAvailableFormats()
public ArrayList getEnabledSets()
public HashMap getEnabledSetsHashMap()
public HashMap getDisabledSetsHashMap()
public final String getEnabledSetsQuery()
public final String getDiscoverableItemsQuery()
public final String getDiscoverableRecordsQuery()
public final org.apache.lucene.search.Query getDiscoverableOaiRecordsQuery()
Refactoring note: Consider using this for method getDiscoverableRecordsQuery()
instead.
public final int getNumDiscoverableADNResources()
public final int getNumDiscoverableResources()
public final String getDrcBoostingQuery()
public final String getAbsoluteDrcBoostingQuery()
public final String getMultiDocBoostingQuery()
public String getDrcBoostFactor()
public String getMultiDocBoostFactor()
public void setMultiDocBoostFactor(double boostFactor) throws Exception
boostFactor
- The new boosting factor used to rank items in multiple records.
Exception
- If error.public void setIsOaiPmhEnabled(boolean isEnabled)
isEnabled
- False to disable regular ListRecord and ListIdentifier OAI-PMH responsespublic boolean getIsOaiPmhEnabled()
public void setDrcBoostFactor(double boostFactor) throws Exception
boostFactor
- The new boosting factor used to rank items in the DRC.
Exception
- If error.public String getTitleBoostFactor()
public void setTitleBoostFactor(double boostFactor) throws Exception
boostFactor
- The boosting factor used to rank items with matching terms in the title field.
Exception
- If errorpublic void resetBoostingFactorDefaults() throws Exception
Exception
- If errorpublic String getStemmingBoostFactor()
public void setStemmingBoostFactor(double boostFactor) throws Exception
boostFactor
- The boosting factor used to rank items with matching stemmed terms.
Exception
- If error.public boolean isStemmingEnabled()
public void setStemmingEnabled(boolean stemmingEnabled)
stemmingEnabled
- true to enable stemming, false to disable it.public org.apache.lucene.search.Query getExpandedSearchQuery(String queryString) throws org.apache.lucene.queryParser.ParseException
queryString
- The query String
org.apache.lucene.queryParser.ParseException
- If error parsing the query StringgetDefaultSearchFields()
,
getFieldsUsedForBoosting()
,
getBoostingValues()
,
getVirtualSearchFieldMapper()
public String[] getDefaultSearchFields()
reloadConfigFiles()
public String[] getFieldsUsedForBoosting()
reloadConfigFiles()
public Map getBoostingValues()
reloadConfigFiles()
public void reloadConfigFiles()
public ArrayList getDisabledSets()
public ArrayList getSetInfos()
SetInfo
public void enableSet(String setUid)
setUid
- The set Uidpublic void disableSet(String setUid)
setUid
- The set Uidpublic HashMap getSetInfosHashMap()
SetInfo
public ArrayList getSetInfosCopy()
SetInfo
public SetInfo getSetInfo(int i)
i
- The index into the SetInfo.
public SetInfo getSetInfo(String key)
key
- The set key, for example 'dcc'
public SetInfo getSetInfoCopy(int i)
i
- The index into the SetInfo.
public void addSetInfo(SetInfo setInfo) throws Exception
setInfo
- The SetInfo to add to the reposigory configuration.
Exception
- If one of the directories is already configured or none is specified.public void removeSetInfo(SetInfo setInfo)
setInfo
- The set info to remove.SetInfo
public void removeSetInfo(int i)
i
- The index of the SetInfo to remove.SetInfo
public SetInfo removeSetBySetSpec(String setSpec)
setSpec
- The setSpec, or collection, to remove for example 'dcc'
public void replaceSetInfo(String key, SetInfo newSetInfo)
key
- The set key for the set to replace, for example 'dcc'newSetInfo
- The new SetInfopublic void replaceSetInfo(int i, SetInfo newSetInfo)
i
- The index into the array of SetInfos to removenewSetInfo
- The new SetInfopublic int getNumIndexingErrors()
public ResultDocList getIndexingErrorDocs()
ErrorDocReader
public int getNumRecordsInIndex()
getAllRecordsInIndex()
public ResultDocList getAllRecordsInIndex()
getNumRecordsInIndex()
public int getNumDeletedDocs()
public int getNumNonDeletedDocs()
public int getNumDeletedDocsNotFromAnyDirectory()
getDeletedDocsNotFromAnyDirectory()
public final ResultDocList getDeletedDocsNotFromAnyDirectory()
getNumDeletedDocsNotFromAnyDirectory()
public final org.apache.lucene.search.Query getDeletedDocsNotFromAnyDirectoryQuery()
getDeletedDocsNotFromAnyDirectory()
public final void setFileIndexingPlugin(String xmlFormat, FileIndexingPlugin plugin)
#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.
xmlFormat
- The XML format for which this plugin is used or PLUGIN_ALL_FORMATS
to specify
that the plugin should be used with all formatsplugin
- The FileIndexingPlugin that will be usedPLUGIN_ALL_FORMATS
public String putRecord(String recordXml, String xmlFormat, String collection, String id, boolean saveXmlAsFile) throws RecordUpdateException
recordXml
- The record XML as a StringxmlFormat
- 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
RecordUpdateException
- If unable to insert the record for any reasonpublic String putRecord(String recordXml, String xmlFormat, String collection, String id, FileIndexingPlugin indexingPlugin, boolean saveXmlAsFile) throws RecordUpdateException
recordXml
- The record XML as a StringxmlFormat
- 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
RecordUpdateException
- If unable to insert the record for any reasonpublic boolean deleteRecord(String id) throws Exception
id
- The unique identifier for the record, for example DLESE-000-000-000-001.
Exception
- If unable to delete the record for any reasonpublic String reindexRecord(String id, FileIndexingPlugin indexingPlugin, boolean saveXmlAsFile, boolean indexRelations) throws RecordUpdateException
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 indexindexRelations
- True to index the records that this item assigns a relation for
RecordUpdateException
- If record ID does not exist or unable to reindex the record for any
reasonpublic final void indexFiles(FileIndexingObserver observer, boolean indexAll)
getIndexingMessages()
.
observer
- The FileIndexingObserver that will be notified when indexing is complete, or null to use
noneindexAll
- True to index all files, false to index modified files onlypublic final boolean indexCollection(String set, FileIndexingObserver observer, boolean indexAll)
getIndexingMessages()
.
set
- The set key, for example 'dcc'observer
- The FileIndexingObserver that will be notified when indexing is complete, or null to use
noneindexAll
- True to index all files, false to index modified files only
public final void setRecordsLocation(String collectionRecordsLocation, String metadataRecordsLocation)
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.public String getCollectionRecordsLocation()
public String getMetadataRecordsLocation()
public String putCollection(String collectionKey, String xmlFormat, String title, String description, String additionalMetadata) throws PutCollectionException
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 titledescription
- The descriptionadditionalMetadata
- A text or XML string to be inserted into the additionalMetadata
element of the collection record, or null for none
PutCollectionException
- If error occurs, indicates the type of errorpublic boolean deleteCollection(String collectionKey) throws Exception
collectionKey
- The unique collection key, for example 'dcc'
Exception
- Description of the Exceptionpublic void loadCollectionRecords(boolean indexCollectionRecs)
indexCollectionRecs
- True to index the collection records, false not to.public RecordDataService getRecordDataService()
public ArrayList getAdminEmails()
public String getAdminEmail(int i)
i
- The index of the e-mail to get
public void addAdminEmail(String email)
email
- The admin e-mail to be added.public void replaceAdminEmail(int index, String email)
email
- The admin e-mail to be added.index
- DESCRIPTIONpublic void removeAdminEmail(String email)
email
- The admin e-mail to be removed.public void removeAdminEmail(int i)
i
- The admin e-mail ArrayList index to be removed.public boolean setMetadataNamespace(String metadataPrefix, String metadataNamespace)
metadataPrefix
- The metadata specifier, for example oai_dc, adn, dlese_annometadataNamespace
- The namspace URI for the given XML format
public String getMetadataNamespace(String metadataPrefix)
metadataPrefix
- The metadata specifier, for example oai_dc, adn, dlese_anno
public boolean removeMetadataNamespace(String metadataPrefix)
metadataPrefix
- The metadata specifier, for example oai_dc, adn, dlese_anno
public Map getMetadataNamespaces()
public boolean setMetadataSchemaURL(String metadataPrefix, String metadataSchema)
metadataPrefix
- The metadata specifier, for example oai_dc, adn, dlese_annometadataSchema
- The schema URL for the given XML format
public String getMetadataSchemaURL(String metadataPrefix)
metadataPrefix
- The metadata specifier, for example oai_dc, adn, dlese_anno
public boolean removeMetadataSchemaURL(String metadataPrefix)
metadataPrefix
- The metadata specifier, for example oai_dc, adn, dlese_anno
public Map getMetadataSchemaURLs()
public void setDefaultXmlFormatInfo(String info) throws Exception
info
- String of the form [metadataPrefix]|[schema]|[namespace]
Exception
- If unable to parse the String properlypublic void setXMLConversionService(XMLConversionService cs)
cs
- The new XMLConversionService.public XMLConversionService getXMLConversionService()
public File getRepositoryDataDir() throws Exception
Exception
- If errorpublic File getItemIndexerConfigDir() throws Exception
Exception
- If errorpublic String getListSetsConfigXml()
public void loadListSetsConfigFile() throws Exception
Exception
- If error parsing or loading the configpublic boolean removeOAISetSpecDefinition(String setSpec)
setSpec
- The set to remove
public void setOAISetSpecDefinition(SetDefinitionsForm setDefinitionsForm) throws Exception
setDefinitionsForm
- A bean holding the set definiton info
Exception
- If errorpublic boolean getHasOaiSetsConfigured()
public boolean getHasOaiSetConfigured(String setSpec)
setSpec
- The OAI setSpec
public String[] getOaiSets()
public org.apache.lucene.search.Query getOaiSetQuery(String setSpec)
setSpec
- The OAI setSpec
public List getOaiSetsForId(String id)
id
- The record ID (without OAI prefix)
public int getNumRecordsInSet(String setSpec)
setSpec
- The OAI setSpec
getNumDeletedRecordsInSet(java.lang.String)
public int getNumDeletedRecordsInSet(String setSpec)
setSpec
- The OAI setSpec
getNumRecordsInSet(java.lang.String)
public VirtualSearchFieldMapper getVirtualSearchFieldMapper()
protected static final String getDateStamp()
protected final void prtlnErr(String s)
s
- The text that will be output to error out.protected final void prtln(String s)
s
- The String that will be output.public static void setDebug(boolean db)
db
- The new debug value
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |