Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.8.2 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.pubsub
Class PubSubEngine

    java.lang.Object
      org.jivesoftware.openfire.pubsub.PubSubEngine

    public class PubSubEngine

extends Object

A PubSubEngine is responsible for handling packets sent to a pub-sub service.

Author:
  Matt Tucker

Constructor Summary
`PubSubEngine(PacketRouter router)`

Method Summary
`static Collection<String>` | `getShowPresences(PubSubService service, org.xmpp.packet.JID subscriber)` Returns the show values of the last know presence of all connected resources of the specified subscriber.
`static void` | `presenceSubscriptionNotRequired(PubSubService service, Node node, org.xmpp.packet.JID user)` Requests the pubsub service to subscribe to the presence of the user.
`static void` | `presenceSubscriptionRequired(PubSubService service, Node node, org.xmpp.packet.JID user)` Requests the pubsub service to unsubscribe from the presence of the user.
`boolean` | `process(PubSubService service, org.xmpp.packet.IQ iq)` Handles IQ packets sent to the pubsub service.
`void` | `process(PubSubService service, org.xmpp.packet.Message message)` Handles Message packets sent to the pubsub service.
`void` | `process(PubSubService service, org.xmpp.packet.Presence presence)` Handles Presence packets sent to the pubsub service.
`void` | `shutdown(PubSubService service)`
`void` | `start(PubSubService service)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PubSubEngine

    public PubSubEngine(PacketRouter router)

Method Detail

### process

    public boolean process(PubSubService service,
                           org.xmpp.packet.IQ iq)

  Handles IQ packets sent to the pubsub service. Requests of disco#info and disco#items are not being handled by the engine. Instead the service itself should handle disco packets.

  Parameters:
    `service` - the PubSub service this action is to be performed for.
    `iq` - the IQ packet sent to the pubsub service.
  Returns:
    true if the IQ packet was handled by the engine.

### process

    public void process(PubSubService service,
                        org.xmpp.packet.Presence presence)

  Handles Presence packets sent to the pubsub service. Only process available and not available presences.

  Parameters:
    `service` - the PubSub service this action is to be performed for.
    `presence` - the Presence packet sent to the pubsub service.

### process

    public void process(PubSubService service,
                        org.xmpp.packet.Message message)

  Handles Message packets sent to the pubsub service. Messages may be of type error when an event notification was sent to a susbcriber whose address is no longer available.

  Answers to authorization requests sent to node owners to approve pending subscriptions will also be processed by this method.

  Parameters:
    `service` - the PubSub service this action is to be performed for.
    `message` - the Message packet sent to the pubsub service.

### start

    public void start(PubSubService service)

### shutdown

    public void shutdown(PubSubService service)

### getShowPresences

    public static Collection<String> getShowPresences(PubSubService service,
                                                      org.xmpp.packet.JID subscriber)

  Returns the show values of the last know presence of all connected resources of the specified subscriber. When the subscriber JID is a bare JID then the answered collection will have many entries one for each connected resource. Moreover, if the user is offline then an empty collectin is returned. Available show status is represented by a `online` value. The rest of the possible show values as defined in RFC 3921.

  Parameters:
    `service` - the PubSub service this action is to be performed for.
    `subscriber` - the JID of the subscriber. This is not the JID of the affiliate.
  Returns:
    an empty collection when offline. Otherwise, a collection with the show value of each connected resource.

### presenceSubscriptionNotRequired

    public static void presenceSubscriptionNotRequired(PubSubService service,
                                                       Node node,
                                                       org.xmpp.packet.JID user)

  Requests the pubsub service to subscribe to the presence of the user. If the service has already subscribed to the user's presence then do nothing.

  Parameters:
    `service` - the PubSub service this action is to be performed for.
    `node` - the node that originated the subscription request.
    `user` - the JID of the affiliate to subscribe to his presence.

### presenceSubscriptionRequired

    public static void presenceSubscriptionRequired(PubSubService service,
                                                    Node node,
                                                    org.xmpp.packet.JID user)

  Requests the pubsub service to unsubscribe from the presence of the user. If the service was not subscribed to the user's presence or any node still requires to be subscribed to the user presence then do nothing.

  Parameters:
    `service` - the PubSub service this action is to be performed for.
    `node` - the node that originated the unsubscription request.
    `user` - the JID of the affiliate to unsubscribe from his presence.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.8.2 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Jive Software.