tigase.server.sreceiver

## Class ShortNewsPublisher

- java.lang.Object
- - tigase.server.sreceiver.AbstractReceiverTask
  - - tigase.server.sreceiver.RepoRosterTask
    - - tigase.server.sreceiver.ShortNewsPublisher

- All Implemented Interfaces:
    ReceiverTaskIfc

      public class ShortNewsPublisher
      extends RepoRosterTask

  This subscription tasks allows you to publish short news on your site. In fact this task behaves exactly as `NewsDistributor` tasks but it also writes all messages content to a table in database. Web application can then read content from this table and publish it on the Web site. Format of the table is as follows (schema definition in MySQL script):

       create table short_news (
         -- Automatic record ID
         snid            bigint unsigned NOT NULL auto_increment,
         -- Automaticly generated timestamp and automaticly updated on change
         publishing_time timestamp,
         -- Optional news type: 'shorts', 'minis', 'techs', 'funs'....
         news_type        varchar(10),
         -- Author JID
         author          varchar(128) NOT NULL,
         -- Short subject - this is short news, right?
         subject         varchar(128) NOT NULL,
         -- Short news message - this is short news, right?
         body            varchar(1024) NOT NULL,
         primary key(snid),
         key publishing_date (publishing_date),
         key author (author)
       ) default character set utf8;

  Created: Sat May 26 10:25:42 2007
  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ShortNewsPublisher()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy(Queue<Packet> results)` Method description
    `Map<String,PropertyItem>` | `getDefaultParams()` Method description
    `String` | `getHelp()` Method description
    `String` | `getType()` Method description
    `protected void` | `processMessage(Packet packet, Queue<Packet> results)` Method description
    `void` | `setParams(Map<String,Object> map)` Method description

    - ### Methods inherited from class tigase.server.sreceiver.RepoRosterTask

      `addToRoster, loadRoster, removeFromRoster, setRosterItemAdmin, setRosterItemModerationAccepted, setRosterItemOwner, setRosterItemSubscribed`

    - ### Methods inherited from class tigase.server.sreceiver.AbstractReceiverTask

      `addNewSubscribers, addOutPacket, addToRoster, getDescription, getInstance, getJID, getParams, getRoster, getRosterItem, getStatistics, getStats, init, isAdmin, isAllowedToPost, isAllowedToSubscribe, processPacket, removeSubscribers, setJID, setRosterItemOnline, setStanzaReceiver`

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

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

- - ### Constructor Detail

    - #### ShortNewsPublisher

          public ShortNewsPublisher()

  - ### Method Detail

    - #### destroy

          public void destroy(Queue<Packet> results)

      Method description
      Specified by:
        `destroy` in interface `ReceiverTaskIfc`
      Overrides:
        `destroy` in class `RepoRosterTask`
      Parameters:
        `results` -

    - #### getDefaultParams

          public Map<String,PropertyItem> getDefaultParams()

      Method description
      Specified by:
        `getDefaultParams` in interface `ReceiverTaskIfc`
      Overrides:
        `getDefaultParams` in class `AbstractReceiverTask`
      Returns:
        a `Map` value with task instance configuration parameters.
      See Also:
        `ReceiverTaskIfc.setParams(Map)`

    - #### getHelp

          public String getHelp()

      Method description
      Returns:
        a `String` value of task class help information.

    - #### getType

          public String getType()

      Method description
      Returns:
        a `String` value of the task name.

    - #### setParams

          public void setParams(Map<String,Object> map)

      Method description
      Specified by:
        `setParams` in interface `ReceiverTaskIfc`
      Overrides:
        `setParams` in class `RepoRosterTask`
      Parameters:
        `map` -

    - #### processMessage

          protected void processMessage(Packet packet,
                                        Queue<Packet> results)

      Description copied from class: `AbstractReceiverTask`
      Method description
      Overrides:
        `processMessage` in class `AbstractReceiverTask`

Copyright © 2022 "Tigase, Inc.". All rights reserved.