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.
-
ALREADY_VISITED
- Link has already been visited during the crawl, so it was skipped.
-
DOWNLOADED
- Link has been retrieved
-
ERROR
- An error occurred in retrieving the page.
-
eventName
- Map from id code (RETRIEVING) to name ("retrieving")
-
NONE
- No event occured on this link yet.
-
QUEUED
- Link was accepted by walk() and is waiting to be downloaded
-
RETRIEVING
- Link is being retrieved
-
SKIPPED
- Link was rejected by shouldVisit()
-
VISITED
- Link has been thoroughly processed by crawler
-
LinkEvent(Crawler, int, Link)
- Make a LinkEvent.
-
LinkEvent(Crawler, int, Link, Throwable)
- Make a LinkEvent for an error.
-
getCrawler()
- Get crawler that generated the event
-
getException()
- Get exception related to this event.
-
getID()
- Get event id
-
getLink()
- Get link to which this event occurred.
-
getName()
- Get event name (string equivalent to its ID)
-
toString()
- Convert this event to a String describing it.
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().
SKIPPED
public static final int SKIPPED
- Link was rejected by shouldVisit()
ALREADY_VISITED
public static final int ALREADY_VISITED
- Link has already been visited during the crawl, so it was skipped.
QUEUED
public static final int QUEUED
- Link was accepted by walk() and is waiting to be downloaded
RETRIEVING
public static final int RETRIEVING
- Link is being retrieved
ERROR
public static final int ERROR
- An error occurred in retrieving the page.
The error can be obtained from getException().
DOWNLOADED
public static final int DOWNLOADED
- Link has been retrieved
VISITED
public static final int VISITED
- Link has been thoroughly processed by crawler
eventName
public static final String eventName[]
- Map from id code (RETRIEVING) to name ("retrieving")
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
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
getCrawler
public Crawler getCrawler()
- Get crawler that generated the event
- Returns:
- crawler
getID
public int getID()
- Get event id
- Returns:
- id
getName
public String getName()
- Get event name (string equivalent to its ID)
- Returns:
- id
getLink
public Link getLink()
- Get link to which this event occurred.
- Returns:
- link
getException
public Throwable getException()
- Get exception related to this event. Valid when ID == ERROR.
- Returns:
- exception object
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