public class

FacebookConnector

extends Object
java.lang.Object
   ↳ org.mule.module.facebook.FacebookConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Facebook is a social networking service and website launched in February 2004.

Summary

Fields
private static String ACCESS_TOKEN_QUERY_PARAM_NAME
private static String FACEBOOK_URI
private String accessToken
private String appId The application identifier as registered with Facebook
private String appSecret The application secret
private Client client Jersey client
private static final Logger logger
private static JsonMapper mapper
private String scope Facebook permissions
private String userId
Public Constructors
FacebookConnector()
Constructor
Public Methods
void attendEvent(String eventId)
Attend the given event.
void declineEvent(String eventId)
Decline the given event.
void deleteObject(String objectId)
Delete an object in the graph.
void dislike(String postId)
Remove a 'like' from a post.
byte[] downloadImage(String imageUri)
This is a convinience processor that simply fetchs an uri which is expected to return an image and returns it as a Byte array.
String getAccessToken()
Album getAlbum(String album, String metadata)
A photo album

List<Comment> getAlbumComments(String album, String since, String until, String limit, String offset)
The comments made on this album

List<Photo> getAlbumPhotos(String album, String since, String until, String limit, String offset)
The photos contained in this album

String getAppId()
String getAppSecret()
Application getApplication(String application)
An application's profile
List<Album> getApplicationAlbums(String application, String since, String until, String limit, String offset)
The photo albums this application has created.
List<Event> getApplicationEvents(String application, String since, String until, String limit, String offset)
The events this page is managing
List<Insight> getApplicationInsights(String application, String since, String until, String limit, String offset)
Usage metrics for this application
List<Post> getApplicationLinks(String application, String since, String until, String limit, String offset)
The application's posted links.
List<Note> getApplicationNotes(String application, String since, String until, String limit, String offset)
The application's notes.
List<Photo> getApplicationPhotos(String application, String since, String until, String limit, String offset)
The photos this application is tagged in.
byte[] getApplicationPicture(String application, String type)
The application's logo
List<StatusMessage> getApplicationStatuses(String application, String since, String until, String limit, String offset)
The application's status updates.
List<GetApplicationTaggedResponseType> getApplicationTagged(String application, String since, String until, String limit, String offset)
The photos, videos, and posts in which this application has been tagged.
List<Video> getApplicationVideos(String application, String since, String until, String limit, String offset)
The videos this application has created
List<Post> getApplicationWall(String application, String since, String until, String limit, String offset)
The application's wall.
Checkin getCheckin(String checkin, String metadata)
A check-in that was made through Facebook Places.
Client getClient()
Event getEvent(String eventId, String metadata)
Specifies information about an event, including the location, event name, and which invitees plan to attend.
List<User> getEventAttending(String eventId, String since, String until, String limit, String offset)
All of the users who are attending this event

List<Event> getEventDeclined(String eventId, String since, String until, String limit, String offset)
All of the users who declined their invitation to this event

List<User> getEventInvited(String eventId, String since, String until, String limit, String offset)
All of the users who have been invited to this event

List<User> getEventMaybe(String eventId, String since, String until, String limit, String offset)
All of the users who have been responded "Maybe" to their invitation to this event

List<User> getEventNoReply(String eventId, String since, String until, String limit, String offset)
All of the users who have been not yet responded to their invitation to this event

byte[] getEventPicture(String eventId, String type)
The event's profile picture

List<Post> getEventWall(String eventId, String since, String until, String limit, String offset)
This event's wall

Group getGroup(String group, String metadata)
A Facebook group

List<Member> getGroupMembers(String group, String since, String until, String limit, String offset)
All of the users who are members of this group

byte[] getGroupPicture(String group, String type)
The profile picture of this group

List<Post> getGroupWall(String group, String since, String until, String limit, String offset)
This group's wall

