public class CollectionIndexer
extends java.lang.Object
Constructor and Description |
---|
CollectionIndexer(RepositoryManager repositoryManager,
IndexingManager indexingManager)
Constructor for the CollectionIndexer object
|
Modifier and Type | Method and Description |
---|---|
void |
deleteCollection(java.lang.String collectionKey)
Delete a collection and all its records from a DDS repository.
|
void |
deletePreviousSessionRecords(CollectionIndexingSession currentSession)
Delete all records that DO NOT have the given session ID.
|
void |
deleteRecord(java.lang.String id)
Deletes a record in the repository.
|
java.util.List |
getConfiguredCollections()
Get a list of the collections currently configured.
|
static java.lang.String |
getDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout:
|
protected CollectionIndexingSession |
getExistingCollectionIndexingSession(java.lang.String sessionId)
Gets the existingCollectionIndexingSession attribute of the CollectionIndexer object
|
CollectionIndexingSession |
getNewCollectionIndexingSession(java.lang.String collectionKey)
Gets the newCollectionIndexingSession attribute of the CollectionIndexer object
|
boolean |
isCollectionConfigured(java.lang.String collectionKey)
Gets the collectionConfigured attribute of the CollectionIndexer object
|
void |
printStatusMessage(java.lang.String msg)
Post a status message to the indexing process to let admins know the current indexing status.
|
void |
putCollection(java.lang.String collectionKey,
java.lang.String format,
java.lang.String name,
java.lang.String description,
java.lang.String additionalMetadata)
Put a collection in the repository.
|
void |
putRecord(java.lang.String recordXml,
java.lang.String collectionKey,
java.lang.String id,
CollectionIndexingSession session)
Put a record in a collection, adding or replacing the given record in the repository.
|
static void |
setDebug(boolean db)
Sets the debug attribute of the CollectionIndexer object
|
public CollectionIndexer(RepositoryManager repositoryManager, IndexingManager indexingManager)
repositoryManager
- The RepositoryManagerindexingManager
- The IndexingManagerpublic void putCollection(java.lang.String collectionKey, java.lang.String format, java.lang.String name, java.lang.String description, java.lang.String additionalMetadata) throws java.lang.Exception
collectionKey
- The collection key, for example 'dcc'format
- The XML format for the records that will reside in the collectionname
- A display name for the collectiondescription
- A long description for the collectionadditionalMetadata
- A text or XML string to be inserted into the additionalMetadata element of the
collection record, or null for nonejava.lang.Exception
- If errorpublic void deleteCollection(java.lang.String collectionKey) throws java.lang.Exception
collectionKey
- The key indicatint the collection to deletejava.lang.Exception
- If errorpublic java.util.List getConfiguredCollections()
public boolean isCollectionConfigured(java.lang.String collectionKey)
collectionKey
- The key for the collectionpublic void putRecord(java.lang.String recordXml, java.lang.String collectionKey, java.lang.String id, CollectionIndexingSession session) throws java.lang.Exception
recordXml
- The XML for this recordcollectionKey
- The collection this record should be putid
- The ID of the record - ignored if the ID can be derived from the record XMLsession
- An indexing session ID - used for deleting records later after a new indexing
session occursjava.lang.Exception
- If errorpublic void deleteRecord(java.lang.String id) throws java.lang.Exception
id
- Id of the record.java.lang.Exception
- If errorpublic CollectionIndexingSession getNewCollectionIndexingSession(java.lang.String collectionKey)
collectionKey
- The collectionpublic void printStatusMessage(java.lang.String msg)
msg
- The message to postprotected CollectionIndexingSession getExistingCollectionIndexingSession(java.lang.String sessionId)
sessionId
- The session IDpublic void deletePreviousSessionRecords(CollectionIndexingSession currentSession)
currentSession
- The session IDpublic static java.lang.String getDateStamp()
public static final void setDebug(boolean db)
db
- The new debug value