public class DrupalCommentsTask extends SenderTask
DrupalCommentsTask
implements tasks for cyclic retrieving new
comments in the Drupal database.
Then it can sends this to one selected JID. Thus it should be used toghether
with StanzaReceiver task which can distribute this informatin to all interested
(subscribed) users.
StanzaReceiver
task which
can distribute it to all interested users.
Sample connection string:
jdbc:mysql://localhost/tigasedb?user=tigase&password=pass&id=nick@domain.com
Modifier and Type | Field and Description |
---|---|
protected long |
lastCommentsCheck
lastCheck keeps time of last forum comments check so it
gets only new posts. |
protected long |
lastTopicsCheck
lastCheck keeps time of last forum topics check so it
gets only new posts. |
Constructor and Description |
---|
DrupalCommentsTask() |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel() |
String |
getInitString()
getInitString method returns initialization string passed
to it in init() method. |
protected Queue<Packet> |
getNewPackets() |
void |
init(StanzaHandler handler,
String initString)
init method is a task specific initialization rountine. |
void |
run() |
getName, setName
scheduledExecutionTime
protected long lastCommentsCheck
lastCheck
keeps time of last forum comments check so it
gets only new posts.protected long lastTopicsCheck
lastCheck
keeps time of last forum topics check so it
gets only new posts.public String getInitString()
SenderTask
getInitString
method returns initialization string passed
to it in init()
method.getInitString
in class SenderTask
String
value of initialization string.public void init(StanzaHandler handler, String initString) throws IOException
SenderTask
init
method is a task specific initialization rountine.init
in class SenderTask
handler
- a StanzaHandler
value is a reference to object
which handles all stanza retrieved from data source. The handler is
responsible for delivering stanza to destination address.initString
- a String
value is an initialization string
for this task. For example database tasks would expect database connection
string here, filesystem task would expect directory here.IOException
- if an error occurs during task or data storage
initialization.Copyright © 2017 "Tigase, Inc.". All rights reserved.