Link getLink(String link, String metadata)
A link shared on a user's wall
List<Comment> getLinkComments(String link, String since, String until, String limit, String offset)
All of the comments on this link
Note getNote(String note, String metadata)
A Facebook note
List<Comment> getNoteComments(String note, String since, String until, String limit, String offset)
All of the comments on this note
Post.Likes getNoteLikes(String note, String since, String until, String limit, String offset)
People who like the note
Page getPage(String page, String metadata)
Retrieves the page with the given ID
List<Album> getPageAlbums(String page, String since, String until, String limit, String offset)
The photo albums this page has created
List<Checkin> getPageCheckins(String page, String since, String until, String limit, String offset)
Checkins made by the friends of the current session user
List<Event> getPageEvents(String page, String since, String until, String limit, String offset)
The events this page is attending
List<Group> getPageGroups(String page, String since, String until, String limit, String offset)
The groups this page is a member of
List<Link> getPageLinks(String page, String since, String until, String limit, String offset)
The page's posted links
List<Note> getPageNotes(String page, String since, String until, String limit, String offset)
The page's notes
List<Photo> getPagePhotos(String page, String since, String until, String limit, String offset)
The photos this page has uploaded
byte[] getPagePicture(String page, String type)
The page's profile picture
List<Post> getPagePosts(String page, String since, String until, String limit, String offset)
The page's own posts
List<StatusMessage> getPageStatuses(String page, String since, String until, String limit, String offset)
The page's status updates
List<Post> getPageTagged(String page, String since, String until, String limit, String offset)
The photos, videos, and posts in which this page has been tagged
List<Video> getPageVideos(String page, String since, String until, String limit, String offset)
The videos this page has created
List<Post> getPageWall(String page, String since, String until, String limit, String offset)
The page's wall
Photo getPhoto(String photo, String metadata)
An individual photo
List<Comment> getPhotoComments(String photo, String since, String until, String limit, String offset)
All of the comments on this photo
Post.Likes getPhotoLikes(String photo, String since, String until, String limit, String offset)
People who like the photo
Post getPost(String post, String metadata)
An individual entry in a profile's feed
List<Comment> getPostComments(String post, String since, String until, String limit, String offset)
All of the comments on this post
String getScope()
StatusMessage getStatus(String status, String metadata)
A status message on a user's wall
List<Comment> getStatusComments(String status, String since, String until, String limit, String offset)
All of the comments on this message
User getUser(String user, String metadata)
A user profile.
List<GetUserAccountResponseType> getUserAccounts(String user, String since, String until, String limit, String offset)
The Facebook pages owned by the current user
List<PageConnection> getUserActivities(String user, String since, String until, String limit, String offset)
The activities listed on the user's profile
List<Album> getUserAlbums(String user, String since, String until, String limit, String offset)
The photo albums this user has created.
List<PageConnection> getUserBooks(String user, String since, String until, String limit, String offset)
The books listed on the user's profile
List<Checkin> getUserCheckins(String user, String since, String until, String limit, String offset)
The music listed on the user's profile
List<Event> getUserEvents(String user, String since, String until, String limit, String offset)
The events this user is attending.
List<NamedFacebookType> getUserFriends(String user, String since, String until, String limit, String offset)
The user's friends
List<Group> getUserGroups(String user, String since, String until, String limit, String offset)
The groups this user is a member of.
List<Post> getUserHome(String user, String since, String until, String limit, String offset)
The user's News Feed.
String getUserId()
List<Thread> getUserInbox(String user, String since, String until, String limit, String offset)
The threads in this user's inbox.
List<PageConnection> getUserInterests(String user, String since, String until, String limit, String offset)
The interests listed on the user's profile
List<PageConnection> getUserLikes(String user, String since, String until, String limit, String offset)
All the pages this user has liked.
List<Link> getUserLinks(String user, String since, String until, String limit, String offset)
The user's posted links.
List<PageConnection> getUserMovies(String user, String since, String until, String limit, String offset)
The movies listed on the user's profile
List<PageConnection> getUserMusic(String user, String since, String until, String limit, String offset)
The music listed on the user's profile
List<Note> getUserNotes(String user, String since, String until, String limit, String offset)
The user's notes.
List<OutboxThread> getUserOutbox(String user, String since, String until, String limit, String offset)
The messages in this user's outbox.
List<Photo> getUserPhotos(String user, String since, String until, String limit, String offset)
The photos this user is tagged in.
byte[] getUserPicture(String user, String type)
The user's profile picture
List<Post> getUserPosts(String user, String since, String until, String limit, String offset)
The user's own posts.
List<Post> getUserSearch(String user, String q, String metadata, String since, String until, String limit, String offset)
Search an individual user's News Feed, restricted to that user's friends
List<StatusMessage> getUserStatuses(String user, String since, String until, String limit, String offset)
The user's status updates.
List<Post> getUserTagged(String user, String since, String until, String limit, String offset)
The photos, videos, and posts in which this user has been tagged.
List<PageConnection> getUserTelevision(String user, String since, String until, String limit, String offset)
The television listed on the user's profile
List<OutboxThread> getUserUpdates(String user, String since, String until, String limit, String offset)
The updates in this user's inbox.
List<Video> getUserVideos(String user, String since, String until, String limit, String offset)
The videos this user has been tagged in.
List<Post> getUserWall(String user, String since, String until, String limit, String offset)
The user's wall.
Video getVideo(String video, String metadata)
An individual video
List<Comment> getVideoComments(String video, String since, String until, String limit, String offset)
All of the comments on this video
void like(String postId)
Write to the given profile's feed/wall.
User loggedUserDetails()
Gets the user logged details.
void publishAlbum(String profile_id, String msg, String albumName)
Create an album.
String publishComment(String postId, String msg)
Comment on the given post
void publishEvent(String profile_id)
Post an event in the given profile.
void publishLink(String profile_id, String msg, String link)
Write a note on the given profile.
String publishMessage(String profile_id, String msg, String picture, String link, String caption, String linkName, String description)
Write to the given profile's feed/wall.
void publishNote(String profile_id, String msg, String subject)
Write a note on the given profile.
void publishPhoto(String albumId, String caption, File photo)
Upload a photo to an album.
List<Checkin> searchCheckins(String since, String until, String limit, String offset)
This request returns you or your friend's latest checkins, or checkins where you or your friends have been tagged; currently, it does not accept a query parameter.
List<Event> searchEvents(String q, String since, String until, String limit, String offset)
Search over all events in the social graph

