org.exoplatform.social.client.api.service
Interface ActivityService<Activity>

All Superinterfaces:
Service<Activity>
All Known Implementing Classes:
ActivityServiceImpl

public interface ActivityService<Activity>
extends Service<Activity>

Activity Service.

Since:
May 19, 2011
Author:
hoatle (hoatlevan at gmail dot com)

Method Summary
 RestComment createComment(Activity existingActivity, RestComment newRestComment)
          Creates a new comment to this activity.
 RestComment deleteComment(RestComment existingRestComment)
          Deletes an existing comment.
 RealtimeListAccess<Activity> getActivityStream(RestIdentity ownerStreamRestIdentity)
          Gets activity stream from an owner stream identity.
 RestComment getComment(String commentId)
          Gets an existing comment by its id.
 RealtimeListAccess<Activity> getConnectionsActivityStream(RestIdentity userRestIdentity)
          Gets all connections' activities aggregated into one stream.
 RealtimeListAccess<Activity> getFeedActivityStream(RestIdentity userRestIdentity)
          Gets all activities from a stream owner, his connections and spaces aggregated into one stream.
 RealtimeListAccess<Activity> getSpacesActivityStream(RestIdentity userRestIdentity)
          Gets all activities from spaces which a user is a member of that space aggregated into one stream.
 RestLike like(Activity existingActivity)
          The authenticate identity likes an existing activity.
 RestLike unlike(Activity existingActivity)
          The authenticated identity unlikes an existing activity.
 
Methods inherited from interface org.exoplatform.social.client.api.service.Service
create, delete, get, update
 

Method Detail

getActivityStream

RealtimeListAccess<Activity> getActivityStream(RestIdentity ownerStreamRestIdentity)
                                               throws AccessDeniedException,
                                                      ServiceException
Gets activity stream from an owner stream identity. For example:
    RestIdentity demoIdentity = identityService.get("123456789abcdef");
    RealtimeListAccess activityListAccess = activityService.getActivityStream(demoIdentity);
 
or:
   RestIdentity spaceIdentity = new RestIdentityImpl();
   spaceIdentity.setProviderId("space");
   spaceIdentity.setRemoteId("hello_world");
   RealtimeListAccess activityListAccess = activityService.getActivitySream(spaceIdentity);
 

Parameters:
ownerStreamRestIdentity - the owner stream identity, could be a user or space identity.
Returns:
the real time list access
Throws:
AccessDeniedException
ServiceException

getSpacesActivityStream

RealtimeListAccess<Activity> getSpacesActivityStream(RestIdentity userRestIdentity)
                                                     throws AccessDeniedException,
                                                            ServiceException
Gets all activities from spaces which a user is a member of that space aggregated into one stream.

Parameters:
userRestIdentity - the associated user identity
Returns:
the real time list access
Throws:
AccessDeniedException
ServiceException

getConnectionsActivityStream

RealtimeListAccess<Activity> getConnectionsActivityStream(RestIdentity userRestIdentity)
                                                          throws AccessDeniedException,
                                                                 ServiceException
Gets all connections' activities aggregated into one stream.

Parameters:
userRestIdentity - the associated user identity
Returns:
the real time list access
Throws:
AccessDeniedException
ServiceException

getFeedActivityStream

RealtimeListAccess<Activity> getFeedActivityStream(RestIdentity userRestIdentity)
                                                   throws AccessDeniedException,
                                                          ServiceException
Gets all activities from a stream owner, his connections and spaces aggregated into one stream.

Parameters:
userRestIdentity - the associated user identity
Returns:
the realtime list access
Throws:
AccessDeniedException
ServiceException

createComment

RestComment createComment(Activity existingActivity,
                          RestComment newRestComment)
                          throws AccessDeniedException,
                                 ServiceException
Creates a new comment to this activity.

Parameters:
existingActivity - the existing activity
newRestComment - the new created comment
Returns:
the created comment
Throws:
AccessDeniedException
ServiceException

getComment

RestComment getComment(String commentId)
                       throws AccessDeniedException,
                              ServiceException
Gets an existing comment by its id.

Parameters:
commentId - the comment id
Returns:
the existing comment with the specified id
Throws:
AccessDeniedException
ServiceException

deleteComment

RestComment deleteComment(RestComment existingRestComment)
                          throws AccessDeniedException,
                                 ServiceException
Deletes an existing comment.

Parameters:
existingRestComment - the existing comment
Returns:
the deleted comment
Throws:
AccessDeniedException
ServiceException

like

RestLike like(Activity existingActivity)
              throws AccessDeniedException,
                     ServiceException
The authenticate identity likes an existing activity.

Parameters:
existingActivity - the existing activity
Returns:
the created RestLike instance
Throws:
AccessDeniedException
ServiceException

unlike

RestLike unlike(Activity existingActivity)
                throws AccessDeniedException,
                       ServiceException
The authenticated identity unlikes an existing activity.

Parameters:
existingActivity - the existing activity
Returns:
the deleted RestLike instance.
Throws:
AccessDeniedException
ServiceException


Copyright © 2011 eXo Platform. All Rights Reserved.