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

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


      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, e.getMessage(), e);
    }
  }
View Full Code Here


      handleError(response);
      String responseContent = getContent(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

    try {
      response = executeGet(requestURL, POLICY.BASIC_AUTH);
      handleError(response);
    } catch (SocialHttpClientException e) {
      throw new ServiceException(e.getMessage(),e);
    }
    return this.getListActivitiesFromResponse(response);
  }
View Full Code Here

    queryParams.remove(QueryParams.MAX_ID_PARAM);
    try {
      response = executeGet(requestURL, POLICY.BASIC_AUTH);
      handleError(response);
    } catch (SocialHttpClientException e) {
      throw new ServiceException(e.getMessage(),e);
    }
    return this.getListActivitiesFromResponse(response);
  }
View Full Code Here

    }
    try {
      response = executeGet(requestURL, POLICY.BASIC_AUTH);
      handleError(response);
    } catch (SocialHttpClientException e) {
      throw new ServiceException(e.getMessage(),e);
    }
    return this.getListActivitiesFromResponse(response);
  }
View Full Code Here

      List<RestActivity> activities = SocialJSONDecodingSupport.JSONArrayObjectParser(RestActivity.class, jsonArray.toJSONString());
      List<RestActivity> copyRestActivities = new ArrayList(activities);
      Collections.copy(copyRestActivities, activities);
      return copyRestActivities;
    } catch (Exception e) {
      throw new ServiceException(ActivityService.class,"invalid response",null);
    }
  }
View Full Code Here

      return (String) versionMap.get(VERSION_FIELD);
    } catch (RedirectException ex) {
      /** handle redirect */
      return getLatestAfterRedirect(ex.getUrl());
    } catch (Exception pex) {
      throw new ServiceException(VersionServiceImpl.class, "Failed to getLatest version", pex);
    }
  }
View Full Code Here

      String content = getContent(response);
      Map versionMap = SocialJSONDecodingSupport.parser(content);
      return (String) versionMap.get(VERSION_FIELD);
    } catch (RedirectException ex) {
      /** does not handle second redirect */
      throw new ServiceException(VersionServiceImpl.class, "Does not handle second redirect", ex);
    } catch (Exception pex) {
      throw new ServiceException(VersionServiceImpl.class, "Failed to getLatest version", pex);
    }
  }
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.