com.sapportals.wcm.service.indexmanagement

Interface ITaskQueueHandler


public interface ITaskQueueHandler

The handler puts index management tasks into the task queue of the task queue service and reads index management tasks from the task queue to execute them.
ITaskQueueHandler is mainly responsible for indexing, reindexing and delta indexing of documents. If no TaskQueueService is active the methods are immediately executed. Otherwise tasks are enqueued in a task queue. The task queue is checked according to a time interval, which could be adjusted in the system configuration. This way, it is possible to execute different tasks on different machines in a distributed CM scenario. Internally this interface is also used by particular indexes , when the corresponding methods are called. Changes between major releases 7.0 and 7.X

See Also:
IIndex, AbstractIndex

Method Summary
 void createTaxonomyHierarchyByCopiing(String taxonomyName, ICollection existingHierarchy, IClassificationIndex index)
          The taxonomy hierarchy is created by copying an existing hierarchy.
 void deindexDocuments(IIndex index, IRidList deindexRids, boolean removeClassification)
          Deindexes a list of document IDs from an index.
 void deltaReindex(IIndex index)
          Performs indexing of the documents that are not yet indexed or have been changed since the last crawl.
 void executeTask(ITask task)
          Runs an index management task of the task queue service.
 void indexDocument(IIndex index, IResource document, IResourceEvent event)
          Indexes a document into an index.
 void reindex(IIndex index, boolean disablePostClearTasks)
          Clears the index and starts putting all documents into the index again.
 void reindexWithoutClear(IIndex index)
          Starts putting all documents into the index again without clearing it first.
 void startDeindexCrawler(IIndex index, RID startRid)
          Runs a deindex crawl as a separate thread.
 void startDeindexCrawler(IIndex index, RID startRid, IResourceEvent event, RID eventPreRid, RID eventNewRid, String crawlerProfileId)
          Runs a deindex crawl as a separate thread.
 void startDeltaCrawler(IIndex index, RID startRid)
          Runs an delta index crawl as a separate thread.
 void startIndexCrawler(IIndex index, RID startRid, IResourceEvent event)
          Runs an index crawl as a separate thread.
 void startTrainingCrawler(String taxonomyName, ICollection taxonomyCollection, IClassificationIndex index, boolean isSearchRelevant)
          Runs a taxonomy training crawler as a separate thread.
 void updateCategoryContents(String taxonomyName, boolean dirtyOnly, IIndex index, IResourceContext context, boolean markCategoriesUpdated)
          Starts a process that checks and updates categories of a taxonomy where the query is not in sync with the documents of category.
 

Method Detail

startIndexCrawler

void startIndexCrawler(IIndex index,
                       RID startRid,
                       IResourceEvent event)
                       throws WcmException
Runs an index crawl as a separate thread.
An index crawl indexes all documents that are crawled.

Parameters:
index - index where the documents have to be indexed into
startRid - start resource of the crawl
event - event that caused the index request; can be null
Throws:
WcmException - exception raised in failure situation

startDeltaCrawler

void startDeltaCrawler(IIndex index,
                       RID startRid)
                       throws WcmException
Runs an delta index crawl as a separate thread.
An delta index crawl indexes all changed documents since the last crawl.

Parameters:
index - index where the documents have to be indexed into
startRid - start resource of the crawl
Throws:
WcmException - exception raised in failure situation

startTrainingCrawler

void startTrainingCrawler(String taxonomyName,
                          ICollection taxonomyCollection,
                          IClassificationIndex index,
                          boolean isSearchRelevant)
                          throws WcmException
Runs a taxonomy training crawler as a separate thread.
A taxonomy training crawl copies an existing folder hierarchy as a taxonomy and uses documents inside to train the categories.

Parameters:
taxonomyName - name of taxonomy
taxonomyCollection - start folder for the crawl; represents the taxonomy root
index - index where the documents have to be indexed into
isSearchRelevant - if true the start folder is attached to the index, if false the crawl is only used to build the taxonomy.
Throws:
WcmException - exception raised in failure situation

createTaxonomyHierarchyByCopiing

void createTaxonomyHierarchyByCopiing(String taxonomyName,
                                      ICollection existingHierarchy,
                                      IClassificationIndex index)
                                      throws WcmException
The taxonomy hierarchy is created by copying an existing hierarchy.

