facebook4j.api.EventMethods Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of facebook4j-core Show documentation
Show all versions of facebook4j-core Show documentation
A Java library for the Facebook Graph API
/*
* Copyright 2012 Ryuji Yamashita
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package facebook4j.api;
import java.net.URL;
import facebook4j.Event;
import facebook4j.EventUpdate;
import facebook4j.FacebookException;
import facebook4j.Media;
import facebook4j.Photo;
import facebook4j.PictureSize;
import facebook4j.Post;
import facebook4j.PostUpdate;
import facebook4j.RSVPStatus;
import facebook4j.Reading;
import facebook4j.ResponseList;
import facebook4j.Video;
/**
* @author Ryuji Yamashita - roundrop at gmail.com
*/
public interface EventMethods {
/**
* Returns the events the current user is attending.
* @return events
* @throws FacebookException when Facebook service or network is unavailable
* @see User - Facebook Developers - Connections - events
*/
ResponseList getEvents() throws FacebookException;
/**
* Returns the events the current user is attending.
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return events
* @throws FacebookException when Facebook service or network is unavailable
* @see User - Facebook Developers - Connections - events
*/
ResponseList getEvents(Reading reading) throws FacebookException;
/**
* Returns the events a user is attending.
* @param userId the ID of a user
* @return events
* @throws FacebookException when Facebook service or network is unavailable
* @see User - Facebook Developers - Connections - events
*/
ResponseList getEvents(String userId) throws FacebookException;
/**
* Returns the events a user is attending.
* @param userId the ID of a user
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return events
* @throws FacebookException when Facebook service or network is unavailable
* @see User - Facebook Developers - Connections - events
*/
ResponseList getEvents(String userId, Reading reading) throws FacebookException;
/**
* Creates the event for the current user.
* @param eventUpdate a event to be created
* @return The new event ID
* @throws FacebookException when Facebook service or network is unavailable
* @see User#events - Facebook Developers
*/
String createEvent(EventUpdate eventUpdate) throws FacebookException;
/**
* Creates the event for a user.
* @param userId the ID of a user
* @param eventUpdate a event to be created
* @return The new event ID
* @throws FacebookException when Facebook service or network is unavailable
* @see User#events - Facebook Developers
*/
String createEvent(String userId, EventUpdate eventUpdate) throws FacebookException;
/**
* Updates the event.
* @param eventId the ID of a event
* @param eventUpdate the event to be updated
* @return true if update is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see User#events - Facebook Developers
*/
boolean editEvent(String eventId, EventUpdate eventUpdate) throws FacebookException;
/**
* Deletes the event.
* @param eventId the ID of a event
* @return true if delete is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see User#events - Facebook Developers
*/
boolean deleteEvent(String eventId) throws FacebookException;
/**
* Returns a single event.
* @param eventId the ID of a event
* @return event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event - Facebook Developers
*/
Event getEvent(String eventId) throws FacebookException;
/**
* Returns a single event.
* @param eventId the ID of a event
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event - Facebook Developers
*/
Event getEvent(String eventId, Reading reading) throws FacebookException;
/**
* Returns the event's wall.
* @param eventId the ID of a event
* @return event's feed
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#feed - Facebook Developers
*/
ResponseList getEventFeed(String eventId) throws FacebookException;
/**
* Returns the event's wall.
* @param eventId the ID of a event
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @return event's feed
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#feed - Facebook Developers
*/
ResponseList getEventFeed(String eventId, Reading reading) throws FacebookException;
/**
* Creates the post on a event's wall.
* @param eventId the ID of a event
* @param postUpdate the post to be created
* @return The new post ID
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#posts - Facebook Developers
*/
String postEventFeed(String eventId, PostUpdate postUpdate) throws FacebookException;
/**
* Posts the link on a event's wall.
* @param eventId the ID of a event
* @param link link URL
* @return The new link ID
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#links - Facebook Developers
*/
String postEventLink(String eventId, URL link) throws FacebookException;
/**
* Posts the link on a event's wall.
* @param eventId the ID of a event
* @param link link URL
* @param message link message
* @return The new link ID
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#links - Facebook Developers
*/
String postEventLink(String eventId, URL link, String message) throws FacebookException;
/**
* Posts the status message on a event's wall.
* @param eventId the ID of a event
* @param message status message content
* @return The new status message ID
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#statuses - Facebook Developers
*/
String postEventStatusMessage(String eventId, String message) throws FacebookException;
/**
* Returns a list of all users who have not replied to the event.
* @param eventId the ID of a event
* @return a list of all users who have not replied to the event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#noreply - Facebook Developers
*/
ResponseList getRSVPStatusAsNoreply(String eventId) throws FacebookException;
/**
* Returns a single user who have not replied to the event.
* @param eventId the ID of a event
* @return a single users who have not replied to the event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#noreply - Facebook Developers
*/
ResponseList getRSVPStatusAsNoreply(String eventId, String userId) throws FacebookException;
/**
* Returns a list of invitees for the event.
* @param eventId the ID of a event
* @return a list of invitees for the event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#invited - Facebook Developers
*/
ResponseList getRSVPStatusAsInvited(String eventId) throws FacebookException;
/**
* Checks a specific user has been invited to the event.
* @param eventId the ID of a event
* @param userId the ID of a user
* @return the user has been invited to this event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#invited - Facebook Developers
*/
ResponseList getRSVPStatusAsInvited(String eventId, String userId) throws FacebookException;
/**
* Invites a user to the event.
* @param eventId the ID of a event
* @param userId the ID of the user
* @return the user has been invited to this event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#invited - Facebook Developers
*/
boolean inviteToEvent(String eventId, String userId) throws FacebookException;
/**
* Invites users to the event.
* @param eventId the ID of a event
* @param userIds the IDs of users
* @return true if the invite is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#invited - Facebook Developers
*/
boolean inviteToEvent(String eventId, String[] userIds) throws FacebookException;
/**
* Un-invites user from the event.
* @param eventId the ID of a event
* @param userId the ID of a user
* @return true if the un-invite is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#invited - Facebook Developers
*/
boolean uninviteFromEvent(String eventId, String userId) throws FacebookException;
/**
* Returns a list of all users who responded 'yes' to the event.
* @param eventId the ID of a event
* @return a list of all users who responded 'yes' to the event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#attending - Facebook Developers
*/
ResponseList getRSVPStatusInAttending(String eventId) throws FacebookException;
/**
* Checks a specific user responded 'yes' to the event.
* @param eventId the ID of a event
* @param userId the ID of a user
* @return a specific user responded 'yes' to the event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#attending - Facebook Developers
*/
ResponseList getRSVPStatusInAttending(String eventId, String userId) throws FacebookException;
/**
* RSVPs the current user as 'attending' the event.
* @param eventId the ID of a event
* @return true if the RSVP is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#attending - Facebook Developers
*/
boolean rsvpEventAsAttending(String eventId) throws FacebookException;
/**
* Returns a list of all users who responded 'maybe' to the event.
* @param eventId the ID of a event
* @return a list of all users who responded 'maybe' to the event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#maybe - Facebook Developers
*/
ResponseList getRSVPStatusInMaybe(String eventId) throws FacebookException;
/**
* Checks a specific user responded 'maybe' to the event.
* @param eventId the ID of a event
* @param userId the ID of a user
* @return a specific user responded 'maybe' to the event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#maybe - Facebook Developers
*/
ResponseList getRSVPStatusInMaybe(String eventId, String userId) throws FacebookException;
/**
* RSVPs the current user as 'maybe' the event.
* @param eventId the ID of a event
* @return true if the RSVP is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#maybe - Facebook Developers
*/
boolean rsvpEventAsMaybe(String eventId) throws FacebookException;
/**
* Returns a list of all users who responded 'no' to the event.
* @param eventId the ID of a event
* @return a list of all users who responded 'no' to the event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#declined - Facebook Developers
*/
ResponseList getRSVPStatusInDeclined(String eventId) throws FacebookException;
/**
* Checks a specific user responded 'no' to the event.
* @param eventId the ID of a event
* @param userId the ID of a user
* @return a specific user responded 'no' to the event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#declined - Facebook Developers
*/
ResponseList getRSVPStatusInDeclined(String eventId, String userId) throws FacebookException;
/**
* RSVPs the current user as 'declined' the event.
* @param eventId the ID of a event
* @return true if the RSVP is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#declined - Facebook Developers
*/
boolean rsvpEventAsDeclined(String eventId) throws FacebookException;
/**
* Returns url of the event's profile picture.
* @param eventId the ID of a event
* @return url
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#picture - Facebook Developers
*/
URL getEventPictureURL(String eventId) throws FacebookException;
/**
* Returns url of the event's profile picture.
* @param eventId the ID of a event
* @param size picture size
* @return url
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#picture - Facebook Developers
*/
URL getEventPictureURL(String eventId, PictureSize size) throws FacebookException;
/**
* Updates the event's profile picture.
* @param eventId the ID of a event
* @param source picture resource
* @return true if update is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#picture - Facebook Developers
*/
boolean updateEventPicture(String eventId, Media source) throws FacebookException;
/**
* Deletes the event's profile picture.
* @param eventId the ID of a event
* @return true if update is successful
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#picture - Facebook Developers
*/
boolean deleteEventPicture(String eventId) throws FacebookException;
/**
* Returns the event's photos.
* @param eventId the ID of a event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#photos - Facebook Developers
*/
ResponseList getEventPhotos(String eventId) throws FacebookException;
/**
* Returns the event's photos.
* @param eventId the ID of a event
* @param reading optional reading parameters. see Graph API#reading - Facebook Developers
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#photos - Facebook Developers
*/
ResponseList getEventPhotos(String eventId, Reading reading) throws FacebookException;
/**
* Posts the photo on a event's wall.
* @param eventId the ID of a event
* @param source photo resource
* @return The new photo ID
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#photos - Facebook Developers
*/
String postEventPhoto(String eventId, Media source) throws FacebookException;
/**
* Posts the photo on a event's wall.
* @param eventId the ID of a event
* @param source photo resource
* @param message photo description
* @return The new photo ID
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#photos - Facebook Developers
*/
String postEventPhoto(String eventId, Media source, String message) throws FacebookException;
/**
* Returns the event's videos.
* @param eventId the ID of a event
* @throws FacebookException when Facebook service or network is unavailable
* @see Event#videos - Facebook Developers
*/
ResponseList