@ThreadSafe public class HarvestCache extends Object
HarvestCache HarvestCache ^ ^ | | | MessageContext | Message | | | | Detectors Parse message from HTML (harvester) UpdateKick (via Kicker) 1. Message detection ------------> 2. Archive harvestingThe steps of 1. and 2. are completely separated, since we have to parse the information from the web anyway to gain valid URLs for some media. If the Url to the message can be parsed in the detector no harvesting (web scraping) of the archive is necessary and Message objects can directly be used. In fact they both only differ in this very crucial information.
Modifier and Type | Class and Description |
---|---|
static class |
HarvestCache.ConstructionContext
A context for configuring the construction of a vote-server.
|
Modifier and Type | Field and Description |
---|---|
static int |
CHARLIMIT
Maximum length of the communication excerpt cut out of the message body.
|
Modifier and Type | Method and Description |
---|---|
boolean |
check(MessageContext mc,
Authenticator av)
TODO Examine the message for difference-urls and return whether this
message contains valid difference information.
|
List<String> |
findDiffUrls(String searchedString)
Lists all interesting difference-urls.
|
Database |
getDatabase()
Access the database of this HarvestCache instance.
|
DiffMessageTable |
getTable()
Access this table to
DiffMessageTable.get(String, String[], int) messages.
|
static HarvestCache |
i()
Implemented as singleton.
|
static HarvestCache |
init(VoteServer.Run vsRun)
The cache needs access to a VoteServer.Run and must be initialized
before usage.
|
XCastRelation |
relation(String author,
String addressee,
String pollName)
TODO was private, privatize again when vote history is available.
|
boolean |
store(Message msg,
Authenticator av)
Call this once you have a valid message including
url to the web, to store it permanently in
the database.
|
VoteServer |
voteServer()
Return the VoteServer instance for this Cache.
|
public static final int CHARLIMIT
public static HarvestCache init(VoteServer.Run vsRun)
public static HarvestCache i()
public Database getDatabase()
public VoteServer voteServer()
public boolean check(MessageContext mc, Authenticator av)
mc
- Context of the message to check.av
- Verifier for forum identities.public boolean store(Message msg, Authenticator av)
msg
- Message to process.av
- Verifier for this communication medium's identities.public DiffMessageTable getTable()
public List<String> findDiffUrls(String searchedString)
searchedString
- Message body or content to search.expandDiffMessages(Message)
,
diffPatterns
public XCastRelation relation(String author, String addressee, String pollName)
author
- addressee
- pollName
-