Examples of ParsePostCommand


Examples of org.parse4j.command.ParsePostCommand

      LOGGER.error("Cannot sign up a user that has already signed up.");
      throw new IllegalArgumentException(
          "Cannot sign up a user that has already signed up.");
    }
   
    ParsePostCommand command = new ParsePostCommand(getClassName());
    JSONObject parseData = getParseData();
    parseData.put("password", password);
    command.setData(parseData);
    ParseResponse response = command.perform();
    if(!response.isFailed()) {
      JSONObject jsonResponse = response.getJsonObject();
      if (jsonResponse == null) {
        LOGGER.error("Empty response");
        throw response.getException();
View Full Code Here

Examples of org.parse4j.command.ParsePostCommand

   
  }
 
  public static void requestPasswordReset(String email) throws ParseException {

    ParsePostCommand command = new ParsePostCommand("requestPasswordReset");
    JSONObject data = new JSONObject();
    data.put("email", email);
    command.setData(data);
    ParseResponse response = command.perform();
    if (!response.isFailed()) {
      JSONObject jsonResponse = response.getJsonObject();
      if (jsonResponse == null) {
        LOGGER.error("Empty response.");
        throw response.getException();
View Full Code Here

Examples of org.parse4j.command.ParsePostCommand

  @SuppressWarnings("unchecked")
  public static <T> T callFunction(String name, Map<String, ?> params)
      throws ParseException {

    T result = null;
    ParsePostCommand command = new ParsePostCommand("functions", name);
    command.setData(new JSONObject(params));
    ParseResponse response = command.perform();
   
    if(!response.isFailed()) {
      JSONObject jsonResponse = response.getJsonObject();
      result = (T) jsonResponse.get("result");
      return result;
View Full Code Here

Examples of org.parse4j.command.ParsePostCommand

        this.event = event;
        this.dimensions = dimensions;
      }

      public void run() {
        ParsePostCommand command = new ParsePostCommand("events", event);
        JSONObject data = new JSONObject();
        data.put("at", ParseEncoder.encode(new Date(), null));
        if(dimensions != null && dimensions.size() > 0) {
          data.put("dimentions", ParseEncoder.encode(dimensions, null));
        }
        command.setData(data);
        try {
          ParseResponse response = command.perform();
          if (response.isFailed()) {
            throw response.getException();
          }
          else {
            System.out.println("done");
View Full Code Here

Examples of org.parse4j.command.ParsePostCommand

        this.event = event;
        this.dimensions = dimensions;
      }

      public void run() {
        ParsePostCommand command = new ParsePostCommand("events", event);
        JSONObject data = new JSONObject();
        data.put("at", ParseEncoder.encode(new Date(), null));
        if(dimensions != null && dimensions.size() > 0) {
          data.put("dimentions", ParseEncoder.encode(dimensions, null));
        }
        command.setData(data);
        try {
          ParseResponse response = command.perform();
          if (response.isFailed()) {
            throw response.getException();
          }
          else {
            System.out.println("done");
View Full Code Here

Examples of org.parse4j.command.ParsePostCommand

        public void setData(String key, String value) {
                this.pushData.put(key, value);
        }
 
  public void send() throws ParseException {
    ParsePostCommand command = new ParsePostCommand("push");
                JSONObject requestData = getJSONData();
    command.setData(requestData);
    ParseResponse response = command.perform();
    if(response.isFailed()) {
      throw response.getException();
   
  } 
View Full Code Here

Examples of org.parse4j.command.ParsePostCommand

    if(!isDirty) return;

    ParseCommand command;
    if(objectId == null) {
      command = new ParsePostCommand(getEndPoint());
    }
    else {
      command =  new ParsePutCommand(getEndPoint(), getObjectId());
    }
   
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.