org.springframework.social.facebook.api
Interface EventOperations


public interface EventOperations

Defines operations for creating and reading event data as well as RSVP'ing to events on behalf of a user.


Method Summary
 void acceptInvitation(String eventId)
          Accepts an invitation to an event.
 String createEvent(String name, String startTime, String endTime)
          Creates an event.
 void declineInvitation(String eventId)
          Declines an invitation to an event.
 void deleteEvent(String eventId)
          Deletes an event.
 PagedList<EventInvitee> getAttending(String eventId)
          Retrieves the list of an event's invitees who have accepted the invitation.
 PagedList<EventInvitee> getDeclined(String eventId)
          Retrieves the list of an event's invitees who have declined the invitation.
 Event getEvent(String eventId)
          Retrieves event data for a specified event.
 byte[] getEventImage(String eventId)
          Retrieves an event's image as an array of bytes.
 byte[] getEventImage(String eventId, ImageType imageType)
          Retrieves an event's image as an array of bytes.
 PagedList<Invitation> getInvitations()
          Retrieves a list of up to 25 events that the authenticated user has been invited to.
 PagedList<Invitation> getInvitations(int offset, int limit)
          Deprecated. Use getInvitations(PagingParameters) instead
 PagedList<Invitation> getInvitations(PagingParameters pagedListParameters)
          Retrieves a list of events that the authenticated user has been invited to.
 PagedList<Invitation> getInvitations(String userId)
          Retrieves a list of events that the specified user has been invited to.
 PagedList<Invitation> getInvitations(String userId, int offset, int limit)
          Deprecated. Use getInvitations(String, PagingParameters) instead
 PagedList<Invitation> getInvitations(String userId, PagingParameters pagedListParameters)
          Retrieves a list of events that the specified user has been invited to.
 PagedList<EventInvitee> getInvited(String eventId)
          Retrieves the list of an event's invitees.
 PagedList<EventInvitee> getMaybeAttending(String eventId)
          Retrieves the list of an event's invitees who have indicated that they may attend the event.
 PagedList<EventInvitee> getNoReplies(String eventId)
          Retrieves the list of an event's invitees who have not yet RSVP'd.
 void maybeInvitation(String eventId)
          RSVPs to an event with a maybe.
 PagedList<Event> search(String query)
          Search for events.
 PagedList<Event> search(String query, int offset, int limit)
          Deprecated. Use search(String, PagingParameters) instead.
 PagedList<Event> search(String query, PagingParameters pagedListParameters)
          Search for events.
 void sendInvitation(String eventId, String... userIds)
          Sends an event invitation to one or more users.
 

Method Detail

getInvitations

PagedList<Invitation> getInvitations()
Retrieves a list of up to 25 events that the authenticated user has been invited to. Requires "user_events" or "friends_events" permission.

Returns:
a list Invitations for the user, or an empty list if not available.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_events" or "friends_events" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getInvitations

@Deprecated
PagedList<Invitation> getInvitations(int offset,
                                                int limit)
Deprecated. Use getInvitations(PagingParameters) instead

Retrieves a list of events that the authenticated user has been invited to. Requires "user_events" or "friends_events" permission.

Parameters:
offset - the offset into the list of events
limit - the maximum number of events to return
Returns:
a list Invitations for the user, or an empty list if not available.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_events" or "friends_events" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getInvitations

PagedList<Invitation> getInvitations(PagingParameters pagedListParameters)
Retrieves a list of events that the authenticated user has been invited to. Requires "user_events" or "friends_events" permission.

Parameters:
pagedListParameters - the parameters defining the bounds of the list to return.
Returns:
a list Invitations for the user, or an empty list if not available.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_events" or "friends_events" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getInvitations

PagedList<Invitation> getInvitations(String userId)
Retrieves a list of events that the specified user has been invited to. Requires "user_events" or "friends_events" permission.

Parameters:
userId - the user's ID
Returns:
a list Invitations for the user, or an empty list if not available.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_events" or "friends_events" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getInvitations

@Deprecated
PagedList<Invitation> getInvitations(String userId,
                                                int offset,
                                                int limit)
Deprecated. Use getInvitations(String, PagingParameters) instead

Retrieves a list of events that the specified user has been invited to. Requires "user_events" or "friends_events" permission.

Parameters:
userId - the user's ID
offset - the offset into the list of events
limit - the maximum number of events to return
Returns:
a list Invitations for the user, or an empty list if not available.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_events" or "friends_events" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getInvitations

