Package org.brickred.socialauth.exception

Examples of org.brickred.socialauth.exception.ServerDataException


    String result;
    try {
      result = serviceResponse
          .getResponseBodyAsString(Constants.ENCODING);
    } catch (Exception e) {
      throw new ServerDataException("Failed to get response from " + url,
          e);
    }
    LOG.debug("Users info : " + result);
    try {
      JSONArray jarr = new JSONArray(result);
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

  @Override
  public Response updateStatus(final String msg) throws Exception {
    LOG.info("Updating status : " + msg);
    if (msg == null || msg.trim().length() == 0) {
      throw new ServerDataException("Status cannot be blank");
    }
    StringBuilder strb = new StringBuilder();
    strb.append("message=").append(
        URLEncoder.encode(msg, Constants.ENCODING));
    strb.append("&access_token").append("=").append(accessGrant.getKey());
View Full Code Here

        p.setProfileImageURL(String.format(PROFILE_IMAGE_URL,
            obj.getString("id")));
        plist.add(p);
      }
    } catch (Exception e) {
      throw new ServerDataException(
          "Failed to parse the user profile json : " + respStr, e);
    }
    return plist;
  }
View Full Code Here

    Element root;
    try {
      root = XMLParseUtil.loadXmlResource(serviceResponse
          .getInputStream());
    } catch (Exception e) {
      throw new ServerDataException(
          "Failed to parse the career details from response."
              + PROFILE_URL, e);
    }
    Career career = null;
    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

            plist.add(p);
          }
        }
      }
    } catch (Exception e) {
      throw new ServerDataException(
          "Failed to parse the contacts json : " + respStr, e);
    }
    return plist;
  }
View Full Code Here

        p.setId(obj.getString("id"));
        p.setProfileUrl(obj.getString("web_url"));
        plist.add(p);
      }
    } catch (Exception e) {
      throw new ServerDataException(
          "Failed to parse the user profile json : " + respStr, e);
    }
    return plist;

  }
View Full Code Here

    if (!isVerify || accessToken == null) {
      throw new SocialAuthException(
          "Please call verifyResponse function first to get Access Token and then update status");
    }
    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 " + accessToken);
    headerParam.put("Content-Type", "application/json");
    headerParam.put("Accept", "application/json");
View Full Code Here

    String result;
    try {
      result = serviceResponse
          .getResponseBodyAsString(Constants.ENCODING);
    } catch (Exception e) {
      throw new ServerDataException("Failed to get response from " + url,
          e);
    }
    LOG.debug("User Contacts list in JSON " + result);
    JSONObject resp = new JSONObject(result);
    List<Contact> plist = new ArrayList<Contact>();
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.