Package com.google.appengine.api.xmpp.XMPPServicePb

Examples of com.google.appengine.api.xmpp.XMPPServicePb.XmppSendPresenceRequest


    checkArgument(jabberId != null, "Jabber ID cannot be null");
    checkArgument(status == null || status.length() <= MAX_STATUS_MESSAGE_SIZE,
                  "Status message is too long");

    XmppSendPresenceRequest request = new XmppSendPresenceRequest();
    request.setJid(jabberId.getId());

    if (type != null) {
      switch (type) {
        case AVAILABLE:
          break;

        default:
          request.setType(type.toString().toLowerCase());
          break;
      }
    }

    if (show != null) {
      switch (show) {
        case NONE:
          break;

        default:
          request.setShow(show.toString().toLowerCase());
          break;
      }
    }

    if (status != null) {
      request.setStatus(status);
    }

    if (fromJid != null) {
      request.setFromJid(fromJid.getId());
    }

    byte[] responseBytes;
    try {
      responseBytes = ApiProxy.makeSyncCall(PACKAGE, "SendPresence", request.toByteArray());
    } catch (ApiProxy.ApplicationException ex) {
      switch (XmppServiceError.ErrorCode.valueOf(ex.getApplicationError())) {
        case INVALID_JID:
          throw new IllegalArgumentException("Invalid jabber ID: " + jabberId);
        case INVALID_SHOW:
View Full Code Here

TOP

Related Classes of com.google.appengine.api.xmpp.XMPPServicePb.XmppSendPresenceRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.