org.springframework.social.facebook
Interface FacebookOperations

All Known Implementing Classes:
FacebookTemplate

public interface FacebookOperations

Interface specifying a basic set of operations for interacting with Facebook. Implemented by FacebookTemplate. Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Many of the methods contained in this interface require an access token from Facebook. When a method's description speaks of the "current user", it is referring to the user for whom the access token has been issued.


Method Summary
 java.util.List<java.lang.String> getFriendIds()
          Get a list of the user's friends.
 java.lang.String getProfileId()
          Retrieves the user's Facebook profile ID.
 byte[] getProfilePicture()
          Retrieves the current user's profile picture as an array of bytes.
 byte[] getProfilePicture(java.lang.String profileId)
          Retrieves a user's profile picture as an array of bytes.
 java.lang.String getProfileUrl()
          Retrieve the URL to the user's Facebook profile.
 FacebookProfile getUserProfile()
          Retrieve the current user's Facebook profile information.
 void publish(java.lang.String object, java.lang.String connection, MultiValueMap<java.lang.String,java.lang.String> data)
           Low-level publish-to-Facebook method for publishing any type of object supported by Facebook's API.
 void updateStatus(java.lang.String status)
          Posts a message to the current user's wall.
 void updateStatus(java.lang.String message, FacebookLink link)
          Posts a message to the current user's wall along with a link.
 

Method Detail

getProfileId

java.lang.String getProfileId()
Retrieves the user's Facebook profile ID.

Returns:
the user's Facebook profile ID.

getUserProfile

FacebookProfile getUserProfile()
Retrieve the current user's Facebook profile information.

Returns:
the user's profile information.

getProfileUrl

java.lang.String getProfileUrl()
Retrieve the URL to the user's Facebook profile.

Returns:
the URL to the user's Facebook profile.

getFriendIds

java.util.List<java.lang.String> getFriendIds()
Get a list of the user's friends.

Returns:
a list of Strings where each entry is the Facebook ID of one of the user's friends.

updateStatus

void updateStatus(java.lang.String status)
Posts a message to the current user's wall.

Parameters:
message - The message to post

updateStatus

void updateStatus(java.lang.String message,
                  FacebookLink link)
Posts a message to the current user's wall along with a link.

Parameters:
message - The message to post
link - A link to be included in the status update

publish

void publish(java.lang.String object,
             java.lang.String connection,
             MultiValueMap<java.lang.String,java.lang.String> data)

Low-level publish-to-Facebook method for publishing any type of object supported by Facebook's API.

Parameters:
object - The ID of the object to publish to.
connection - The connection to be published.
data - The data to be published.

getProfilePicture

byte[] getProfilePicture()
Retrieves the current user's profile picture as an array of bytes.

Returns:
the user's profile picture in bytes.

getProfilePicture

byte[] getProfilePicture(java.lang.String profileId)
Retrieves a user's profile picture as an array of bytes.

Parameters:
profileId - the Facebook ID of the user.
Returns:
the user's profile picture in bytes.