|
DLESE Tools v1.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.repository.RepositoryManager
Manages a repository of metadata files for use in discovery, cataloging, OAI and other applications. Provides and maintains an index of the metadata, with support for multiple collections and metadata formats.
Constructor Summary | |
---|---|
RepositoryManager(String repositoryDataDir)
Constructor for the RepositoryManager that uses default settings. |
|
RepositoryManager(String repositoryDataDir,
int updateFrequency)
Constructor for the RepositoryManager object |
|
RepositoryManager(String repositoryDataDir,
String indexLocation,
int updateFrequency,
RecordDataService recordDataService,
boolean removeDocs)
Constructor for the RepositoryManager object |
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 and begins re-indexing. |
boolean |
canDisseminateFormat(String format)
Determines whether this repository can disseminate the given format. |
void |
deleteIndex()
Deletes the repository index and re-initializes a new, empty one in its place. |
void |
destroy()
Tear down and clean up by gracefully stopping threads. |
String |
getAdminEmail(int i)
Gets the adminEmail attribute of the RepositoryManager object |
ArrayList |
getAdminEmails()
Gets the adminEmails attribute of the RepositoryManager object |
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 record. |
List |
getAvailableFormatsList()
Gets all possible metadata formats that may be disiminated by this RepositoryManager. |
ArrayList |
getCompressions()
Gets the compressions attribute of the RepositoryManager object. |
ArrayList |
getConfiguredSets()
Gets a List of sets that are currently configured in this repository. |
String |
getContextUrl(HttpServletRequest req)
Gets the URL that refers to the current servlet context, for example "http://host:8080/my_app_context". |
protected static String |
getDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout: |
String |
getDeletedRecord()
Gets the deletedRecord attribute of the RepositoryManager object |
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 sets that are currently disabled in this repository. |
String |
getEarliestDatestamp()
Gets the earliestDatestamp attribute of the RepositoryManager object |
ArrayList |
getEnabledSets()
Gets the configured sets 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. |
String |
getExampleID()
Get an example ID that might be disiminated from this repository. |
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 |
SimpleLuceneIndex |
getIndex()
Gets the index attribute of the RepositoryManager object |
List |
getIndexedAccessionStatuses()
Gets a list of all accession statusus 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. |
ArrayList |
getIndexingMessages()
Gets the indexingMessages attribute of the RepositoryManager object |
long |
getLastModifiedTime()
Gets the time this repository was last modified. |
String |
getNumIdentifiersResults()
Gets the numIdentifiersResults per resumptionToken to be returned in OAI ListIdentifiers requests. |
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:'. |
ResultDoc[] |
getOdlQueryResults(String format,
String set,
String from,
String until,
String queryString)
Gets the results of 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 providerStatus attribute of the RepositoryManager object |
ResultDoc[] |
getQueryResults(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. |
ResultDoc |
getRecord(String id)
Performs a GetRecord for an individual itme in the repository. |
RecordDataService |
getRecordDataService()
Gets the recordDataService attribute of the RepositoryManager object |
String |
getRemoveInvalidRecords()
Gets the removeInvalidRecords attribute, which is true|false. |
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 at the give index, suitable for reading but not modifying. |
SetInfo |
getSetInfoCopy(int i)
Gets the setInfo at the give index, safe for modifying. |
ArrayList |
getSetInfos()
Gets the SetInfos that are currently configured in the repository. |
ArrayList |
getSetInfosCopy()
Gets a copy of the SetInfos that are currently configured in the repository. |
List |
getSetSearchKeys()
Gets a list of all search keys used to search for sets. |
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. |
void |
indexFiles(boolean background)
Updates the index to reflect the files in the directories this manager is monitoring. |
int |
init()
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 |
isSetConfigured(String set)
Determines whether the given set is currently configured 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. |
void |
log(String msg)
Logger hook |
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. |
void |
reindexFiles(boolean background)
DESCRIPTION |
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. |
void |
removeSetInfo(int i)
Removes the given SetInfo form the repository. |
void |
removeSetInfo(SetInfo setInfo)
Remove the given setinfo from the repository. |
void |
replaceAdminEmail(int index,
String email)
Add the given admin e-mail to the repository. |
void |
replaceDescription(int index,
String email)
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. |
static void |
setDebug(boolean db)
Sets the debug attribute of the object |
void |
setDeletedRecord(String value)
Sets the deletedRecord attribute of the RepositoryManager object |
void |
setDoubleIndexing(boolean isIndexingTwice)
Sets the doubleIndexing attribute of the RepositoryManager object |
void |
setDupItemsIndex(SimpleLuceneIndex dupItemsIndex)
|
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 |
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 |
setProviderStatus(String value)
Sets the providerStatus attribute of the RepositoryManager object |
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 |
setValidateRecords(String value)
Sets the setValidateRecords attribute. |
static void |
setXMLConversionService(XMLConversionService cs)
Sets the XMLConversionService used by this RepositoryManager. |
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 |
Constructor Detail |
public RepositoryManager(String repositoryDataDir)
repositoryDataDir
- Absolute path the the directory where all repository data
is stored.public RepositoryManager(String repositoryDataDir, int updateFrequency)
repositoryDataDir
- DESCRIPTIONupdateFrequency
- DESCRIPTIONpublic RepositoryManager(String repositoryDataDir, String indexLocation, int updateFrequency, RecordDataService recordDataService, boolean removeDocs)
repositoryDataDir
- Directory where admin data is stored.indexLocation
- Directory where index is stored.updateFrequency
- Frequency in minutes for file modification checks to update
the index.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.Method Detail |
public int init()
public void destroy()
public SimpleLuceneIndex getIndex()
public void deleteIndex()
public void setDupItemsIndex(SimpleLuceneIndex dupItemsIndex)
public long getLastModifiedTime()
public ArrayList getIndexingMessages()
public int getUpdateFrequency()
public void updateVocab(MetadataVocab newVocab)
newVocab
- The new MetadataVocab object.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)
value
- The new providerStatus value [ENABLED or DISABLED]public 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 void setDeletedRecord(String value)
value
- The new deletedRecord valuepublic String getGranularity()
public void setGranularity(String value)
value
- The new granularity valuepublic String getContextUrl(HttpServletRequest req)
req
- The request
public 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
- DESCRIPTION
public void addDescription(String value)
value
- The feature to be added to the Description attributepublic void replaceDescription(int index, String email)
email
- The admin e-mail to be added.index
- DESCRIPTIONpublic void removeDescription(String value)
value
- The description to remove.public void removeDescription(int i)
i
- The description ArrayList index to remove.public ResultDoc getRecord(String id)
id
- The ID for the item.
getQueryResults(String format,String set,String from,String until)
public ResultDoc[] getQueryResults(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 ResultDoc[] 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
- The keyword query string to search over.
Exception
- If error occues, exception will contain a message meant for
human consumption in response error messages.public ArrayList getFormatsThatCanBeConvertedToFormat(String format)
format
- The target format.
public ArrayList getFormatsThatCanBeConvertedToFormats(String[] formats)
formats
- DESCRIPTION
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()
public List getAvailableFormatsList()
public Hashtable getAvailableFormats(String id)
id
- The id for the record.
public boolean isSetConfigured(String set)
set
- The name of the set.
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 ArrayList getConfiguredSets()
public ArrayList getEnabledSets()
public HashMap getEnabledSetsHashMap()
public String getEnabledSetsQuery()
public ArrayList getDisabledSets()
public ArrayList getSetInfos()
SetInfo
public ArrayList getSetInfosCopy()
SetInfo
public SetInfo getSetInfo(int i)
i
- The index into the SetInfo.
public SetInfo getSetInfoCopy(int i)
i
- The index into the SetInfo.
public void addSetInfo(SetInfo setInfo)
setInfo
- The feature to be added to the SetInfo attribute.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 void replaceSetInfo(int i, SetInfo newSetInfo)
i
- The index into the array of SetInfos to remove.newSetInfo
- The new SetInfo.public final void indexFiles(boolean background)
background
- True to run this process as a background thread, else wait until
the update is done before returning.public final void reindexFiles(boolean background)
background
- DESCRIPTIONpublic void setDoubleIndexing(boolean isIndexingTwice)
isIndexingTwice
- The new doubleIndexing valuepublic RecordDataService getRecordDataService()
public ArrayList getAdminEmails()
public String getAdminEmail(int i)
i
- DESCRIPTION
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 static void setXMLConversionService(XMLConversionService cs)
cs
- The new XMLConversionService.public void log(String msg)
msg
- Message to be logged.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.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |