Package fb4java.http

Examples of fb4java.http.HttpResponseMessage


  }
  nIds.deleteCharAt(nIds.length() - 1);// delete last comma

  listOfMethods.put("notification_ids", nIds.toString());

  HttpResponseMessage response = f4j.sendGetRequest(listOfMethods);

  return response.getStatusCode() < 300;
    }
View Full Code Here


  listOfMethods.put("urls", "" + strUrls);

  listOfMethods.put(METHOD, LINKS_GET_STATS);

  HttpResponseMessage response = f4j.sendGetRequest(listOfMethods);

  JSONArray root = new JSONArray(response.getResponse());
  int numOfLinks = root.length();
  for (int a = 0; a < numOfLinks; a++) {
      JSONObject aLink = root.getJSONObject(a);
      rslt.add(new Link(aLink));
  }
View Full Code Here

  listOfMethods.put(METHOD, ADMIN_SET_APP_PROPERTIES);

  listOfMethods.put("notification_ids", properties.toString());

  HttpResponseMessage response = f4j.sendGetRequest(listOfMethods);

  return response.getStatusCode() < 300;
    }
View Full Code Here

  Map<String, String> listOfMethods = getBasicParams();
  listOfMethods.put(METHOD, ADMIN_GET_ALLOCATION);
  listOfMethods.put("integration_point_name", ipn.toString());

  HttpResponseMessage response = f4j.sendGetRequest(listOfMethods);

  String respStr = response.getResponse();

  if (respStr == null || respStr.trim().equals("")) {
      throw new FB4JavaException();
  }

  int rslt = 0;

  try {
      rslt = Integer.parseInt(respStr);
  } catch (Exception e) {
      JSONObject errorMsg = response.toJSONObject();
      throw new FB4JavaException(errorMsg.getInt("error_code"), errorMsg.getString("error_msg"));
  }

  return rslt;
    }
View Full Code Here

    public ArrayList<Long> getFriendsId() throws ClientProtocolException, URISyntaxException, IOException,
      JSONException {
  ArrayList<Long> friendList = new ArrayList<Long>();
  Map<String, String> listOfMethods = getBasicParams();
  listOfMethods.put(METHOD, FRIEND_GET);
  HttpResponseMessage response = f4j.sendGetRequest(listOfMethods);

  JSONArray jArray = new JSONArray(response.getResponse());
  int jArraySize = jArray.length();

  for (int a = 0; a < jArraySize; a++) {
      friendList.add(jArray.getLong(a));
  }
View Full Code Here

      listOfMethods.put("offset", "" + offset);
  }

  listOfMethods.put(METHOD, MESSAGE_GETTHREADSINFOLDER);

  HttpResponseMessage response = f4j.sendGetRequest(listOfMethods);

  JSONObject root = new JSONObject(response.getResponse());
  // TODO response parsing
    }
View Full Code Here

      listOfMethods.put("uid", "" + userId);
  }

  listOfMethods.put(METHOD, NOTES_GET);

  HttpResponseMessage response = f4j.sendGetRequest(listOfMethods);

  JSONArray root = new JSONArray(response.getResponse());
  int numOfNotes = root.length();
  for (int a = 0; a < numOfNotes; a++) {
      JSONObject aNote = root.getJSONObject(a);
      rslt.add(new Note(aNote));
  }
View Full Code Here

  listOfMethods.put("include_read", "" + include_read);

  listOfMethods.put(METHOD, NOTIFICATIONS_GETLIST);

  HttpResponseMessage response = f4j.sendGetRequest(listOfMethods);

  JSONObject root = new JSONObject(response.getResponse());
  JSONArray notificationArr = root.getJSONArray("notifications");
  for (int a = 0; a < notificationArr.length(); a++) {
      JSONObject aNotification = notificationArr.getJSONObject(a);
      rslt.add(new Notification(aNotification));
  }
View Full Code Here

      JSONException {
  Map<String, String> listOfMethods = getBasicParams();

  listOfMethods.put(METHOD, NOTIFICATIONS_GET);

  HttpResponseMessage response = f4j.sendGetRequest(listOfMethods);

  JSONObject root = new JSONObject(response.getResponse());
  return new NotificationStatus(root);
    }
View Full Code Here

      listOfMethods.put("limit", "" + limit);
  }

  listOfMethods.put(METHOD, STATUS_GET);

  HttpResponseMessage response = f4j.sendGetRequest(listOfMethods);

  JSONArray jArray = new JSONArray(response.getResponse());
  int arraySize = jArray.length();

  for (int a = 0; a < arraySize; a++) {
      JSONObject jObj;
      try {
View Full Code Here

TOP

Related Classes of fb4java.http.HttpResponseMessage

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.