tigase.server.ssender

## Class DrupalCommentsTask

- java.lang.Object
- - java.util.TimerTask
  - - tigase.server.ssender.SenderTask
    - - tigase.server.ssender.DrupalCommentsTask

- All Implemented Interfaces:
    Runnable

      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.

  You have to specify destination JID where comments have to be sent. It is not very useful to send post to just one person so to ditribute forum posts to biger number of users this task should be paired with `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

  Created: Fri Apr 20 12:10:55 2007

  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `DrupalCommentsTask()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cancel()` Method description
    `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()` `run` method is where all task work is done.

    - ### Methods inherited from class tigase.server.ssender.SenderTask

      `getName, setName`

    - ### Methods inherited from class java.util.TimerTask

      `scheduledExecutionTime`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### lastCommentsCheck

          protected long lastCommentsCheck

      `lastCheck` keeps time of last forum comments check so it gets only new posts.

    - #### lastTopicsCheck

          protected long lastTopicsCheck

      `lastCheck` keeps time of last forum topics check so it gets only new posts.

  - ### Constructor Detail

    - #### DrupalCommentsTask

          public DrupalCommentsTask()

  - ### Method Detail

    - #### cancel

          public boolean cancel()

      Method description
      Overrides:
        `cancel` in class `TimerTask`
      Returns:

    - #### getInitString

          public String getInitString()

      `getInitString` method returns initialization string passed to it in `init()` method.
      Specified by:
        `getInitString` in class `SenderTask`
      Returns:
        a `String` value of initialization string.

    - #### init

          public void init(StanzaHandler handler,
                  String initString)
                    throws IOException

      `init` method is a task specific initialization rountine.
      Specified by:
        `init` in class `SenderTask`
      Parameters:
        `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.
      Throws:
        `IOException` - if an error occurs during task or data storage initialization.

    - #### run

          public void run()

      `run` method is where all task work is done.
      Specified by:
        `run` in interface `Runnable`
      Specified by:
        `run` in class `TimerTask`

    - #### getNewPackets

          protected Queue<Packet> getNewPackets()

Copyright © 2013 Tigase. All rights reserved.