SAP NetWeaver '04

com.sapportals.wcm.service.crawler
Class AbstractPushedResultReceiver

[contained in: com.sap.km.cm.service.base.par - km.shared.service.crawler_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.service.crawler.AbstractPushedResultReceiver
All Implemented Interfaces:
ICrawlerPushedResultReceiver, ICrawlerResultReceiver, ICrawlerResultReceiverExtension

Deprecated. as of NW04. The crawler service was replaced by the xcrawler service com.sapportals.wcm.service.xcrawler

public abstract class AbstractPushedResultReceiver
extends java.lang.Object
implements ICrawlerPushedResultReceiver, ICrawlerResultReceiverExtension

A base class for implementing pushed result receivers.

Copyright 2004 SAP AG


Field Summary
protected  ICrawler m_Crawler
          Deprecated. The crawler for this result receiver, as passed from onCrawlStart().
 
Fields inherited from interface com.sapportals.wcm.service.crawler.ICrawlerPushedResultReceiver
RESULT_CANCEL, RESULT_ERROR_DELETE, RESULT_ERROR_EXCLUDE, RESULT_ERROR_RETRY, RESULT_IGNORED, RESULT_OK
 
Constructor Summary
AbstractPushedResultReceiver()
          Deprecated. Create a basic pushed result receiver.
The default constructor has to be provided for scheduled crawlers.
 
Method Summary
abstract  IResourceContext getCrawlerContext()
          Deprecated. Called by the crawler to get a context to use for accessing the resources during the crawl.
abstract  java.lang.String getCrawlerName(java.util.Locale locale)
          Deprecated. Called to get an descriptive name for the crawler.
 boolean isStopping()
          Deprecated.  
 boolean onCrawlDown(IResource resource)
          Deprecated. Inform the receiver about the descending in the hierarchy.
 WcmException onCrawlException(java.lang.Exception exception, IResource resource)
          Deprecated. Called by the crawler when an exception occured during the crawl.
abstract  int onCrawlNext(IResource resource)
          Deprecated. Inform the receiver about the next visited resource inside a colleciton.
 boolean onCrawlStart(ICrawler crawler)
          Deprecated. Called by the crawler to signal the start of a crawl.
 boolean onCrawlStop()
          Deprecated. Called by the crawler to signal the end of a crawl.
 void onCrawlUp(IResource resource)
          Deprecated. Inform the receiver about the ascending in the hierarchy.
 void prepareStop()
          Deprecated. Called by the crawler to signal that all pending calls to methods of the result receiver have to return immediately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Crawler

protected ICrawler m_Crawler
Deprecated. 
The crawler for this result receiver, as passed from onCrawlStart().
Constructor Detail

AbstractPushedResultReceiver

public AbstractPushedResultReceiver()
Deprecated. 
Create a basic pushed result receiver.
The default constructor has to be provided for scheduled crawlers.
Method Detail

onCrawlNext

public abstract int onCrawlNext(IResource resource)
                         throws WcmException
Deprecated. 
Inform the receiver about the next visited resource inside a colleciton. This method is called between the calls to getCrawlerContext() and onCrawlStop().
Specified by:
onCrawlNext in interface ICrawlerPushedResultReceiver
Parameters:
a - IResource with the visited resource.
Returns:
an int with a result code (see RESULT_...).

getCrawlerName

public abstract java.lang.String getCrawlerName(java.util.Locale locale)
Deprecated. 
Called to get an descriptive name for the crawler.
Specified by:
getCrawlerName in interface ICrawlerResultReceiver
Returns:
a String with the crawlers name.

getCrawlerContext

public abstract IResourceContext getCrawlerContext()
Deprecated. 
Called by the crawler to get a context to use for accessing the resources during the crawl. This is the first call to the result receiver.
Specified by:
getCrawlerContext in interface ICrawlerResultReceiver
Returns:
a IResourceContext with the context to use or null if the context cannot be retrieved. A null will stop the crawler!

onCrawlException

public WcmException onCrawlException(java.lang.Exception exception,
                                     IResource resource)
Deprecated. 
Called by the crawler when an exception occured during the crawl. This method can be callend any time between onCrawlStart and onCrawlStop.
The default implementation ignores any exceptions.
Specified by:
onCrawlException in interface ICrawlerResultReceiver
Parameters:
exception - a Exception with the original exception.
resource - the IResource which caused the exception, if available, or null.
Returns:
a WcmException with the exception to throw (will stop the crawl or null if the exception should be ignored.

onCrawlStart

public boolean onCrawlStart(ICrawler crawler)
Deprecated. 
Called by the crawler to signal the start of a crawl. This is the second call to the result receiver, and the first for a crawl.
The default implementation stores the crawler to this.m_Crawler.
Specified by:
onCrawlStart in interface ICrawlerResultReceiver
Parameters:
crawler - the ICrawler which performs the crawl.
Returns:
a boolean true if the crawl should be performed, false if the result receiver want's to stop this crawl.

onCrawlStop

public boolean onCrawlStop()
Deprecated. 
Called by the crawler to signal the end of a crawl. This is the last call to the result receiver for a crawl.
The default implementation resets this.m_Crawler to null.
Specified by:
onCrawlStop in interface ICrawlerResultReceiver
Returns:
a boolean true if the crawled resources should be discarded, false if the delta list should be kept.

onCrawlDown

public boolean onCrawlDown(IResource resource)
                    throws WcmException
Deprecated. 
Inform the receiver about the descending in the hierarchy. This method is called between the calls to getCrawlerContext() and onCrawlStop(). Furthermore, this method is called after the onCrawlNext() for this collection.
The default implementation will always descend down into any collection.
Specified by:
onCrawlDown in interface ICrawlerPushedResultReceiver
Parameters:
an - IResource with the resource to descend into. This may be a collection (if HIERARCHICAL_ON is set as the hierarchical crawl mode) or may be a resource (if HIERARCHICAL_OFF is used).
Returns:
a boolean true if the crawler should descent in the hierarchy, false if this collection's hierarchy should not be crawled.

onCrawlUp

public void onCrawlUp(IResource resource)
               throws WcmException
Deprecated. 
Inform the receiver about the ascending in the hierarchy. This method is called between the calls to getCrawlerContext() and onCrawlStop(). Furthermore, this method is called at last after the onCrawlNext() for this collection.
The default implementation does nothing when ascending from a collection.
Specified by:
onCrawlUp in interface ICrawlerPushedResultReceiver
Parameters:
an - IResource with the resource to ascend from. This may be a collection (if HIERARCHICAL_ON is set as the hierarchical crawl mode) or may be a resource (if HIERARCHICAL_OFF is used).

prepareStop

public void prepareStop()
Deprecated. 
Called by the crawler to signal that all pending calls to methods of the result receiver have to return immediately. Since result receivers may reside a long time in a method call (e.g. for communication retries) there must be a way to tell them that the crawler should stop and that they have to return.
Specified by:
prepareStop in interface ICrawlerResultReceiverExtension

isStopping

public boolean isStopping()
Deprecated. 

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.