List<Group> searchGroups(String q, String since, String until, String limit, String offset)
Search over all groups in the social graph

List<Page> searchPages(String q, String since, String until, String limit, String offset)
Search over all pages in the social graph

List<Post> searchPosts(String q, String since, String until, String limit, String offset)
Search over all public posts in the social graph

List<User> searchUsers(String q, String since, String until, String limit, String offset)
Search over all users in the social graph

void setAccessToken(String accessToken)
void setAppId(String appId)
void setAppSecret(String appSecret)
void setClient(Client client)
void setScope(String scope)
void tentativeEvent(String eventId)
Maybe attend the given event.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private static String ACCESS_TOKEN_QUERY_PARAM_NAME

private static String FACEBOOK_URI

private String accessToken

private String appId

The application identifier as registered with Facebook

private String appSecret

The application secret

private Client client

Jersey client

private static final Logger logger

private static JsonMapper mapper

private String scope

Facebook permissions

private String userId

Public Constructors

public FacebookConnector ()

Constructor

Public Methods

public void attendEvent (String eventId)

Attend the given event.

Parameters
eventId The id of the event to attend

public void declineEvent (String eventId)

Decline the given event.

Parameters
eventId Represents the id of the event object

public void deleteObject (String objectId)

Delete an object in the graph.

Parameters
objectId The ID of the object to be deleted

public void dislike (String postId)

Remove a 'like' from a post.

Parameters
postId The ID of the post to be disliked

public byte[] downloadImage (String imageUri)

This is a convinience processor that simply fetchs an uri which is expected to return an image and returns it as a Byte array. Notice that I'm using the word image instead of photo or picture which are words with a particular meaning in facebook. By image, I refer to a generic bitmap.

Parameters
imageUri The uri of an image resource
Returns
  • a byte array with the image

public String getAccessToken ()

public Album getAlbum (String album, String metadata)

A photo album

Parameters
album Represents the ID of the album object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • The album

public List<Comment> getAlbumComments (String album, String since, String until, String limit, String offset)

The comments made on this album

Parameters
album Represents the ID of the album object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • response from Facebook

public List<Photo> getAlbumPhotos (String album, String since, String until, String limit, String offset)

The photos contained in this album

Parameters
album Represents the ID of the album object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • response from Facebook

