Package org.brickred.socialauth.exception

Examples of org.brickred.socialauth.exception.SocialAuthException


   */

  @Override
  public Response updateStatus(final String msg) throws Exception {
    LOG.warn("WARNING: Not implemented for GenericOauth2Provider");
    throw new SocialAuthException(
        "Update Status is not implemented for GenericOauth2Provider");
  }
View Full Code Here


  }

  @Override
  public List<Contact> getContactList() throws Exception {
    LOG.warn("WARNING: Not implemented for GenericOauth2Provider");
    throw new SocialAuthException(
        "Get Contacts is not implemented for GenericOauth2Provider");
  }
View Full Code Here

  }

  @Override
  public Profile getUserProfile() throws Exception {
    LOG.warn("WARNING: Not implemented for GenericOauth2Provider");
    throw new SocialAuthException(
        "Get Profile is not implemented for GenericOauth2Provider");
  }
View Full Code Here

    Response response = null;
    try {
      response = authenticationStrategy.executeFeed(url, methodType,
          params, headerParams, body);
    } catch (Exception e) {
      throw new SocialAuthException(
          "Error while making request to URL : " + url, e);
    }
    return response;
  }
View Full Code Here

  @Override
  public Response uploadImage(final String message, final String fileName,
      final InputStream inputStream) throws Exception {
    LOG.warn("WARNING: Not implemented for GenericOauth2Provider");
    throw new SocialAuthException(
        "Upload Image is not implemented for GenericOauth2Provider");
  }
View Full Code Here

    LOG.debug("Calling URL : " + url);
    try {
      return authenticationStrategy.executeFeed(url, methodType, params,
          headerParams, body);
    } catch (Exception e) {
      throw new SocialAuthException("Error : " + e.getMessage()
          + "- while making request to URL : " + url, e);
    }
  }
View Full Code Here

    LOG.info("Fetching contacts from " + CONTACTS_URL);
    Response serviceResponse;
    try {
      serviceResponse = authenticationStrategy.executeFeed(CONTACTS_URL);
    } catch (Exception e) {
      throw new SocialAuthException("Error : " + e.getMessage()
          + " - while getting contacts from " + CONTACTS_URL, e);
    }

    if (serviceResponse.getStatus() != 200) {
      throw new SocialAuthException("Error while getting contacts from "
          + CONTACTS_URL + "Status : " + serviceResponse.getStatus());
    }

    String respStr = serviceResponse
        .getResponseBodyAsString(Constants.ENCODING);
View Full Code Here

    LOG.debug("Obtaining user profile");
    Response response;
    try {
      response = authenticationStrategy.executeFeed(PROFILE_URL);
    } catch (Exception e) {
      throw new SocialAuthException(
          "Failed to retrieve the user profile from " + PROFILE_URL,
          e);
    }

    if (response.getStatus() == 200) {
      String respStr = response
          .getResponseBodyAsString(Constants.ENCODING);
      LOG.debug("Profile JSON string :: " + respStr);
      JSONObject obj = new JSONObject(respStr);
      JSONObject data = obj.getJSONObject("data");
      Profile p = new Profile();
      p.setValidatedId(data.optString("id"));
      String full_name = data.optString("full_name");
      p.setDisplayName(full_name);
      if (full_name != null) {
        String[] names = full_name.split(" ");
        if (names.length > 1) {
          p.setFirstName(names[0]);
          p.setLastName(names[1]);
        } else {
          p.setFirstName(full_name);
        }
      }
      p.setProfileImageURL(data.optString("profile_picture"));
      p.setProviderId(getProviderId());
      return p;
    } else {
      throw new SocialAuthException(
          "Failed to retrieve the user profile from " + PROFILE_URL
              + ". Server response " + response.getStatus());
    }
  }
View Full Code Here

  }

  @Override
  public Response updateStatus(final String msg) throws Exception {
    LOG.warn("WARNING: Not implemented for Instagram");
    throw new SocialAuthException(
        "Update Status is not implemented for Instagram");
  }
View Full Code Here

  @Override
  public Response uploadImage(final String message, final String fileName,
      final InputStream inputStream) throws Exception {
    LOG.warn("WARNING: Not implemented for Instagram");
    throw new SocialAuthException(
        "Upload Image is not implemented for Instagram");
  }
View Full Code Here

TOP

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

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.