|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.restfb.DefaultLegacyFacebookClient
public class DefaultLegacyFacebookClient
Default implementation of a Legacy Facebook API client.
Constructor Summary | |
---|---|
DefaultLegacyFacebookClient(String accessToken)
Creates a Facebook API client with the given OAuth access token. |
|
DefaultLegacyFacebookClient(String apiKey,
String secretKey)
Deprecated. You should use DefaultLegacyFacebookClient(String)
instead. Facebook is moving to OAuth and will stop supporting
the old authentication scheme soon. |
|
DefaultLegacyFacebookClient(String apiKey,
String secretKey,
WebRequestor webRequestor,
JsonMapper jsonMapper)
Deprecated. You should use DefaultLegacyFacebookClient(String, WebRequestor, JsonMapper)
instead. Facebook is moving to OAuth and will stop supporting
the old authentication scheme soon. |
|
DefaultLegacyFacebookClient(String accessToken,
WebRequestor webRequestor,
JsonMapper jsonMapper)
Creates a Facebook API client with the given OAuth access token. |
Method Summary | ||
---|---|---|
|
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. |
|
|
execute(String method,
String sessionKey,
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,
String sessionKey,
Parameter... parameters)
Executes a Facebook API method with the given parameters , ignoring
the response. |
|
|
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 . |
|
|
executeForList(String method,
String sessionKey,
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 . |
|
|
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 . |
|
|
executeMultiquery(Map<String,String> queries,
String sessionKey,
Class<T> resultType,
Parameter... additionalParameters)
Executes the fql.multiquery API call, mapping the API response to a single
instance of type resultType . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultLegacyFacebookClient(String accessToken)
accessToken
- An OAuth access token.
NullPointerException
- If accessToken
is null
.
IllegalArgumentException
- If accessToken
is a blank string.@Deprecated public DefaultLegacyFacebookClient(String apiKey, String secretKey)
DefaultLegacyFacebookClient(String)
instead. Facebook is moving to OAuth and will stop supporting
the old authentication scheme soon.
apiKey
- A Facebook API key.secretKey
- A Facebook application secret key.
NullPointerException
- If either parameter is null
.
IllegalArgumentException
- If either parameter is a blank string.@Deprecated public DefaultLegacyFacebookClient(String apiKey, String secretKey, WebRequestor webRequestor, JsonMapper jsonMapper)
DefaultLegacyFacebookClient(String, WebRequestor, JsonMapper)
instead. Facebook is moving to OAuth and will stop supporting
the old authentication scheme soon.
webRequestor
, and jsonMapper
(Legacy authentication).
apiKey
- A Facebook API key.secretKey
- A Facebook application secret key.webRequestor
- The WebRequestor
implementation to use for POST
ing
to the API endpoint.jsonMapper
- The JsonMapper
implementation to use for mapping API
response JSON to Java objects.
NullPointerException
- If any parameter is null
.
IllegalArgumentException
- If either apiKey
or secretKey
is a blank string.public DefaultLegacyFacebookClient(String accessToken, WebRequestor webRequestor, JsonMapper jsonMapper)
accessToken
- An OAuth access token.webRequestor
- The WebRequestor
implementation to use for POST
ing
to the API endpoint.jsonMapper
- The JsonMapper
implementation to use for mapping API
response JSON to Java objects.
NullPointerException
- If any parameter is null
.
IllegalArgumentException
- If accessToken
is a blank string.Method Detail |
---|
public void execute(String method, Parameter... parameters)
LegacyFacebookClient
parameters
, ignoring
the response.
execute
in interface LegacyFacebookClient
method
- The Facebook API method to call, e.g. fql.query
.parameters
- Parameters to include in the API call.LegacyFacebookClient.execute(java.lang.String,
com.restfb.Parameter[])
public void execute(String method, String sessionKey, Parameter... parameters)
LegacyFacebookClient
parameters
, ignoring
the response.
execute
in interface LegacyFacebookClient
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.LegacyFacebookClient.execute(java.lang.String,
java.lang.String, com.restfb.Parameter[])
public <T> T execute(String method, Class<T> resultType, Parameter... parameters)
LegacyFacebookClient
parameters
, mapping
the API response to a single instance of type resultType
.
execute
in interface LegacyFacebookClient
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.LegacyFacebookClient.execute(java.lang.String,
java.lang.Class, com.restfb.Parameter[])
public <T> T execute(String method, String sessionKey, Class<T> resultType, Parameter... parameters)
LegacyFacebookClient
parameters
, mapping
the API response to a single instance of type resultType
.
execute
in interface LegacyFacebookClient
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.LegacyFacebookClient.execute(java.lang.String,
java.lang.String, java.lang.Class, com.restfb.Parameter[])
public <T> List<T> executeForList(String method, Class<T> resultType, Parameter... parameters)
LegacyFacebookClient
parameters
, mapping
the API response to a List
of instances of type resultType
.
executeForList
in interface LegacyFacebookClient
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.LegacyFacebookClient.executeForList(java.lang.String,
java.lang.Class, com.restfb.Parameter[])
public <T> List<T> executeForList(String method, String sessionKey, Class<T> resultType, Parameter... parameters)
LegacyFacebookClient
parameters
, mapping
the API response to a List
of instances of type resultType
.
executeForList
in interface LegacyFacebookClient
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.LegacyFacebookClient.executeForList(java.lang.String,
java.lang.String, java.lang.Class, com.restfb.Parameter[])
public <T> T executeMultiquery(Map<String,String> queries, Class<T> resultType, Parameter... additionalParameters)
LegacyFacebookClient
fql.multiquery
API call, mapping the API response to a single
instance of type resultType
.
This method exists because the standard
LegacyFacebookClient.execute(String, Parameter...)
and
LegacyFacebookClient.executeForList(String, Class, Parameter...)
family of methods are
not expressive enough to handle fql.multiquery
in a non-verbose
way.
executeMultiquery
in interface LegacyFacebookClient
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.LegacyFacebookClient.executeMultiquery(java.util.Map,
java.lang.Class, com.restfb.Parameter[])
public <T> T executeMultiquery(Map<String,String> queries, String sessionKey, Class<T> resultType, Parameter... additionalParameters)
LegacyFacebookClient
fql.multiquery
API call, mapping the API response to a single
instance of type resultType
.
This method exists because the standard
LegacyFacebookClient.execute(String, Parameter...)
and
LegacyFacebookClient.executeForList(String, Class, Parameter...)
family of methods are
not expressive enough to handle fql.multiquery
in a non-verbose
way.
executeMultiquery
in interface LegacyFacebookClient
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.LegacyFacebookClient.executeMultiquery(java.util.Map,
java.lang.String, java.lang.Class, com.restfb.Parameter[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |