|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.social.facebook.api.impl.FacebookTemplate
public class FacebookTemplate
This is the central class for interacting with Facebook.
All operations through Facebook require OAuth 2-based authentication. Therefore, FacebookTemplate must be given an access token at construction time.
| Field Summary |
|---|
| Fields inherited from interface org.springframework.social.facebook.api.GraphApi |
|---|
CONNECTION_URL, GRAPH_API_URL, OBJECT_URL |
| Constructor Summary | |
|---|---|
FacebookTemplate(java.lang.String accessToken)
Create a new instance of FacebookTemplate. |
|
| Method Summary | ||
|---|---|---|
CommentOperations |
commentOperations()
API for reading and posting comments. |
|
void |
delete(java.lang.String objectId)
Deletes an object. |
|
void |
delete(java.lang.String objectId,
java.lang.String connectionType)
Deletes an object connection. |
|
EventOperations |
eventOperations()
API for performing operations on events. |
|
FeedOperations |
feedOperations()
API for performing operations on feeds. |
|
|
fetchConnections(java.lang.String objectId,
java.lang.String connectionType,
java.lang.Class<T> type,
java.lang.String... fields)
Fetches connections, extracting them into a Java type via the given ResponseExtractor. |
|
byte[] |
fetchImage(java.lang.String objectId,
java.lang.String connectionType,
ImageType type)
Fetches an image as an array of bytes. |
|
|
fetchObject(java.lang.String objectId,
java.lang.Class<T> type)
Fetches an object, extracting it into the type via the given ResponseExtractor. |
|
FriendOperations |
friendOperations()
API for performing operations with a user's set of friends. |
|
RestTemplate |
getRestTemplate()
|
|
GroupOperations |
groupOperations()
API for performing operations on groups. |
|
LikeOperations |
likeOperations()
API for performing operations against user likes and interests. |
|
MediaOperations |
mediaOperations()
API for performing operations on albums, photos, and videos. |
|
PlacesOperations |
placesOperations()
API for performing Facebook Places checkin operations. |
|
void |
post(java.lang.String objectId,
java.lang.String connectionType,
MultiValueMap<java.lang.String,java.lang.String> data)
Publishes data to an object's connection. |
|
java.lang.String |
publish(java.lang.String objectId,
java.lang.String connectionType,
MultiValueMap<java.lang.String,java.lang.String> data)
Publishes data to an object's connection. |
|
UserOperations |
userOperations()
API for performing operations on Facebook user profiles. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FacebookTemplate(java.lang.String accessToken)
accessToken - An access token given by Facebook after a successful OAuth 2 authentication (or through Facebook's JS library).| Method Detail |
|---|
public UserOperations userOperations()
FacebookApi
userOperations in interface FacebookApipublic PlacesOperations placesOperations()
FacebookApi
placesOperations in interface FacebookApipublic LikeOperations likeOperations()
FacebookApi
likeOperations in interface FacebookApipublic FriendOperations friendOperations()
FacebookApi
friendOperations in interface FacebookApipublic FeedOperations feedOperations()
FacebookApi
feedOperations in interface FacebookApipublic GroupOperations groupOperations()
FacebookApi
groupOperations in interface FacebookApipublic CommentOperations commentOperations()
FacebookApi
commentOperations in interface FacebookApipublic EventOperations eventOperations()
FacebookApi
eventOperations in interface FacebookApipublic MediaOperations mediaOperations()
FacebookApi
mediaOperations in interface FacebookApi
public <T> T fetchObject(java.lang.String objectId,
java.lang.Class<T> type)
GraphApiResponseExtractor.
Requires appropriate permission to fetch the object.
fetchObject in interface GraphApiobjectId - the Facebook object's IDtype - the Java type to fetch
public <T> T fetchConnections(java.lang.String objectId,
java.lang.String connectionType,
java.lang.Class<T> type,
java.lang.String... fields)
GraphApiResponseExtractor.
Requires appropriate permission to fetch the object connection.
fetchConnections in interface GraphApiobjectId - the ID of the object to retrieve the connections for.connectionType - the connection type.type - the Java type to fetchfields - the fields to include in the response.
public byte[] fetchImage(java.lang.String objectId,
java.lang.String connectionType,
ImageType type)
GraphApi
fetchImage in interface GraphApiobjectId - the object IDconnectionType - the connection typetype - the type of image to retrieve (eg., small, normal, large, or square)
public java.lang.String publish(java.lang.String objectId,
java.lang.String connectionType,
MultiValueMap<java.lang.String,java.lang.String> data)
GraphApi
publish in interface GraphApiobjectId - the object ID to publish to.connectionType - the connection type to publish to.data - the data to publish to the connection.
public void post(java.lang.String objectId,
java.lang.String connectionType,
MultiValueMap<java.lang.String,java.lang.String> data)
GraphApi
post in interface GraphApiobjectId - the object ID to publish to.connectionType - the connection type to publish to.data - the data to publish to the connection.public void delete(java.lang.String objectId)
GraphApi
delete in interface GraphApiobjectId - the object ID
public void delete(java.lang.String objectId,
java.lang.String connectionType)
GraphApi
delete in interface GraphApiobjectId - the object IDconnectionType - the connection typepublic RestTemplate getRestTemplate()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||