Package org.brickred.socialauth.exception

Examples of org.brickred.socialauth.exception.ServerDataException


    if (!isVerify) {
      throw new SocialAuthException(
          "Please call verifyResponse function first to get Access Token");
    }
    if (msg == null || msg.trim().length() == 0) {
      throw new ServerDataException("Status cannot be blank");
    }

    Map<String, String> headerParam = new HashMap<String, String>();
    headerParam.put("Authorization", "Bearer " + accessGrant.getKey());
    headerParam.put("Content-Type", "application/json");
View Full Code Here


    Element root;
    try {
      root = XMLParseUtil.loadXmlResource(serviceResponse
          .getInputStream());
    } catch (Exception e) {
      throw new ServerDataException(
          "Failed to parse the contacts from response."
              + CONNECTION_URL, e);
    }
    List<Contact> contactList = new ArrayList<Contact>();
    if (root != null) {
View Full Code Here

  }

  @Override
  public Response updateStatus(final String msg) throws Exception {
    if (msg == null || msg.trim().length() == 0) {
      throw new ServerDataException("Status cannot be blank");
    }
    String message = msg;
    if (msg.length() > 700) {
      LOG.warn("Message length can not be greater than 700 characters. So truncating it to 700 chars");
      message = msg.substring(0, 700);
View Full Code Here

    Element root;
    try {
      root = XMLParseUtil.loadXmlResource(serviceResponse
          .getInputStream());
    } catch (Exception e) {
      throw new ServerDataException(
          "Failed to parse the profile from response." + PROFILE_URL,
          e);
    }

    if (root != null) {
View Full Code Here

      }
      p.setProviderId(getProviderId());
      userProfile = p;
      return p;
    } catch (Exception ex) {
      throw new ServerDataException(
          "Failed to parse the user profile json : " + presp, ex);
    }
  }
View Full Code Here

    JSONArray fArr = new JSONArray();
    JSONObject resObj = new JSONObject(result);
    if (resObj.has("entry")) {
      fArr = resObj.getJSONArray("entry");
    } else {
      throw new ServerDataException(
          "Failed to parse the user Contacts json : " + result);
    }
    List<Contact> plist = new ArrayList<Contact>();
    for (int i = 0; i < fArr.length(); i++) {
      JSONObject fObj = fArr.getJSONObject(i);
View Full Code Here

   * @throws Exception
   */
  @Override
  public Response updateStatus(final String msg) throws Exception {
    if (msg == null || msg.trim().length() == 0) {
      throw new ServerDataException("Status cannot be blank");
    }
    LOG.info("Updating status " + msg + " on " + UPDATE_STATUS_URL);
    String msgBody = "{\"status\":\"" + msg + "\"}";
    Response serviceResponse = null;
    try {
View Full Code Here

    JSONObject pObj = new JSONObject();
    JSONObject jobj = new JSONObject(result);
    if (jobj.has("person")) {
      pObj = jobj.getJSONObject("person");
    } else {
      throw new ServerDataException(
          "Failed to parse the user profile json : " + result);
    }
    if (pObj.has("displayName")) {
      profile.setDisplayName(pObj.getString("displayName"));
    }
View Full Code Here

      userProfile.setProviderId(getProviderId());
      //userProfile.setFullName(data.get("name").toString());
      return userProfile;

    } catch (Exception ex) {
      throw new ServerDataException(
          "Failed to parse the user profile json : " + presp, ex);
    }
  }
View Full Code Here

      userProfile.setValidatedId(data.get("id").toString());
      userProfile.setProviderId(getProviderId());
      return userProfile;

    } catch (Exception ex) {
      throw new ServerDataException(
          "Failed to parse the user profile json : " + presp, ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.brickred.socialauth.exception.ServerDataException

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.