Parameters:
taxonomyName - name of taxonomy
existingHierarchy - root folder of the hierarchy to copy
index - classification index where the taxonomy will be created
Throws:
WcmException

startDeindexCrawler

void startDeindexCrawler(IIndex index,
                         RID startRid)
                         throws WcmException
Runs a deindex crawl as a separate thread.
An deindex crawl removes all crawled documents from the index.

Parameters:
index - index where the documents have to be deindexed from
startRid - start resource ID of the crawl
Throws:
WcmException - exception raised in failure situation

startDeindexCrawler

void startDeindexCrawler(IIndex index,
                         RID startRid,
                         IResourceEvent event,
                         RID eventPreRid,
                         RID eventNewRid,
                         String crawlerProfileId)
                         throws WcmException
Runs a deindex crawl as a separate thread.
An deindex crawl removes all crawled documents from the index.

Parameters:
index - index where the documents have to be deindexed from
startRid - start resource ID of the crawl
event - event that caused the deindex request; can be null
eventPreRid - resource ID of the events resource before an action like rename or move.
eventNewRid - current resource ID of the events resource
crawlerProfileId - crawler profile id of the data source as fallback if the data source is not available anymore when requesting the crawler profile id after a detach.
Throws:
WcmException - exception raised in failure situation

indexDocument

void indexDocument(IIndex index,
                   IResource document,
                   IResourceEvent event)
                   throws WcmException
Indexes a document into an index.

Parameters:
index - index where the documents have to be indexed into
document - document to index
event - event that caused the index request; can be null
Throws:
WcmException - exception raised in failure situation

reindex

void reindex(IIndex index,
             boolean disablePostClearTasks)
             throws WcmException
Clears the index and starts putting all documents into the index again.
It may be necessary to reindex an index may be needed if a CM repository that is assigned to the index now points to another underlying repository. This can be caused by configuration changes. If this is the case, the documents in the index are no longer accessible from CM and must be removed from the index. The documents of the new target repository also have to be indexed.

Parameters:
index - index to reindex
disablePostClearTasks - if true, the tasks that can be performed by the index implementation after the index has been cleared are skipped.
Example: Do not train the classification index before reindexing all documents.
Throws:
WcmException - exception raised in failure situation

reindexWithoutClear

void reindexWithoutClear(IIndex index)
                         throws WcmException
Starts putting all documents into the index again without clearing it first.
It may be necessary to reindex an index may be needed if a CM repository that is assigned to the index now points to another underlying repository. This can be caused by configuration changes. If this is the case, the documents in the index are no longer accessible from CM and must be removed from the index. The documents of the new target repository also have to be indexed.

Parameters:
index - index to reindex
Throws:
WcmException - exception raised in failure situation

deltaReindex

void deltaReindex(IIndex index)
                  throws WcmException
Performs indexing of the documents that are not yet indexed or have been changed since the last crawl. Additionally, it deindexes documents from the index that were indexed but have since been deleted. In contrast to the reindex method, this call does not clear the index.

Parameters:
index -
Throws:
WcmException - exception raised in failure situation

deindexDocuments

void deindexDocuments(IIndex index,
                      IRidList deindexRids,
                      boolean removeClassification)
                      throws WcmException
Deindexes a list of document IDs from an index.

Parameters:
index - index where the documents have to be deindexed from
deindexRids - list of resource IDs to deindex
removeClassification - if true the classification if the documents is deleted, if false the classification remains.
Throws:
WcmException - exception raised in failure situation

updateCategoryContents

void updateCategoryContents(String taxonomyName,
                            boolean dirtyOnly,
                            IIndex index,
                            IResourceContext context,
                            boolean markCategoriesUpdated)
                            throws WcmException
Starts a process that checks and updates categories of a taxonomy where the query is not in sync with the documents of category.

Parameters:
taxonomyName - name of the taxonomy to check
dirtyOnly - if false all categories are checked, if false only categories that are out of sync (dirty) are updated.
index - index where the taxonomy is defined
context - user context
markCategoriesUpdated - if false the updated categories remain dirty
Throws:
WcmException - exception raised in failure situation

executeTask

void executeTask(ITask task)
                 throws WcmException
Runs an index management task of the task queue service.
This method is called by the task queue reader of the index management service.

Parameters:
task - task queue task
Throws:
WcmException - exception raised in failure situation
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice