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

## org.jivesoftware.openfire.pep
Class IQPEPHandler

    java.lang.Object
      org.jivesoftware.openfire.container.BasicModule
          org.jivesoftware.openfire.handler.IQHandler
              org.jivesoftware.openfire.pep.IQPEPHandler

All Implemented Interfaces:
  ChannelHandler, Module, ServerFeaturesProvider, ServerIdentitiesProvider, UserIdentitiesProvider, UserItemsProvider, UserEventListener, RosterEventListener, PresenceEventListener

    public class IQPEPHandler

extends IQHandler
implements ServerIdentitiesProvider, ServerFeaturesProvider, UserIdentitiesProvider, UserItemsProvider, PresenceEventListener, RosterEventListener, UserEventListener

An `IQHandler` used to implement XEP-0163: "Personal Eventing via Pubsub" Version 1.0

For each user on the server there is an associated `PEPService` interacting with a single `PubSubEngine` for managing the user's PEP nodes.

An IQHandler can only handle one namespace in its IQHandlerInfo. However, PEP related packets are seen having a variety of different namespaces. Thus, classes like `IQPEPOwnerHandler` are used to forward packets having these other namespaces to `handleIQ(IQ)`.

This handler is used for the following namespaces:

- http://jabber.org/protocol/pubsub
- http://jabber.org/protocol/pubsub#owner

Author:
  Armando Jagucki, Guus der Kinderen, guus.der.kinderen@gmail.com

Field Summary

Fields inherited from class org.jivesoftware.openfire.handler.IQHandler
`deliverer, sessionManager`

Constructor Summary
`IQPEPHandler()` Constructs a new `IQPEPHandler` instance.

Method Summary
`boolean` | `addingContact(Roster roster, RosterItem item, boolean persistent)` Notification message indicating that a contact is about to be added to a roster.
`void` | `availableSession(ClientSession session, org.xmpp.packet.Presence presence)` Notification message indicating that a session that was not available is now available.
`void` | `contactAdded(Roster roster, RosterItem item)` Notification message indicating that a contact has been added to a roster.
`void` | `contactDeleted(Roster roster, RosterItem item)` Notification message indicating that a contact has been deleted from a roster.
`void` | `contactUpdated(Roster roster, RosterItem item)` Notification message indicating that a contact has been updated.
`void` | `destroy()` Destroys the module.
`Iterator<String>` | `getFeatures()` Implements ServerFeaturesProvider to include all supported XEP-0060 features in the server's disco#info result (as per section 4 of XEP-0163).
`Iterator<org.dom4j.Element>` | `getIdentities()` Implements ServerIdentitiesProvider and UserIdentitiesProvider, adding the PEP identity to the respective disco#info results.
`IQHandlerInfo` | `getInfo()` Returns the handler information to help generically handle IQ packets.
`PEPServiceManager` | `getServiceManager()`
`Iterator<org.dom4j.Element>` | `getUserItems(String name, org.xmpp.packet.JID senderJID)` Implements UserItemsProvider, adding PEP related items to a disco#items result.
`org.xmpp.packet.IQ` | `handleIQ(org.xmpp.packet.IQ packet)` Handles the received IQ packet.
`void` | `initialize(XMPPServer server)` Initializes the basic module.
`boolean` | `isEnabled()` Returns true if the PEP service is enabled in the server.
`void` | `presenceChanged(ClientSession session, org.xmpp.packet.Presence presence)` Notification message indicating that an available session has changed its presence.
`void` | `rosterLoaded(Roster roster)` Notification message indicating that a roster has just been loaded.
`void` | `start()` Starts the basic module.
`void` | `stop()` Stops the basic module.
`void` | `subscribedToPresence(org.xmpp.packet.JID subscriberJID, org.xmpp.packet.JID authorizerJID)` Notification message indicating that a user has successfully subscribed to the presence of another user.
`void` | `unavailableSession(ClientSession session, org.xmpp.packet.Presence presence)` The following functions are unimplemented required interface methods.
`void` | `unsubscribedToPresence(org.xmpp.packet.JID unsubscriberJID, org.xmpp.packet.JID recipientJID)` Notification message indicating that a user has unsubscribed to the presence of another user.
`void` | `userCreated(User user, Map<String,Object> params)` A user was created.
`void` | `userDeleting(User user, Map<String,Object> params)` A user is being deleted.
`void` | `userModified(User user, Map<String,Object> params)` A user's name, email, or an extended property was changed.

