All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class websphinx.LinkEvent

java.lang.Object
   |
   +----websphinx.LinkEvent

public class LinkEvent
extends Object
Link event. A LinkEvent is issued when the crawler starts or stops retrieving a link, and when it makes a decision about a link.


Variable Index

 o ALREADY_VISITED
Link has already been visited during the crawl, so it was skipped.
 o DOWNLOADED
Link has been retrieved
 o ERROR
An error occurred in retrieving the page.
 o eventName
Map from id code (RETRIEVING) to name ("retrieving")
 o NONE
No event occured on this link yet.
 o QUEUED
Link was accepted by walk() and is waiting to be downloaded
 o RETRIEVING
Link is being retrieved
 o SKIPPED
Link was rejected by shouldVisit()
 o VISITED
Link has been thoroughly processed by crawler

Constructor Index

 o LinkEvent(Crawler, int, Link)
Make a LinkEvent.
 o LinkEvent(Crawler, int, Link, Throwable)
Make a LinkEvent for an error.

Method Index

 o getCrawler()
Get crawler that generated the event
 o getException()
Get exception related to this event.
 o getID()
Get event id
 o getLink()
Get link to which this event occurred.
 o getName()
Get event name (string equivalent to its ID)
 o toString()
Convert this event to a String describing it.

Variables

 o NONE
 public static final int NONE
No event occured on this link yet. Never delivered in a LinkEvent, but may be returned by link.getStatus().

 o SKIPPED
 public static final int SKIPPED
Link was rejected by shouldVisit()

 o ALREADY_VISITED
 public static final int ALREADY_VISITED
Link has already been visited during the crawl, so it was skipped.

 o QUEUED
 public static final int QUEUED
Link was accepted by walk() and is waiting to be downloaded

 o RETRIEVING
 public static final int RETRIEVING
Link is being retrieved

 o ERROR
 public static final int ERROR
An error occurred in retrieving the page. The error can be obtained from getException().

 o DOWNLOADED
 public static final int DOWNLOADED
Link has been retrieved

 o VISITED
 public static final int VISITED
Link has been thoroughly processed by crawler

 o eventName
 public static final String eventName[]
Map from id code (RETRIEVING) to name ("retrieving")

Constructors

 o LinkEvent
 public LinkEvent(Crawler crawler,
                  int id,
                  Link link)
Make a LinkEvent.

Parameters:
crawler - Crawler that generated this event
id - event code, like LinkEvent.RETRIEVING
link - Link on which this event occurred
 o LinkEvent
 public LinkEvent(Crawler crawler,
                  int id,
                  Link link,
                  Throwable exception)
Make a LinkEvent for an error.

Parameters:
crawler - Crawler that generated this event
id - Event code, usually ERROR
link - Link on which this event occurred
exception - Throwable

Methods

 o getCrawler
 public Crawler getCrawler()
Get crawler that generated the event

Returns:
crawler
 o getID
 public int getID()
Get event id

Returns:
id
 o getName
 public String getName()
Get event name (string equivalent to its ID)

Returns:
id
 o getLink
 public Link getLink()
Get link to which this event occurred.

Returns:
link
 o getException
 public Throwable getException()
Get exception related to this event. Valid when ID == ERROR.

Returns:
exception object
 o toString
 public String toString()
Convert this event to a String describing it.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index