Class MessageEventManager

java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smackx.xevent.MessageEventManager

public final class MessageEventManager extends org.jivesoftware.smack.Manager
Manages message events requests and notifications. A MessageEventManager provides a high level access to request for notifications and send event notifications. It also provides an easy way to hook up custom logic when requests or notifications are received.
See Also:
  • Method Details

    • getInstanceFor

      public static MessageEventManager getInstanceFor(org.jivesoftware.smack.XMPPConnection connection)
    • addNotificationsRequests

      public static void addNotificationsRequests(org.jivesoftware.smack.packet.Message message, boolean offline, boolean delivered, boolean displayed, boolean composing)
      Adds event notification requests to a message. For each event type that the user wishes event notifications from the message recipient for, true should be passed in to this method.
      Parameters:
      message - the message to add the requested notifications.
      offline - specifies if the offline event is requested.
      delivered - specifies if the delivered event is requested.
      displayed - specifies if the displayed event is requested.
      composing - specifies if the composing event is requested.
    • addMessageEventRequestListener

      public void addMessageEventRequestListener(MessageEventRequestListener messageEventRequestListener)
      Adds a message event request listener. The listener will be fired anytime a request for event notification is received.
      Parameters:
      messageEventRequestListener - a message event request listener.
    • removeMessageEventRequestListener

      public void removeMessageEventRequestListener(MessageEventRequestListener messageEventRequestListener)
      Removes a message event request listener. The listener will be fired anytime a request for event notification is received.
      Parameters:
      messageEventRequestListener - a message event request listener.
    • addMessageEventNotificationListener

      public void addMessageEventNotificationListener(MessageEventNotificationListener messageEventNotificationListener)
      Adds a message event notification listener. The listener will be fired anytime a notification event is received.
      Parameters:
      messageEventNotificationListener - a message event notification listener.
    • removeMessageEventNotificationListener

      public void removeMessageEventNotificationListener(MessageEventNotificationListener messageEventNotificationListener)
      Removes a message event notification listener. The listener will be fired anytime a notification event is received.
      Parameters:
      messageEventNotificationListener - a message event notification listener.
    • sendDeliveredNotification

      public void sendDeliveredNotification(org.jxmpp.jid.Jid to, String packetID) throws org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException
      Sends the notification that the message was delivered to the sender of the original message.
      Parameters:
      to - the recipient of the notification.
      packetID - the id of the message to send.
      Throws:
      org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
      InterruptedException - if the calling thread was interrupted.
    • sendDisplayedNotification

      public void sendDisplayedNotification(org.jxmpp.jid.Jid to, String packetID) throws org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException
      Sends the notification that the message was displayed to the sender of the original message.
      Parameters:
      to - the recipient of the notification.
      packetID - the id of the message to send.
      Throws:
      org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
      InterruptedException - if the calling thread was interrupted.
    • sendComposingNotification

      public void sendComposingNotification(org.jxmpp.jid.Jid to, String packetID) throws org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException
      Sends the notification that the receiver of the message is composing a reply.
      Parameters:
      to - the recipient of the notification.
      packetID - the id of the message to send.
      Throws:
      org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
      InterruptedException - if the calling thread was interrupted.
    • sendCancelledNotification

      public void sendCancelledNotification(org.jxmpp.jid.Jid to, String packetID) throws org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException
      Sends the notification that the receiver of the message has cancelled composing a reply.
      Parameters:
      to - the recipient of the notification.
      packetID - the id of the message to send.
      Throws:
      org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
      InterruptedException - if the calling thread was interrupted.