Methods inherited from class org.jivesoftware.openfire.handler.IQHandler
`process`

Methods inherited from class org.jivesoftware.openfire.container.BasicModule
`getName`

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

Constructor Detail

### IQPEPHandler

    public IQPEPHandler()

  Constructs a new `IQPEPHandler` instance.

Method Detail

### initialize

    public void initialize(XMPPServer server)

  Description copied from class: `BasicModule`

  Initializes the basic module.

  Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.

  Specified by:
    `initialize` in interface `Module`
  Overrides:
    `initialize` in class `IQHandler`
  Parameters:
    `server` - the server hosting this module.

### getServiceManager

    public PEPServiceManager getServiceManager()

### destroy

    public void destroy()

  Description copied from class: `BasicModule`

  Destroys the module.

  Does nothing in the basic module.

  Specified by:
    `destroy` in interface `Module`
  Overrides:
    `destroy` in class `BasicModule`

### start

    public void start()

  Description copied from class: `BasicModule`

  Starts the basic module.

  Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.

  Specified by:
    `start` in interface `Module`
  Overrides:
    `start` in class `BasicModule`

### stop

    public void stop()

  Description copied from class: `BasicModule`

  Stops the basic module.

  Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.

  Specified by:
    `stop` in interface `Module`
  Overrides:
    `stop` in class `BasicModule`

### getInfo

    public IQHandlerInfo getInfo()

  Description copied from class: `IQHandler`
  Returns the handler information to help generically handle IQ packets. IQHandlers that aren't local server iq handlers (e.g. chatbots, transports, etc) return `null`.

  Specified by:
    `getInfo` in class `IQHandler`
  Returns:
    The IQHandlerInfo for this handler

### getIdentities

    public Iterator<org.dom4j.Element> getIdentities()

  Implements ServerIdentitiesProvider and UserIdentitiesProvider, adding the PEP identity to the respective disco#info results.

  Specified by:
    `getIdentities` in interface `ServerIdentitiesProvider`
  Specified by:
    `getIdentities` in interface `UserIdentitiesProvider`
  Returns:
    an Iterator (of Element) with identities of protocols supported by the server.

### getFeatures

    public Iterator<String> getFeatures()

  Implements ServerFeaturesProvider to include all supported XEP-0060 features in the server's disco#info result (as per section 4 of XEP-0163).

  Specified by:
    `getFeatures` in interface `ServerFeaturesProvider`
  Returns:
    an Iterator (of String) with the supported features by the server.

### isEnabled

    public boolean isEnabled()

  Returns true if the PEP service is enabled in the server.

  Returns:
    true if the PEP service is enabled in the server.

### handleIQ

    public org.xmpp.packet.IQ handleIQ(org.xmpp.packet.IQ packet)
                                throws UnauthorizedException

  Description copied from class: `IQHandler`
  Handles the received IQ packet.

  Specified by:
    `handleIQ` in class `IQHandler`
  Parameters:
    `packet` - the IQ packet to handle.
  Returns:
    the response to send back.
  Throws:
    `UnauthorizedException` - if the user that sent the packet is not authorized to request the given operation.

### getUserItems

    public Iterator<org.dom4j.Element> getUserItems(String name,
                                                    org.xmpp.packet.JID senderJID)

  Implements UserItemsProvider, adding PEP related items to a disco#items result.

  Specified by:
    `getUserItems` in interface `UserItemsProvider`
  Parameters:
    `name` - the recipient JID's name.
    `senderJID` - the XMPPAddress of user that sent the disco items request.
  Returns:
    an Iterator (of Element) with the target entity's items or null if none.

### subscribedToPresence

    public void subscribedToPresence(org.xmpp.packet.JID subscriberJID,
                                     org.xmpp.packet.JID authorizerJID)

  Description copied from interface: `PresenceEventListener`
  Notification message indicating that a user has successfully subscribed to the presence of another user.

  Specified by:
    `subscribedToPresence` in interface `PresenceEventListener`
  Parameters:
    `subscriberJID` - the user that initiated the subscription.
    `authorizerJID` - the user that authorized the subscription.

### unsubscribedToPresence

    public void unsubscribedToPresence(org.xmpp.packet.JID unsubscriberJID,
                                       org.xmpp.packet.JID recipientJID)

  Description copied from interface: `PresenceEventListener`
  Notification message indicating that a user has unsubscribed to the presence of another user.

  Specified by:
    `unsubscribedToPresence` in interface `PresenceEventListener`
  Parameters:
    `unsubscriberJID` - the user that initiated the unsubscribe request.
    `recipientJID` - the recipient user of the unsubscribe request.

