|
Spring Social Facebook | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.social.oauth2.AbstractOAuth2ApiBinding
org.springframework.social.facebook.api.impl.FacebookTemplate
public class FacebookTemplate
This is the central class for interacting with Facebook.
There are some operations, such as searching, that do not require OAuth
authentication. In those cases, you may use a FacebookTemplate that is
created through the default constructor and without any OAuth details.
Attempts to perform secured operations through such an instance, however,
will result in NotAuthorizedException being thrown.
| Field Summary |
|---|
| Fields inherited from interface org.springframework.social.facebook.api.GraphApi |
|---|
GRAPH_API_URL |
| Constructor Summary | |
|---|---|
FacebookTemplate()
Create a new instance of FacebookTemplate. |
|
FacebookTemplate(java.lang.String accessToken)
Create a new instance of FacebookTemplate. |
|
FacebookTemplate(java.lang.String accessToken,
java.lang.String applicationNamespace)
|
|
| Method Summary | ||
|---|---|---|
CommentOperations |
commentOperations()
API for reading and posting comments. |
|
protected void |
configureRestTemplate(org.springframework.web.client.RestTemplate restTemplate)
|
|
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,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParameters)
Fetches connections, extracting them into a collection of the given Java type Requires appropriate permission to fetch the object connection. |
|
|
fetchConnections(java.lang.String objectId,
java.lang.String connectionType,
java.lang.Class<T> type,
java.lang.String... fields)
Fetches connections, extracting them into a collection of the given Java type Requires appropriate permission to fetch the object connection. |
|
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 given Java type Requires appropriate permission to fetch the object. |
|
|
fetchObject(java.lang.String objectId,
java.lang.Class<T> type,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParameters)
Fetches an object, extracting it into the given Java type Requires appropriate permission to fetch the object. |
|
|
fetchPagedConnections(java.lang.String objectId,
java.lang.String connectionType,
java.lang.Class<T> type,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParameters)
|
|
FqlOperations |
fqlOperations()
API for performing Facebook Query Language (FQL) queries. |
|
FriendOperations |
friendOperations()
API for performing operations with a user's set of friends. |
|
java.lang.String |
getApplicationNamespace()
|
|
protected org.springframework.http.converter.json.MappingJacksonHttpMessageConverter |
getJsonMessageConverter()
|
|
protected org.springframework.social.oauth2.OAuth2Version |
getOAuth2Version()
|
|
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. |
|
OpenGraphOperations |
openGraphOperations()
API for working with OpenGraph actions. |
|
PageOperations |
pageOperations()
API for working with Facebook pages. |
|
PlacesOperations |
placesOperations()
API for performing Facebook Places checkin operations. |
|
void |
post(java.lang.String objectId,
java.lang.String connectionType,
org.springframework.util.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,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.Object> data)
Publishes data to an object's connection. |
|
QuestionOperations |
questionOperations()
API for performing question operations. |
|
org.springframework.web.client.RestOperations |
restOperations()
Returns the underlying RestOperations object allowing for consumption of Facebook endpoints that may not be otherwise covered by the API binding. |
|
void |
setRequestFactory(org.springframework.http.client.ClientHttpRequestFactory requestFactory)
|
|
UserOperations |
userOperations()
API for performing operations on Facebook user profiles. |
|
| Methods inherited from class org.springframework.social.oauth2.AbstractOAuth2ApiBinding |
|---|
getByteArrayMessageConverter, getFormMessageConverter, getMessageConverters, getRestTemplate, isAuthorized |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.social.ApiBinding |
|---|
isAuthorized |
| Constructor Detail |
|---|
public FacebookTemplate()
NotAuthorizedException.
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).
public FacebookTemplate(java.lang.String accessToken,
java.lang.String applicationNamespace)
| Method Detail |
|---|
public void setRequestFactory(org.springframework.http.client.ClientHttpRequestFactory requestFactory)
setRequestFactory in class org.springframework.social.oauth2.AbstractOAuth2ApiBindingpublic UserOperations userOperations()
Facebook
userOperations in interface Facebookpublic PlacesOperations placesOperations()
Facebook
placesOperations in interface Facebookpublic LikeOperations likeOperations()
Facebook
likeOperations in interface Facebookpublic FriendOperations friendOperations()
Facebook
friendOperations in interface Facebookpublic FeedOperations feedOperations()
Facebook
feedOperations in interface Facebookpublic GroupOperations groupOperations()
Facebook
groupOperations in interface Facebookpublic CommentOperations commentOperations()
Facebook
commentOperations in interface Facebookpublic EventOperations eventOperations()
Facebook
eventOperations in interface Facebookpublic MediaOperations mediaOperations()
Facebook
mediaOperations in interface Facebookpublic PageOperations pageOperations()
Facebook
pageOperations in interface Facebookpublic org.springframework.web.client.RestOperations restOperations()
FacebookRestOperations object allowing for consumption of Facebook endpoints that may not be otherwise covered by the API binding.
The RestOperations object returned is configured to include an OAuth 2 "Authorization" header on all requests.
restOperations in interface Facebookpublic FqlOperations fqlOperations()
Facebook
fqlOperations in interface Facebookpublic QuestionOperations questionOperations()
Facebook
questionOperations in interface Facebookpublic OpenGraphOperations openGraphOperations()
Facebook
openGraphOperations in interface Facebookpublic java.lang.String getApplicationNamespace()
getApplicationNamespace in interface GraphApi
public <T> T fetchObject(java.lang.String objectId,
java.lang.Class<T> type)
GraphApi
fetchObject in interface GraphApiobjectId - the Facebook object's IDtype - the Java type to fetch
public <T> T fetchObject(java.lang.String objectId,
java.lang.Class<T> type,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParameters)
GraphApi
fetchObject in interface GraphApiobjectId - the Facebook object's IDtype - the Java type to fetchqueryParameters - query parameters to include in the request
public <T> PagedList<T> fetchConnections(java.lang.String objectId,
java.lang.String connectionType,
java.lang.Class<T> type,
java.lang.String... fields)
GraphApi
fetchConnections in interface GraphApiobjectId - the ID of the object to retrieve the connections for.connectionType - the connection name.type - the Java type of each connection.fields - the fields to include in the response.
public <T> PagedList<T> fetchConnections(java.lang.String objectId,
java.lang.String connectionType,
java.lang.Class<T> type,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParameters)
GraphApi
fetchConnections in interface GraphApiobjectId - the ID of the object to retrieve the connections for.connectionType - the connection name.type - the Java type of each connection.queryParameters - query parameters to include in the request
public <T> PagedList<T> fetchPagedConnections(java.lang.String objectId,
java.lang.String connectionType,
java.lang.Class<T> type,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParameters)
public byte[] fetchImage(java.lang.String objectId,
java.lang.String connectionType,
ImageType type)
GraphApi
fetchImage in interface GraphApiobjectId - the object IDconnectionType - the connection nametype - 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,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.Object> data)
GraphApi
publish in interface GraphApiobjectId - the object ID to publish to.connectionType - the connection name to publish to.data - the data to publish to the connection.
public void post(java.lang.String objectId,
java.lang.String connectionType,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> data)
GraphApi
post in interface GraphApiobjectId - the object ID to publish to.connectionType - the connection name 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 nameprotected org.springframework.social.oauth2.OAuth2Version getOAuth2Version()
getOAuth2Version in class org.springframework.social.oauth2.AbstractOAuth2ApiBindingprotected void configureRestTemplate(org.springframework.web.client.RestTemplate restTemplate)
configureRestTemplate in class org.springframework.social.oauth2.AbstractOAuth2ApiBindingprotected org.springframework.http.converter.json.MappingJacksonHttpMessageConverter getJsonMessageConverter()
getJsonMessageConverter in class org.springframework.social.oauth2.AbstractOAuth2ApiBinding
|
Spring Social Facebook | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||