Examples of JabberFactory


Examples of com.cosmicpush.app.resources.api.jabber.JabberFactory

      GoogleTalkConfig config = apiClient.getGoogleTalkConfig();
      if (config == null) {
        throw new UnsupportedOperationException("Google Talk configuration was not specified.");
      }

      JabberFactory factory = new JabberFactory(config.getUserName(), config.getPassword());

      String id = apiRequest.getApiRequestId();
      id = id.substring(id.indexOf(":")+1);
      String message = userEvent.getMessage();
      message += "\nhttps://www.cosmicpush.com/q/" + id;

      factory.sendTo("jacob.parr@gmail.com", message);

    } catch (Throwable e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of com.cosmicpush.app.resources.api.jabber.JabberFactory

    GoogleTalkConfig config = apiClient.getGoogleTalkConfig();
    if (config == null) {
      return apiRequest.failed("Google Talk configuration was not specified.");
    }

    JabberFactory factory = new JabberFactory(config.getUserName(), config.getPassword());

    if (StringUtils.isNotBlank(config.getRecipientOverride())) {
      // This is NOT a "production" request.
      factory.sendTo(config.getRecipientOverride(), action.getMessage());
      apiMessage = String.format("Request sent to recipient override, %s.", config.getRecipientOverride());
    } else {
      // This IS a "production" request.
      factory.sendTo(action.getRecipient(), action.getMessage());
    }

    return apiRequest.processed(apiMessage);
  }
View Full Code Here

Examples of com.cosmicpush.app.resources.api.jabber.JabberFactory

    GoogleTalkConfig gtConfig = apiClient.getGoogleTalkConfig();
    if (gtConfig == null) {
      return apiRequest.failed("Google Talk configuration was not specified.");

    } else {
      JabberFactory factory = new JabberFactory(gtConfig.getUserName(), gtConfig.getPassword());
      String id = apiRequest.getApiRequestId();
      id = id.substring(id.indexOf(":")+1);
      String message = push.getMessage() + " >> " + "https://www.cosmicpush.com/q/" + id;
      factory.sendTo("jacob.parr@gmail.com", message);
      return apiRequest.processed();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.