DLESE Tools
v1.2

org.dlese.dpc.repository
Class RepositoryManager

java.lang.Object
  extended byorg.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 an index of the metadata, with support for multiple collections and metadata formats.

Author:
John Weatherley

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

RepositoryManager

public RepositoryManager(String repositoryDataDir)
Constructor for the RepositoryManager that uses default settings.

Parameters:
repositoryDataDir - Absolute path the the directory where all repository data is stored.

RepositoryManager

public RepositoryManager(String repositoryDataDir,
                         int updateFrequency)
Constructor for the RepositoryManager object

Parameters:
repositoryDataDir - DESCRIPTION
updateFrequency - DESCRIPTION

RepositoryManager

public RepositoryManager(String repositoryDataDir,
                         String indexLocation,
                         int updateFrequency,
                         RecordDataService recordDataService,
                         boolean removeDocs)
Constructor for the RepositoryManager object

Parameters:
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

init

public int init()
Init method initializes the data for serving.

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.


setDupItemsIndex

public void setDupItemsIndex(SimpleLuceneIndex dupItemsIndex)

getLastModifiedTime

public long getLastModifiedTime()
Gets the time this repository was last modified. Reflects the last time an action occured that might have resulted in a change in the number of displayable items in the repository.

Returns:
The time this repository was last modified.

getIndexingMessages

public ArrayList getIndexingMessages()
Gets the indexingMessages attribute of the RepositoryManager object

Returns:
The indexingMessages value

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.

updateVocab

public void updateVocab(MetadataVocab newVocab)
Update the current MetadataVocab with a new one.

Parameters:
newVocab - The new MetadataVocab object.

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 providerStatus attribute of the RepositoryManager object

Returns:
The providerStatus value [ENABLED or DISABLED]

setProviderStatus

public void setProviderStatus(String value)
Sets the providerStatus attribute of the RepositoryManager object

Parameters:
value - The new providerStatus value [ENABLED or DISABLED]

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 deletedRecord attribute of the RepositoryManager object

Returns:
The deletedRecord value

setDeletedRecord

public void setDeletedRecord(String value)
Sets the deletedRecord attribute of the RepositoryManager object

Parameters:
value - The new deletedRecord value

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

getContextUrl

public String getContextUrl(HttpServletRequest req)
Gets the URL that refers to the current servlet context, for example "http://host:8080/my_app_context".

Parameters:
req - The request
Returns:
The contextUrl.

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 - DESCRIPTION
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 email)
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:
email - The admin e-mail to be added.
index - 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.

getRecord

public ResultDoc getRecord(String id)
Performs a GetRecord for an individual itme in the repository.

Parameters:
id - The ID for the item.
Returns:
The record value.
See Also:
getQueryResults(String format,String set,String from,String until)

getQueryResults

public ResultDoc[] getQueryResults(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:
getRecord(String id)

getOdlQueryResults

public ResultDoc[] getOdlQueryResults(String format,
                                      String set,
                                      String from,
                                      String until,
                                      String queryString)
                               throws Exception
Gets the results of an OLD search. If queryString is null then this will perform a standard OAI-PMH 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 - The keyword query string to search over.
Returns:
The queryResults value.
Throws:
Exception - If error occues, exception will contain a message meant for human consumption in response error messages.

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 - DESCRIPTION
Returns:
The formatsThatCanBeConvertedToFormats list.

getIndexedSets

public ArrayList getIndexedSets()
Gets the sets that are in the index.

Returns:
A list of set setSecs.
See Also:
getSetSearchKeys()

getSetSearchKeys

public List getSetSearchKeys()
Gets a list of all search keys used to search for sets.

Returns:
The setSearchKeys value.
See Also:
getIndexedSets()

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:
isSetConfigured(String set)

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.

Returns:
The metadataFormats available.

getAvailableFormatsList

public List getAvailableFormatsList()
Gets all possible metadata formats that may be disiminated by this RepositoryManager.

Returns:
The metadataFormats available.

getAvailableFormats

public Hashtable getAvailableFormats(String id)
Gets all possible metadata formats that are available for a given record.

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 name of the set.
Returns:
True if the given set is currently configured in this repository.
See Also:
isSetInIndex(String set)

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.

getConfiguredSets

public ArrayList getConfiguredSets()
Gets a List of sets that are currently configured in this repository.

Returns:
The configuredSets value

getEnabledSets

public ArrayList getEnabledSets()
Gets the configured sets 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.

getEnabledSetsQuery

public String getEnabledSetsQuery()
Gets the configured sets that are currently enabled in this repository as a String suitable for use in s Lucene query.

Returns:
The enabledSets value.

getDisabledSets

public ArrayList getDisabledSets()
Gets the configured sets that are currently disabled in this repository.

Returns:
The disabledSets value

getSetInfos

public ArrayList getSetInfos()
Gets the SetInfos that are currently configured in the repository.

Returns:
The setInfos.
See Also:
SetInfo

getSetInfosCopy

public ArrayList getSetInfosCopy()
Gets a copy of the SetInfos 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:
SetInfo

getSetInfo

public SetInfo getSetInfo(int i)
Gets the setInfo at the give index, suitable for reading but not modifying.

Parameters:
i - The index into the SetInfo.
Returns:
The setInfo value.

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)
Adds a new set and begins re-indexing.

Parameters:
setInfo - The feature to be added to the SetInfo attribute.

removeSetInfo

public void removeSetInfo(SetInfo setInfo)
Remove the given setinfo from the repository.

Parameters:
setInfo - The set info to remove.
See Also:
SetInfo

removeSetInfo

public void removeSetInfo(int i)
Removes the given SetInfo form the repository.

Parameters:
i - The index of the SetInfo to remove.
See Also:
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.

indexFiles

public final void indexFiles(boolean background)
Updates the index to reflect the files in the directories this manager is monitoring. Any new, deleted or modified files that appear in the directories will be reflected in the index. This process may take several minutes to return depending on the number of files needing to be updated.

Parameters:
background - True to run this process as a background thread, else wait until the update is done before returning.

reindexFiles

public final void reindexFiles(boolean background)
DESCRIPTION

Parameters:
background - DESCRIPTION

setDoubleIndexing

public void setDoubleIndexing(boolean isIndexingTwice)
Sets the doubleIndexing attribute of the RepositoryManager object

Parameters:
isIndexingTwice - The new doubleIndexing value

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 - DESCRIPTION
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:
email - The admin e-mail to be added.
index - DESCRIPTION

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.

setXMLConversionService

public static void setXMLConversionService(XMLConversionService cs)
Sets the XMLConversionService used by this RepositoryManager.

Parameters:
cs - The new XMLConversionService.

log

public void log(String msg)
Logger hook

Parameters:
msg - Message to be logged.

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

DLESE Tools
v1.2