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

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


    try{
      String commentsJSON = this.getFieldAsString(RestActivity.Field.COMMENTS.toString());
      List<? extends RestComment> comments = SocialJSONDecodingSupport.JSONArrayObjectParser(RestComment.class, commentsJSON);
      return (List<RestComment>) comments;
    } catch (Exception e) {
      throw new ServiceException(ActivityService.class,e.getMessage(), e);
    }
  }
View Full Code Here


    try{
      String likedByIdentitiesJSON = this.getFieldAsString(RestActivity.Field.LIKED_BY_IDENTITIES.toString());
      List<? extends RestIdentity> likedByIdentities = SocialJSONDecodingSupport.JSONArrayObjectParser(RestIdentity.class, likedByIdentitiesJSON);
      return (List<RestIdentity>) likedByIdentities;
    } catch (Exception e) {
      throw new ServiceException(ActivityService.class,e.getMessage(), e);
    }
  }
View Full Code Here

      String responseContent = SocialHttpClientSupport.getContent(response);

      List<? extends RestComment> comments = SocialJSONDecodingSupport.JSONArrayObjectParser(RestComment.class, responseContent);
      return (List<RestComment>)comments;
    } catch (IOException e) {
      throw new ServiceException(ActivityService.class,e.getMessage(), e);
    } catch (ParseException e) {
      throw new ServiceException(ActivityService.class,e.getMessage(), e);
    }
  }
View Full Code Here

      String responseContent = SocialHttpClientSupport.getContent(response);
      handleError(response);
      List<? extends RestIdentity> likedByIdentities = SocialJSONDecodingSupport.JSONArrayObjectParser(RestIdentity.class, responseContent);
      return (List<RestIdentity>) likedByIdentities;
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityService.class,e.getMessage(), e);
    } catch (IOException e) {
      throw new ServiceException(ActivityService.class,e.getMessage(), e);
    } catch (ParseException e) {
      throw new ServiceException(ActivityService.class,e.getMessage(), e);
    }
  }
View Full Code Here

        //caching for ActivityStreamJSON content in this RestActivity which avoid Request again.
        this.setField(RestActivity.Field.ACTIVITY_STREAM.toString(), activity.getFieldAsString(RestActivity.Field.ACTIVITY_STREAM.toString()));
      }
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityService.class, e.getMessage(), e);
    } catch (ParseException e) {
      throw new ServiceException(ActivityService.class, e.getMessage(), e);
    } catch (IOException e) {
      throw new ServiceException(ActivityService.class, e.getMessage(), e);
    }
    return restActivityStream;
  }
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

    }
    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

      } else if(statusCode == 403){
        throw new SocialClientLibException(response.getStatusLine().toString(), new AccessDeniedException());
      } else if(statusCode == 401){
        throw new SocialClientLibException(response.getStatusLine().toString(), new UnAuthenticatedException());
      } else {
        throw new ServiceException(response.getStatusLine().toString());
      }
    }
  }
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.