public String getAppId ()

public String getAppSecret ()

public Application getApplication (String application)

An application's profile

Parameters
application Represents the ID of the application object.
Returns
  • The application represented by the given id

public List<Album> getApplicationAlbums (String application, String since, String until, String limit, String offset)

The photo albums this application has created.

Parameters
application Represents the ID of the application object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the given application's albums

public List<Event> getApplicationEvents (String application, String since, String until, String limit, String offset)

The events this page is managing

Parameters
application Represents the ID of the application object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the events for the given application

public List<Insight> getApplicationInsights (String application, String since, String until, String limit, String offset)

Usage metrics for this application

Parameters
application Represents the ID of the application object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the insights for the given application

public List<Post> getApplicationLinks (String application, String since, String until, String limit, String offset)

The application's posted links.

Parameters
application Represents the ID of the application object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containig the links of the given application

public List<Note> getApplicationNotes (String application, String since, String until, String limit, String offset)

The application's notes.

Parameters
application Represents the ID of the application object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the notes for the given application

public List<Photo> getApplicationPhotos (String application, String since, String until, String limit, String offset)

The photos this application is tagged in.

Parameters
application Represents the ID of the application object.
since A unix timestamp or any date accepted by shorttime
until A unix timestamp or any date accepted by shorttime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list with photos

public byte[] getApplicationPicture (String application, String type)

The application's logo

Parameters
application Represents the ID of the application object.
type One of square (50x50), small (50 pixels wide, variable height), and large (about 200 pixels wide, variable height)
Returns
  • The given application picture

public List<StatusMessage> getApplicationStatuses (String application, String since, String until, String limit, String offset)

The application's status updates.

Parameters
application Represents the ID of the application object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the status messages for the given application

public List<GetApplicationTaggedResponseType> getApplicationTagged (String application, String since, String until, String limit, String offset)

The photos, videos, and posts in which this application has been tagged.

Parameters
application Represents the ID of the application object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • The posts where this application has been tagged

public List<Video> getApplicationVideos (String application, String since, String until, String limit, String offset)

The videos this application has created

Parameters
application Represents the ID of the application object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of videos for the given application

public List<Post> getApplicationWall (String application, String since, String until, String limit, String offset)

The application's wall.

Parameters
application Represents the ID of the application object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the given application posts

public Checkin getCheckin (String checkin, String metadata)

A check-in that was made through Facebook Places.

Parameters
checkin Represents the ID of the checkin object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • The checkin represented by the given id

public Client getClient ()

public Event getEvent (String eventId, String metadata)

Specifies information about an event, including the location, event name, and which invitees plan to attend.

Parameters
eventId Represents the ID of the event object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • response from Facebook

public List<User> getEventAttending (String eventId, String since, String until, String limit, String offset)

All of the users who are attending this event

Parameters
eventId Represents the ID of the event object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of users

public List<Event> getEventDeclined (String eventId, String since, String until, String limit, String offset)

All of the users who declined their invitation to this event

Parameters
eventId Represents the ID of the event object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of events

public List<User> getEventInvited (String eventId, String since, String until, String limit, String offset)

All of the users who have been invited to this event

Parameters
eventId Represents the ID of the event object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of users

public List<User> getEventMaybe (String eventId, String since, String until, String limit, String offset)

All of the users who have been responded "Maybe" to their invitation to this event

Parameters
eventId Represents the ID of the event object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of users

public List<User> getEventNoReply (String eventId, String since, String until, String limit, String offset)

All of the users who have been not yet responded to their invitation to this event

Parameters
eventId Represents the ID of the event object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of users

public byte[] getEventPicture (String eventId, String type)

The event's profile picture

Parameters
eventId Represents the ID of the event object.
type One of square (50x50), small (50 pixels wide, variable height), and large (about 200 pixels wide, variable height)
Returns
  • The image as a Byte array

public List<Post> getEventWall (String eventId, String since, String until, String limit, String offset)

This event's wall

Parameters
eventId Represents the ID of the event object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • response from Facebook

public Group getGroup (String group, String metadata)

A Facebook group

Parameters
group Represents the ID of the group object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • The group represented by the given id

public List<Member> getGroupMembers (String group, String since, String until, String limit, String offset)