### availableSession

    public void availableSession(ClientSession session,
                                 org.xmpp.packet.Presence presence)

  Description copied from interface: `PresenceEventListener`
  Notification message indicating that a session that was not available is now available. A session becomes available when an available presence is received. Sessions that are available will have a route in the routing table thus becoming eligible for receiving messages (in particular messages sent to the user bare JID).

  Specified by:
    `availableSession` in interface `PresenceEventListener`
  Parameters:
    `session` - the session that is now available.
    `presence` - the received available presence.

### contactDeleted

    public void contactDeleted(Roster roster,
                               RosterItem item)

  Description copied from interface: `RosterEventListener`
  Notification message indicating that a contact has been deleted from a roster.

  Specified by:
    `contactDeleted` in interface `RosterEventListener`
  Parameters:
    `roster` - the roster that was updated.
    `item` - the roster item that was deleted.

### userDeleting

    public void userDeleting(User user,
                             Map<String,Object> params)

  Description copied from interface: `UserEventListener`
  A user is being deleted.

  Specified by:
    `userDeleting` in interface `UserEventListener`
  Parameters:
    `user` - the user.
    `params` - event parameters.

### unavailableSession

    public void unavailableSession(ClientSession session,
                                   org.xmpp.packet.Presence presence)

  The following functions are unimplemented required interface methods.

  Specified by:
    `unavailableSession` in interface `PresenceEventListener`
  Parameters:
    `session` - the session that is no longer available.
    `presence` - the received unavailable presence.

### presenceChanged

    public void presenceChanged(ClientSession session,
                                org.xmpp.packet.Presence presence)

  Description copied from interface: `PresenceEventListener`
  Notification message indicating that an available session has changed its presence. This is the case when the user presence changed the show value (e.g. away, dnd, etc.) or the presence status message.

  Specified by:
    `presenceChanged` in interface `PresenceEventListener`
  Parameters:
    `session` - the affected session.
    `presence` - the received available presence with the new information.

### addingContact

    public boolean addingContact(Roster roster,
                                 RosterItem item,
                                 boolean persistent)

  Description copied from interface: `RosterEventListener`
  Notification message indicating that a contact is about to be added to a roster. New contacts may be persisted to the database or not. Listeners may indicate that contact about to be persisted should not be persisted. Only one listener is needed to return `false` so that the contact is not persisted.

  Specified by:
    `addingContact` in interface `RosterEventListener`
  Parameters:
    `roster` - the roster that was updated.
    `item` - the new roster item.
    `persistent` - true if the new contact is going to be saved to the database.
  Returns:
    false if the contact should not be persisted to the database.

### contactAdded

    public void contactAdded(Roster roster,
                             RosterItem item)

  Description copied from interface: `RosterEventListener`
  Notification message indicating that a contact has been added to a roster.

  Specified by:
    `contactAdded` in interface `RosterEventListener`
  Parameters:
    `roster` - the roster that was updated.
    `item` - the new roster item.

### contactUpdated

    public void contactUpdated(Roster roster,
                               RosterItem item)

  Description copied from interface: `RosterEventListener`
  Notification message indicating that a contact has been updated.

  Specified by:
    `contactUpdated` in interface `RosterEventListener`
  Parameters:
    `roster` - the roster that was updated.
    `item` - the updated roster item.

### rosterLoaded

    public void rosterLoaded(Roster roster)

  Description copied from interface: `RosterEventListener`
  Notification message indicating that a roster has just been loaded.

  Specified by:
    `rosterLoaded` in interface `RosterEventListener`
  Parameters:
    `roster` - the loaded roster.

### userCreated

    public void userCreated(User user,
                            Map<String,Object> params)

  Description copied from interface: `UserEventListener`
  A user was created.

  Specified by:
    `userCreated` in interface `UserEventListener`
  Parameters:
    `user` - the user.
    `params` - event parameters.

### userModified

    public void userModified(User user,
                             Map<String,Object> params)

  Description copied from interface: `UserEventListener`
  A user's name, email, or an extended property was changed.

  Specified by:
    `userModified` in interface `UserEventListener`
  Parameters:
    `user` - the user.
    `params` - event parameters.

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

Copyright © 2003-2008 Jive Software.