Package org.exoplatform.social.client.api.service

Examples of org.exoplatform.social.client.api.service.ServiceException


        Header[] headers = response.getHeaders("Location");
        if (headers != null && headers.length != 0) {
          String newUrl = headers[headers.length - 1].getValue();
          throw new RedirectException(newUrl);
        }
        throw new ServiceException(response.getStatusLine().toString());
      } else {
        throw new ServiceException(response.getStatusLine().toString());
      }
    }
  }
View Full Code Here


    try {
      HttpResponse response = SocialHttpClientSupport.executeGet(targetURL, POLICY.BASIC_AUTH);
      handleError(response);
      return SocialJSONDecodingSupport.parser(RestIdentity.class, response);
    } catch (IOException ioex) {
      throw new ServiceException(IdentityServiceImplV1Alpha3.class, "IOException when reads Json Content.", ioex);
    } catch (ParseException pex) {
      throw new ServiceException(IdentityServiceImplV1Alpha3.class, "ParseException when reads Json Content.", pex);
    }
  }
View Full Code Here

    try {
      HttpResponse response = SocialHttpClientSupport.executeGet(targetURL, POLICY.BASIC_AUTH);
      handleError(response);
      return SocialJSONDecodingSupport.parser(RestIdentity.class, response);
    } catch (IOException ioex) {
      throw new ServiceException(IdentityServiceImplV1Alpha3.class, "IOException when reads Json Content.", ioex);
    } catch (ParseException pex) {
      throw new ServiceException(IdentityServiceImplV1Alpha3.class, "ParseException when reads Json Content.", pex);
    }
  }
View Full Code Here

        String responseContent = getContent(response);
        handleError(response);
        RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
        return restActivity;
      } catch (SocialHttpClientException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
      } catch (ParseException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
      }
  }
View Full Code Here

      String responseContent = getContent(response);
      handleError(response);
      RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
      return restActivity;
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
    } catch (ParseException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
    }
  }
View Full Code Here

        String responseContent = getContent(response);
        handleError(response);
        RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
        return restActivity;
      } catch (SocialHttpClientException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
      } catch (ParseException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
      }
  }
View Full Code Here

      String responseContent = getContent(response);
      handleError(response);
      RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
      return restActivity;
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
    } catch (ParseException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
    }
  }
View Full Code Here

        String responseContent = getContent(response);
        handleError(response);
        RestComment restComment = SocialJSONDecodingSupport.parser(RestComment.class, responseContent);
        return restComment;
      } catch (SocialHttpClientException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
      } catch (ParseException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
      }
  }
View Full Code Here

      String responseContent = getContent(response);
      handleError(response);
      RestComment restComment = SocialJSONDecodingSupport.parser(RestComment.class, responseContent);
      return restComment;
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
    } catch (ParseException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
    }
  }
View Full Code Here

      String responseContent = getContent(response);
      JSONObject responseJson = (JSONObject)JSONValue.parse(responseContent);
      if((Boolean) responseJson.get("liked")){
        return new RestLike(existingRestActivity.getId(), null);
      } else {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class, "invalid response", null);
      }
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class, "invalid response", null);
    }
  }
View Full Code Here

TOP

Related Classes of org.exoplatform.social.client.api.service.ServiceException

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.