All of the users who are members of this group

Parameters
group Represents the ID of the group object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • response from Facebook

public byte[] getGroupPicture (String group, String type)

The profile picture of this group

Parameters
group Represents the ID of the group object.
type One of square (50x50), small (50 pixels wide, variable height), and large (about 200 pixels wide, variable height)
Returns
  • response from Facebook

public List<Post> getGroupWall (String group, String since, String until, String limit, String offset)

This group's wall

Parameters
group Represents the ID of the group object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of posts

public Link getLink (String link, String metadata)

A link shared on a user's wall

Parameters
link Represents the ID of the link object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • The link from facebook

public List<Comment> getLinkComments (String link, String since, String until, String limit, String offset)

All of the comments on this link

Parameters
link Represents the ID of the link object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of comments

public Note getNote (String note, String metadata)

A Facebook note

Parameters
note Represents the ID of the note object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • The note represented by the given id

public List<Comment> getNoteComments (String note, String since, String until, String limit, String offset)

All of the comments on this note

Parameters
note Represents the ID of the note object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of comments from the given note

public Post.Likes getNoteLikes (String note, String since, String until, String limit, String offset)

People who like the note

Parameters
note Represents the ID of the note object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • The links from the given note

public Page getPage (String page, String metadata)

Retrieves the page with the given ID

Parameters
page Represents the ID of the page object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • The page represented by the given id

public List<Album> getPageAlbums (String page, String since, String until, String limit, String offset)

The photo albums this page has created

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • The list of albums

public List<Checkin> getPageCheckins (String page, String since, String until, String limit, String offset)

Checkins made by the friends of the current session user

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • response from Facebook

public List<Event> getPageEvents (String page, String since, String until, String limit, String offset)

The events this page is attending

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • The list of events

public List<Group> getPageGroups (String page, String since, String until, String limit, String offset)

The groups this page is a member of

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • The list of groups

public List<Link> getPageLinks (String page, String since, String until, String limit, String offset)

The page's posted links

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of this page's links

public List<Note> getPageNotes (String page, String since, String until, String limit, String offset)

The page's notes

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • response from Facebook

public List<Photo> getPagePhotos (String page, String since, String until, String limit, String offset)

The photos this page has uploaded

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of photos from this page

public byte[] getPagePicture (String page, String type)

The page's profile picture

Parameters
page Represents the ID of the page object.
type One of square (50x50), small (50 pixels wide, variable height), and large (about 200 pixels wide, variable height)
Returns
  • A byte array with the page picture

public List<Post> getPagePosts (String page, String since, String until, String limit, String offset)

The page's own posts

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of posts

public List<StatusMessage> getPageStatuses (String page, String since, String until, String limit, String offset)

The page's status updates

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • The list of status messages

public List<Post> getPageTagged (String page, String since, String until, String limit, String offset)

The photos, videos, and posts in which this page has been tagged

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of posts

public List<Video> getPageVideos (String page, String since, String until, String limit, String offset)

The videos this page has created

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • The list of videos

public List<Post> getPageWall (String page, String since, String until, String limit, String offset)

The page's wall

Parameters
page Represents the ID of the page object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of posts from the given page wall

public Photo getPhoto (String photo, String metadata)

An individual photo

Parameters
photo Represents the ID of the photo object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • The photo represented by the given id

public List<Comment> getPhotoComments (String photo, String since, String until, String limit, String offset)

All of the comments on this photo

Parameters
photo Represents the ID of the photo object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • The list of comments of the given photo

public Post.Likes getPhotoLikes (String photo, String since, String until, String limit, String offset)

People who like the photo

Parameters
photo Represents the ID of the photo object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • The likes from the given photo

public Post getPost (String post, String metadata)

An individual entry in a profile's feed

Parameters
post Represents the ID of the post object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • The post represented by the given id

public List<Comment> getPostComments (String post, String since, String until, String limit, String offset)

All of the comments on this post

Parameters
post Represents the ID of the post object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of comments from this post

public String getScope ()

public StatusMessage getStatus (String status, String metadata)

A status message on a user's wall

Parameters
status Represents the ID of the status object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • The status represented by the given id

public List<Comment> getStatusComments (String status, String since, String until, String limit, String offset)

