com.google.appengine.api.xmpp

## Interface XMPPService

-     public interface XMPPService

  Interface for accessing XMPP status information, sending XMPP messages, and parsing XMPP responses.
  See Also:
    RFC 3921 for the XMPP specification.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<Presence>` | `getPresence(java.lang.Iterable<JID> jabberIds)` Given a JID, look up the user's status and return it.
    `java.util.List<Presence>` | `getPresence(java.lang.Iterable<JID> jabberIds, JID fromJid)` Given a JID, look up the user's status and return it.
    `Presence` | `getPresence(JID jabberId)` Given a JID, look up the user's status and return it.
    `Presence` | `getPresence(JID jabberId, JID fromJid)` Given a JID, look up the user's status and return it.
    `Message` | `parseMessage(HttpServletRequest request)` Parse the incoming message provided in `request`.
    `Presence` | `parsePresence(HttpServletRequest request)` Parse the incoming presence notification provided in `request`.
    `Subscription` | `parseSubscription(HttpServletRequest request)` Parse the incoming subscription notification provided in `request`.
    `void` | `sendInvitation(JID jabberId)` Given a JID, sends a chat invitation.
    `void` | `sendInvitation(JID jabberId, JID fromJid)` Given a JID, sends a chat invitation.
    `SendResponse` | `sendMessage(Message message)` Send provided message to specified JIDs.
    `void` | `sendPresence(JID jabberId, PresenceType type, PresenceShow show, java.lang.String status)` Given a JID, type and optional show and status value, sends a presence packet.
    `void` | `sendPresence(JID jabberId, PresenceType type, PresenceShow show, java.lang.String status, JID fromJid)` Given a JID, type and optional show and status value, sends a presence packet.

- - ### Method Detail

    - #### getPresence

          Presence getPresence(JID jabberId)

      Given a JID, look up the user's status and return it. If the JID is invalid, an IllegalArgumentException will be thrown. Because of this, the isValid method on the returned Presence object will always return true.
      Parameters:
        `jabberId` - JID of the user whose presence should be fetched.
      Throws:
        `java.lang.IllegalArgumentException` - if the id is not valid

    - #### getPresence

          Presence getPresence(JID jabberId,
                             JID fromJid)

      Given a JID, look up the user's status and return it. If the JID is invalid, an IllegalArgumentException will be thrown. Because of this, the isValid method on the returned Presence object will always return true.
      Parameters:
        `jabberId` - JID of the user whose presence should be fetched.
        `fromJid` - JID of the chat bot. Can be null.
      Throws:
        `java.lang.IllegalArgumentException` - if the id is not valid

    - #### getPresence

          java.util.List<Presence> getPresence(java.lang.Iterable<JID> jabberIds)

      Given a JID, look up the user's status and return it. Uses a custom JID as the sender. Note that rather than raising an exception, the validity of a JID is indicated via the isValid method on Presence.
      Parameters:
        `jabberIds` - A collection of JIDs for users whose presence should be fetched.

    - #### getPresence

          java.util.List<Presence> getPresence(java.lang.Iterable<JID> jabberIds,
                                             JID fromJid)

      Given a JID, look up the user's status and return it. Uses a custom JID as the sender. Note that rather than raising an exception, the validity of a JID is indicated via the isValid method on Presence.
      Parameters:
        `jabberIds` - A collection of JIDs for users whose presence should be fetched.
        `fromJid` - JID of the chat bot. Can be null.

    - #### sendPresence

          void sendPresence(JID jabberId,
                          PresenceType type,
                          PresenceShow show,
                          java.lang.String status)

      Given a JID, type and optional show and status value, sends a presence packet.
      Parameters:
        `jabberId` - JID of the user to send presence to.
        `type` - Type of presence. Can be null (available).
        `show` - Value for show element. Can be null.
        `status` - String for status element. Can be null.
      Throws:
        `java.lang.IllegalArgumentException` - If the one or more of the parameters are not valid.

    - #### sendPresence

          void sendPresence(JID jabberId,
                          PresenceType type,
                          PresenceShow show,
                          java.lang.String status,
                          JID fromJid)

      Given a JID, type and optional show and status value, sends a presence packet.
      Parameters:
        `jabberId` - JID of the user to send presence to.
        `type` - Type of presence. Can be null (available).
        `show` - Value for show element. Can be null.
        `status` - String for status element. Can be null.
        `fromJid` - JID of the chat bot. Can be null.
      Throws:
        `java.lang.IllegalArgumentException` - If the one or more of the parameters are not valid.

    - #### sendInvitation

          void sendInvitation(JID jabberId)

      Given a JID, sends a chat invitation.
      Parameters:
        `jabberId` - JID of the user to invite.
      Throws:
        `java.lang.IllegalArgumentException` - if the id is not valid

    - #### sendInvitation

          void sendInvitation(JID jabberId,
                            JID fromJid)

      Given a JID, sends a chat invitation. Uses a custom JID as the sender.
      Parameters:
        `fromJid` - JID of the chat bot. Can be null.
      Throws:
        `java.lang.IllegalArgumentException` - if the id is not valid

    - #### sendMessage

          SendResponse sendMessage(Message message)

      Send provided message to specified JIDs.
      Parameters:
        `message` - Message to send.
      Throws:
        `java.lang.IllegalArgumentException` - if the message or ids are not valid

    - #### parseMessage

          Message parseMessage(HttpServletRequest request)
                               throws java.io.IOException

      Parse the incoming message provided in `request`. This method should only be called from within an XMPP webhook.
      Throws:
        `java.io.IOException`

    - #### parsePresence

          Presence parsePresence(HttpServletRequest request)
                                 throws java.io.IOException

      Parse the incoming presence notification provided in `request`. This method should only be called from within an XMPP webhook.
      Throws:
        `java.io.IOException`

    - #### parseSubscription

          Subscription parseSubscription(HttpServletRequest request)
                                         throws java.io.IOException

      Parse the incoming subscription notification provided in `request`. This method should only be called from within an XMPP webhook.
      Throws:
        `java.io.IOException`