SAP NetWeaver '04

com.sapportals.wcm.service.indexmanagement
Interface ITaskQueueHandler

[contained in: com.sap.km.cm.service.par - km.shared.service.indexmanagement_api.jar]
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 deltaindexing 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 intervall, 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.

See Also:
IIndex, AbstractIndex

Method Summary
 void activateSchedulerEntry(java.lang.String schedulerEntryId)
          Activates a newly created scheduler entry for the current system of the task queue reader.
 void createTaxonomyHierarchyByCopiing(java.lang.String taxonomyName, ICollection existingHierarchy, IClassificationIndex index)
          The taxonomy hierarchy is created by copiing 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 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, java.lang.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(java.lang.String taxonomyName, ICollection taxonomyCollection, IClassificationIndex index, boolean isSearchRelevant)
          Runs a taxonomy training crawler as a separate thread.
 void updateCategoryContents(java.lang.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

public 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

public 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

public void startTrainingCrawler(java.lang.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

public void createTaxonomyHierarchyByCopiing(java.lang.String taxonomyName,
                                             ICollection existingHierarchy,
                                             IClassificationIndex index)
                                      throws WcmException
The taxonomy hierarchy is created by copiing 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

startDeindexCrawler

public 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

public void startDeindexCrawler(IIndex index,
                                RID startRid,
                                IResourceEvent event,
                                RID eventPreRid,
                                RID eventNewRid,
                                java.lang.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

public 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

public 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

deltaReindex

public 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.
Throws:
WcmException - exception raised in failure situation

deindexDocuments

public 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

activateSchedulerEntry

public void activateSchedulerEntry(java.lang.String schedulerEntryId)
                            throws WcmException
Activates a newly created scheduler entry for the current system of the task queue reader.
Parameters:
schedulerEntryId - id of the scheduler entry
Throws:
WcmException - exception raised in failure situation

updateCategoryContents

public void updateCategoryContents(java.lang.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

public 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

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.