All of the comments on this message

Parameters
status Represents the ID of the status object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • The list of comments

public User getUser (String user, String metadata)

A user profile.

Parameters
user Represents the ID of the user object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • The user represented by the given id

public List<GetUserAccountResponseType> getUserAccounts (String user, String since, String until, String limit, String offset)

The Facebook pages owned by the current user

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of objects containing account name, access_token, category, id

public List<PageConnection> getUserActivities (String user, String since, String until, String limit, String offset)

The activities listed on the user's profile

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of objects containing activity id, name, category and create_time fields.

public List<Album> getUserAlbums (String user, String since, String until, String limit, String offset)

The photo albums this user has created. Requires the user_photos or friend_photos permission

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the photo albums the given user has created

public List<PageConnection> getUserBooks (String user, String since, String until, String limit, String offset)

The books listed on the user's profile

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the given user's books

public List<Checkin> getUserCheckins (String user, String since, String until, String limit, String offset)

The music listed on the user's profile

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list with the user checkins

public List<Event> getUserEvents (String user, String since, String until, String limit, String offset)

The events this user is attending. Requires the user_events or friend_events permission

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the events the given user is attending

public List<NamedFacebookType> getUserFriends (String user, String since, String until, String limit, String offset)

The user's friends

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of objects with the name and id of the given user's friends

public List<Group> getUserGroups (String user, String since, String until, String limit, String offset)

The groups this user is a member of. Requires the user_groups or friend_groups permission

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the Groups that the given user belongs to

public List<Post> getUserHome (String user, String since, String until, String limit, String offset)

The user's News Feed. Requires the read_stream permission

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of posts

public String getUserId ()

public List<Thread> getUserInbox (String user, String since, String until, String limit, String offset)

The threads in this user's inbox. Requires the read_mailbox permission

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the threads in the given user's inbox

public List<PageConnection> getUserInterests (String user, String since, String until, String limit, String offset)

The interests listed on the user's profile

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list with the user interests

public List<PageConnection> getUserLikes (String user, String since, String until, String limit, String offset)

All the pages this user has liked. Requires the user_likes or friend_likes permission

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing all the pages this user has liked

public List<Link> getUserLinks (String user, String since, String until, String limit, String offset)

The user's posted links. Requires the read_stream permission {@sample.xml../../../doc/mule-module-facebook.xml.sample facebook:getUserLinks}

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the given user's posted links

public List<PageConnection> getUserMovies (String user, String since, String until, String limit, String offset)

The movies listed on the user's profile

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the given user's movies

public List<PageConnection> getUserMusic (String user, String since, String until, String limit, String offset)

The music listed on the user's profile

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list with the given user's music

public List<Note> getUserNotes (String user, String since, String until, String limit, String offset)

The user's notes. Requires the read_stream permission

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the given user's notes

public List<OutboxThread> getUserOutbox (String user, String since, String until, String limit, String offset)

The messages in this user's outbox. Requires the read_mailbox permission

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of threads

public List<Photo> getUserPhotos (String user, String since, String until, String limit, String offset)

The photos this user is tagged in. Requires the user_photos or friend_photos permission

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of photos the given user is tagged in

public byte[] getUserPicture (String user, String type)

The user's profile picture

Parameters
user Represents the ID of the user object.
type One of square (50x50), small (50 pixels wide, variable height), and large (about 200 pixels wide, variable height)
Returns
  • byte[] with the jpg image

public List<Post> getUserPosts (String user, String since, String until, String limit, String offset)

The user's own posts. Requires the read_stream permission to see non-public posts.

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of posts

public List<Post> getUserSearch (String user, String q, String metadata, String since, String until, String limit, String offset)

Search an individual user's News Feed, restricted to that user's friends

Parameters
user Represents the ID of the user object.
q The text for which to search.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of posts

public List<StatusMessage> getUserStatuses (String user, String since, String until, String limit, String offset)

The user's status updates. Requires the read_stream permission

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list contining the user's status updates

public List<Post> getUserTagged (String user, String since, String until, String limit, String offset)

The photos, videos, and posts in which this user has been tagged. Requires the user_photos, user_video_tags, friends_photos, or friend_video_tags permissions

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • response from Facebook

