Package org.brickred.socialauth.exception

Examples of org.brickred.socialauth.exception.ServerDataException


    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

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

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

    try {
      InputStream is = new ByteArrayInputStream(result.getBytes());
      root = XMLParseUtil.loadXmlResource(is);
    } catch (Exception e) {
      throw new ServerDataException(
          "Failed to parse the user contacts xml : " + result, e);
    }

    List<Contact> contactList = new ArrayList<Contact>();
    if (root != null) {
View Full Code Here

    try {
      root = XMLParseUtil.loadXmlResource(serviceResponse
          .getInputStream());
    } catch (Exception e) {
      throw new ServerDataException(
          "Failed to parse the contacts from response."
              + CONTACTS_FEED_URL, e);
    }
    NodeList contactsList = root.getElementsByTagName("entry");
    if (contactsList != null && contactsList.getLength() > 0) {
View Full Code Here

      root = XMLParseUtil.loadXmlResource(serviceResponse
          .getInputStream());
      list = getStatusFeed(root);

    } catch (Exception e) {
      throw new ServerDataException(
          "Failed to parse the feeds from response." + FEED_URL, e);
    }
    return list;
  }
View Full Code Here

      }
      profile.setProviderId(getProviderId());
      userProfile = profile;
      return profile;
    } catch (Exception e) {
      throw new ServerDataException(
          "Failed to parse the user profile json : " + result, e);

    }
  }
View Full Code Here

    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");
    }
    String message = msg;
    if (message.length() > 140) {
      LOG.debug("Truncating message up to 140 characters");
      message = message.substring(0, 140);
View Full Code Here

    String result;
    try {
      result = serviceResponse
          .getResponseBodyAsString(Constants.ENCODING);
    } catch (Exception e) {
      throw new ServerDataException("Failed to get response from " + url);
    }
    LOG.debug("User friends ids : " + result);
    try {
      JSONObject jobj = new JSONObject(result);
      if (jobj.has("ids")) {
        JSONArray idList = jobj.getJSONArray("ids");
        int flength = idList.length();
        int ids[] = new int[flength];
        for (int i = 0; i < idList.length(); i++) {
          ids[i] = idList.getInt(i);
        }
        if (flength > 0) {
          if (flength > 100) {
            int i = flength / 100;
            int temparr[];
            for (int j = 1; j <= i; j++) {
              temparr = new int[100];
              for (int k = (j - 1) * 100, c = 0; k < j * 100; k++, c++) {
                temparr[c] = ids[k];
              }
              plist.addAll(lookupUsers(temparr));
            }
            if (flength > i * 100) {
              temparr = new int[flength - i * 100];
              for (int k = i * 100, c = 0; k < flength; k++, c++) {
                temparr[c] = ids[k];
              }
              plist.addAll(lookupUsers(temparr));
            }
          } else {
            plist.addAll(lookupUsers(ids));
          }
        }
      }
    } catch (Exception e) {
      throw new ServerDataException(
          "Failed to parse the user friends json : " + result, e);
    }
    return plist;
  }
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.