public interface LegacyFacebookClient
Implementors must support Legacy authentication (API Key, Application Secret, and Session Key) as well as the new OAuth authentication method. Using OAuth authentication is much simpler and strongly recommended.
Green-field projects should use the new Facebook Graph API via
FacebookClient
instead.
execute(String, Parameter...)
family of methods should be used when performing API calls that return
a single object.executeForList(String, Class, Parameter...)
family of methods should be used when performing API
calls that return a list of objects.executeMultiquery(Map, Class, Parameter...)
family of methods should be used when performing
fql.multiquery
API calls.Modifier and Type | Method and Description |
---|---|
<T> T |
execute(String method,
Class<T> resultType,
Parameter... parameters)
Executes a Facebook API method with the given
parameters , mapping the API response to a single instance of
type resultType . |
void |
execute(String method,
Parameter... parameters)
Executes a Facebook API method with the given
parameters , ignoring the response. |
<T> T |
execute(String method,
String sessionKey,
Class<T> resultType,
Parameter... parameters)
Deprecated.
Use
execute(String, Class, Parameter...) instead. Facebook is moving to OAuth and will stop
supporting the old session key authentication scheme soon. |
void |
execute(String method,
String sessionKey,
Parameter... parameters)
Deprecated.
Use
execute(String, Parameter...) instead. Facebook is moving to OAuth and will stop
supporting the old session key authentication scheme soon. |
<T> List<T> |
executeForList(String method,
Class<T> resultType,
Parameter... parameters)
Executes a Facebook API method with the given
parameters , mapping the API response to a List of
instances of type resultType . |
<T> List<T> |
executeForList(String method,
String sessionKey,
Class<T> resultType,
Parameter... parameters)
Deprecated.
Use
executeForList(String, Class, Parameter...) instead. Facebook is moving to OAuth and will
stop supporting the old session key authentication scheme soon. |
<T> T |
executeMultiquery(Map<String,String> queries,
Class<T> resultType,
Parameter... additionalParameters)
Executes the
fql.multiquery API
call, mapping the API response to a single instance of type resultType . |
<T> T |
executeMultiquery(Map<String,String> queries,
String sessionKey,
Class<T> resultType,
Parameter... additionalParameters)
Deprecated.
Use
executeMultiquery(Map, Class, Parameter...) instead. Facebook is moving to OAuth and will
stop supporting the old session key authentication scheme soon. |
void execute(String method, Parameter... parameters)
parameters
, ignoring the response.method
- The Facebook API method to call, e.g. fql.query
.parameters
- Parameters to include in the API call.FacebookException
- If an error occurs while performing the API call.@Deprecated void execute(String method, String sessionKey, Parameter... parameters)
execute(String, Parameter...)
instead. Facebook is moving to OAuth and will stop
supporting the old session key authentication scheme soon.parameters
, ignoring the response.method
- The Facebook API method to call, e.g. fql.query
.sessionKey
- A Facebook API session key if you're using the legacy API key/Secret key authentication scheme. Must be
null
if using OAuth access token authentication.parameters
- Parameters to include in the API call.FacebookException
- If an error occurs while performing the API call.IllegalArgumentException
- If sessionKey
is provided when using OAuth access token authentication.<T> T execute(String method, Class<T> resultType, Parameter... parameters)
parameters
, mapping the API response to a single instance of
type resultType
.T
- Java type to map to.method
- The Facebook API method to call, e.g. fql.query
.resultType
- Result type token.parameters
- Parameters to include in the API call.resultType
which contains API response data.FacebookException
- If an error occurs while performing the API call.@Deprecated <T> T execute(String method, String sessionKey, Class<T> resultType, Parameter... parameters)
execute(String, Class, Parameter...)
instead. Facebook is moving to OAuth and will stop
supporting the old session key authentication scheme soon.parameters
, mapping the API response to a single instance of
type resultType
.T
- Java type to map to.method
- The Facebook API method to call, e.g. fql.query
.sessionKey
- A Facebook API session key if you're using the legacy API key/Secret key authentication scheme. Must be
null
if using OAuth access token authentication.resultType
- Result type token.parameters
- Parameters to include in the API call.resultType
which contains API response data.FacebookException
- If an error occurs while performing the API call.IllegalArgumentException
- If sessionKey
is provided when using OAuth access token authentication.<T> List<T> executeForList(String method, Class<T> resultType, Parameter... parameters)
parameters
, mapping the API response to a List
of
instances of type resultType
.T
- Java type to map to.method
- The Facebook API method to call, e.g. fql.query
.resultType
- Result type token.parameters
- Parameters to include in the API call.List
of instances of type resultType
which contain API response data.FacebookException
- If an error occurs while performing the API call.@Deprecated <T> List<T> executeForList(String method, String sessionKey, Class<T> resultType, Parameter... parameters)
executeForList(String, Class, Parameter...)
instead. Facebook is moving to OAuth and will
stop supporting the old session key authentication scheme soon.parameters
, mapping the API response to a List
of
instances of type resultType
.T
- Java type to map to.method
- The Facebook API method to call, e.g. fql.query
.sessionKey
- A Facebook API session key if you're using the legacy API key/Secret key authentication scheme. Must be
null
if using OAuth access token authentication.resultType
- Result type token.parameters
- Parameters to include in the API call.List
of instances of type resultType
which contain API response data.FacebookException
- If an error occurs while performing the API call.IllegalArgumentException
- If sessionKey
is provided when using OAuth access token authentication.<T> T executeMultiquery(Map<String,String> queries, Class<T> resultType, Parameter... additionalParameters)
fql.multiquery
API
call, mapping the API response to a single instance of type resultType
.
This method exists because the standard execute(String, Parameter...)
and
executeForList(String, Class, Parameter...)
family of methods are not expressive enough to handle
fql.multiquery
in a non-verbose way.
T
- Java type to map to.queries
- A mapping of query names to queries. This is marshaled to JSON and sent over the wire to the Facebook API
endpoint as the queries
parameter.resultType
- Result type token.additionalParameters
- Additional parameters to include in the API call.resultType
which contains API response data.FacebookException
- If an error occurs while performing the API call.@Deprecated <T> T executeMultiquery(Map<String,String> queries, String sessionKey, Class<T> resultType, Parameter... additionalParameters)
executeMultiquery(Map, Class, Parameter...)
instead. Facebook is moving to OAuth and will
stop supporting the old session key authentication scheme soon.fql.multiquery
API
call, mapping the API response to a single instance of type resultType
.
This method exists because the standard execute(String, Parameter...)
and
executeForList(String, Class, Parameter...)
family of methods are not expressive enough to handle
fql.multiquery
in a non-verbose way.
T
- Java type to map to.queries
- A mapping of query names to queries. This is marshaled to JSON and sent over the wire to the Facebook API
endpoint as the queries
parameter.sessionKey
- A Facebook API session key if you're using the legacy API key/Secret key authentication scheme. Must be
null
if using OAuth access token authentication.resultType
- Result type token.additionalParameters
- Additional parameters to include in the API call.resultType
which contains API response data.FacebookException
- If an error occurs while performing the API call.IllegalArgumentException
- If sessionKey
is provided when using OAuth access token authentication.RestFB 1.38.0. Copyright © 2010-2015 Mark Allen. All Rights Reserved.