public List<PageConnection> getUserTelevision (String user, String since, String until, String limit, String offset)

The television listed on the user's profile

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the television listed on the given user's profile

public List<OutboxThread> getUserUpdates (String user, String since, String until, String limit, String offset)

The updates in this user's inbox. Requires the read_mailbox permission

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the given user updates

public List<Video> getUserVideos (String user, String since, String until, String limit, String offset)

The videos this user has been tagged in. Requires the user_videos or friend_videos permission.

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the videos the given user has been tagged in

public List<Post> getUserWall (String user, String since, String until, String limit, String offset)

The user's wall. Requires the read_stream permission to see non-public posts.

Parameters
user Represents the ID of the user object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of posts

public Video getVideo (String video, String metadata)

An individual video

Parameters
video Represents the ID of the video object.
metadata The Graph API supports introspection of objects, which enables you to see all of the connections an object has without knowing its type ahead of time.
Returns
  • response from Facebook

public List<Comment> getVideoComments (String video, String since, String until, String limit, String offset)

All of the comments on this video

Parameters
video Represents the ID of the video object.
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list containing the given video's comments

public void like (String postId)

Write to the given profile's feed/wall.

Parameters
postId Represents the ID of the post object.

public User loggedUserDetails ()

Gets the user logged details.

Returns
  • response from Facebook the actual user.

public void publishAlbum (String profile_id, String msg, String albumName)

Create an album.

Parameters
profile_id The id of the profile object
msg The message
albumName The name of the album

public String publishComment (String postId, String msg)

Comment on the given post

Parameters
postId Represents the ID of the post object.
msg Comment on the given post
Returns
  • The id of the published comment

public void publishEvent (String profile_id)

Post an event in the given profile.

Parameters
profile_id The profile where to publish the event

public void publishLink (String profile_id, String msg, String link)

Write a note on the given profile.

Parameters
profile_id The profile where to publish the link
msg The message
link The link

public String publishMessage (String profile_id, String msg, String picture, String link, String caption, String linkName, String description)

Write to the given profile's feed/wall.

Parameters
profile_id The profile where to publish the message
msg The message
picture If available, a link to the picture included with this post
link The link attached to this post
caption The caption of the link (appears beneath the link name)
linkName The name of the link
description A description of the link (appears beneath the link caption)
Returns
  • The id of the published object

public void publishNote (String profile_id, String msg, String subject)

Write a note on the given profile.

Parameters
profile_id The profile where to publish the note
msg The message
subject The subject of the note

public void publishPhoto (String albumId, String caption, File photo)

Upload a photo to an album.

Parameters
albumId The id of the album object
caption Caption of the photo
photo File containing the photo

public List<Checkin> searchCheckins (String since, String until, String limit, String offset)

This request returns you or your friend's latest checkins, or checkins where you or your friends have been tagged; currently, it does not accept a query parameter.

Parameters
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of checkins

public List<Event> searchEvents (String q, String since, String until, String limit, String offset)

Search over all events in the social graph

Parameters
q The search string
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of events

public List<Group> searchGroups (String q, String since, String until, String limit, String offset)

Search over all groups in the social graph

Parameters
q The search string
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of groups

public List<Page> searchPages (String q, String since, String until, String limit, String offset)

Search over all pages in the social graph

Parameters
q The search string
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of pages

public List<Post> searchPosts (String q, String since, String until, String limit, String offset)

Search over all public posts in the social graph

Parameters
q The search string
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of posts

public List<User> searchUsers (String q, String since, String until, String limit, String offset)

Search over all users in the social graph

Parameters
q The search string
since A unix timestamp or any date accepted by strtotime
until A unix timestamp or any date accepted by strtotime
limit Limit the number of items returned.
offset An offset to the response. Useful for paging.
Returns
  • A list of users

public void setAccessToken (String accessToken)

Parameters
accessToken

public void setAppId (String appId)

Parameters
appId

public void setAppSecret (String appSecret)

Parameters
appSecret

public void setClient (Client client)

Parameters
client

public void setScope (String scope)

Parameters
scope

public void tentativeEvent (String eventId)

Maybe attend the given event.

Parameters
eventId Represents the id of the event object