PagedList<Invitation> getInvitations(String userId,
                                     PagingParameters pagedListParameters)
Retrieves a list of events that the specified user has been invited to. Requires "user_events" or "friends_events" permission.

Parameters:
userId - the user's ID
pagedListParameters - the parameters defining the bounds of the list to return.
Returns:
a list Invitations for the user, or an empty list if not available.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_events" or "friends_events" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getEvent

Event getEvent(String eventId)
Retrieves event data for a specified event.

Parameters:
eventId - the event ID
Returns:
an Event object
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getEventImage

byte[] getEventImage(String eventId)
Retrieves an event's image as an array of bytes. Returns the image in Facebook's "normal" type.

Parameters:
eventId - the event ID
Returns:
an array of bytes containing the event's image.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getEventImage

byte[] getEventImage(String eventId,
                     ImageType imageType)
Retrieves an event's image as an array of bytes.

Parameters:
eventId - the event ID
imageType - the image type (eg., small, normal, large. square)
Returns:
an array of bytes containing the event's image.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

createEvent

String createEvent(String name,
                   String startTime,
                   String endTime)
Creates an event. Requires "create_event" permission. The String passed in for start time and end time is flexible in regard to format. Some valid examples are:

Parameters:
name - the name of the event
startTime - the start time of the event.
endTime - the end time of the event.
Returns:
the newly created event's ID
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "create_event" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

deleteEvent

void deleteEvent(String eventId)
Deletes an event. Requires "create_event" permission.

Parameters:
eventId - the ID of the event
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "create_event" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

sendInvitation

void sendInvitation(String eventId,
                    String... userIds)
Sends an event invitation to one or more users. Requires "create_event" permission.

Parameters:
eventId - the ID of the event
userIds - a list of one or more users to invite to the event
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "create_event" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getInvited

PagedList<EventInvitee> getInvited(String eventId)
Retrieves the list of an event's invitees.

Parameters:
eventId - the event ID.
Returns:
a list of EventInvitees for the event.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getAttending

PagedList<EventInvitee> getAttending(String eventId)
Retrieves the list of an event's invitees who have accepted the invitation.

Parameters:
eventId - the event ID.
Returns:
a list of EventInvitees for the event.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getMaybeAttending

PagedList<EventInvitee> getMaybeAttending(String eventId)
Retrieves the list of an event's invitees who have indicated that they may attend the event.

Parameters:
eventId - the event ID.
Returns:
a list of EventInvitees for the event.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getNoReplies

PagedList<EventInvitee> getNoReplies(String eventId)
Retrieves the list of an event's invitees who have not yet RSVP'd.

Parameters:
eventId - the event ID.
Returns:
a list of EventInvitees for the event.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getDeclined

PagedList<EventInvitee> getDeclined(String eventId)
Retrieves the list of an event's invitees who have declined the invitation.

Parameters:
eventId - the event ID.
Returns:
a list of EventInvitees for the event.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

acceptInvitation

void acceptInvitation(String eventId)
Accepts an invitation to an event. Requires "rsvp_event" permission.

Parameters:
eventId - the event ID
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "rsvp_event" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

maybeInvitation

void maybeInvitation(String eventId)
RSVPs to an event with a maybe. Requires "rsvp_event" permission.

Parameters:
eventId - the event ID
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "rsvp_event" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

declineInvitation

void declineInvitation(String eventId)
Declines an invitation to an event. Requires "rsvp_event" permission.

Parameters:
eventId - the event ID
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "rsvp_event" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

search

PagedList<Event> search(String query)
Search for events.

Parameters:
query - the search query (e.g., "Spring User Group")
Returns:
a list of Events matching the search query
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

search

@Deprecated
PagedList<Event> search(String query,
                                   int offset,
                                   int limit)
Deprecated. Use search(String, PagingParameters) instead.

Search for events.

Parameters:
query - the search query (e.g., "Spring User Group")
offset - the offset into the list of events
limit - the maximum number of events to return
Returns:
a list of Events matching the search query
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

search

PagedList<Event> search(String query,
                        PagingParameters pagedListParameters)
Search for events.

Parameters:
query - the search query (e.g., "Spring User Group")
pagedListParameters - the parameters defining the bounds of the list to return.
Returns:
a list of Events matching the search query
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.