|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.code.facebookapi.ExtensibleClient<java.lang.Object>
com.google.code.facebookapi.FacebookJaxbRestClient
public class FacebookJaxbRestClient
A FacebookRestClient that JAXB response objects. This means results from calls to the Facebook API are returned as XML and transformed into JAXB Java objects.
| Field Summary | |
|---|---|
protected static org.apache.commons.logging.Log |
log
|
| Fields inherited from class com.google.code.facebookapi.ExtensibleClient |
|---|
_apiKey, _isDesktop, _readTimeout, _secret, _serverUrl, _timeout, BATCH_LIMIT, batchMode, cacheAppAdded, cacheAppUser, cacheSessionExpires, cacheSessionKey, cacheSessionSecret, cacheUserId, CRLF, HTTPS_SERVER_URL, JAXB_CONTEXT, MARKETPLACE_STATUS_DEFAULT, MARKETPLACE_STATUS_NOT_SUCCESS, MARKETPLACE_STATUS_SUCCESS, permissionsApiKey, PREF, queries, rawResponse, SERVER_URL, UPLOAD_BUFFER_SIZE |
| Fields inherited from interface com.google.code.facebookapi.IFacebookRestClient |
|---|
ERROR_TAG, FB_SERVER, HTTPS_SERVER_ADDR, SERVER_ADDR, TARGET_API_VERSION |
| Constructor Summary | |
|---|---|
FacebookJaxbRestClient(java.lang.String apiKey,
java.lang.String secret)
Constructor. |
|
FacebookJaxbRestClient(java.lang.String apiKey,
java.lang.String secret,
int connectionTimeout)
Constructor. |
|
FacebookJaxbRestClient(java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey)
Constructor. |
|
FacebookJaxbRestClient(java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int connectionTimeout)
Constructor. |
|
FacebookJaxbRestClient(java.lang.String serverAddr,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey)
Constructor. |
|
FacebookJaxbRestClient(java.lang.String serverAddr,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int connectionTimeout)
Constructor. |
|
FacebookJaxbRestClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey)
Constructor. |
|
FacebookJaxbRestClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int connectionTimeout)
Constructor. |
|
FacebookJaxbRestClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int connectionTimeout,
int readTimeout)
Constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
admin_getAppPropertiesAsString(java.util.Collection<ApplicationProperty> properties)
Retrieve application properties. |
java.lang.String |
auth_getSession(java.lang.String authToken)
Call this function to retrieve the session information after your user has logged in. |
java.util.List<? extends java.lang.Object> |
executeBatch(boolean serial)
Executes a batch of queries. |
protected boolean |
extractBoolean(java.lang.Object val)
Extracts a Boolean from a result that consists of a Boolean only. |
protected int |
extractInt(java.lang.Object val)
Extracts an Integer from a result that consists of an Integer only. |
protected java.lang.Long |
extractLong(java.lang.Object val)
Extracts a Long from a result that consists of an Long only. |
static java.lang.String |
extractNodeString(org.w3c.dom.Node d)
|
java.lang.String |
extractString(java.lang.Object val)
Extracts a String from a result consisting entirely of a String. |
protected java.net.URL |
extractURL(java.lang.Object url)
Extracts a URL from a result that consists of a URL only. |
FriendsGetResponse |
friends_get()
Retrieves the friends of the currently logged in user. |
FriendsGetResponse |
getCacheFriendsList()
|
java.lang.String |
getResponseFormat()
The response format in which results to FacebookMethod calls are returned |
java.util.List<Listing> |
marketplace_getListings(java.util.List<java.lang.Long> listingIds,
java.util.List<java.lang.Long> uids)
Retrieve listings from the marketplace. |
java.util.List<java.lang.String> |
marketplace_getSubCategories()
Return a list of all valid Marketplace subcategories. |
java.util.List<Listing> |
marketplace_search(MarketListingCategory category,
MarketListingSubcategory subcategory,
java.lang.String searchTerm)
Search the marketplace listings by category, subcategory, and keyword. |
protected java.lang.Object |
parseCallResult(java.io.InputStream data,
IFacebookMethod method)
Parses the result of an API call from XML into JAXB Objects. |
void |
setCacheFriendsList(java.util.List<java.lang.Long> ids)
|
static FriendsGetResponse |
toFriendsGetResponse(java.util.List<java.lang.Long> ids)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.commons.logging.Log log
| Constructor Detail |
|---|
public FacebookJaxbRestClient(java.lang.String apiKey,
java.lang.String secret)
apiKey - your Facebook API keysecret - your 'secret' Facebook key
public FacebookJaxbRestClient(java.lang.String apiKey,
java.lang.String secret,
int connectionTimeout)
apiKey - your Facebook API keysecret - your 'secret' Facebook keyconnectionTimeout - the connection timeout to apply when making API requests to Facebook, in milliseconds
public FacebookJaxbRestClient(java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey)
apiKey - your Facebook API keysecret - your 'secret' Facebook keysessionKey - the session-id to use
public FacebookJaxbRestClient(java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int connectionTimeout)
apiKey - your Facebook API keysecret - your 'secret' Facebook keysessionKey - the session-id to useconnectionTimeout - the connection timeout to apply when making API requests to Facebook, in milliseconds
public FacebookJaxbRestClient(java.lang.String serverAddr,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey)
throws java.net.MalformedURLException
serverAddr - the URL of the Facebook API server to useapiKey - your Facebook API keysecret - your 'secret' Facebook keysessionKey - the session-id to use
java.net.MalformedURLException - if you specify an invalid URL
public FacebookJaxbRestClient(java.lang.String serverAddr,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int connectionTimeout)
throws java.net.MalformedURLException
serverAddr - the URL of the Facebook API server to useapiKey - your Facebook API keysecret - your 'secret' Facebook keysessionKey - the session-id to useconnectionTimeout - the connection timeout to apply when making API requests to Facebook, in milliseconds
java.net.MalformedURLException - if you specify an invalid URL
public FacebookJaxbRestClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey)
serverUrl - the URL of the Facebook API server to useapiKey - your Facebook API keysecret - your 'secret' Facebook keysessionKey - the session-id to use
public FacebookJaxbRestClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int connectionTimeout)
serverUrl - the URL of the Facebook API server to useapiKey - your Facebook API keysecret - your 'secret' Facebook keysessionKey - the session-id to useconnectionTimeout - the connection timeout to apply when making API requests to Facebook, in milliseconds
public FacebookJaxbRestClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int connectionTimeout,
int readTimeout)
serverUrl - the URL of the Facebook API server to useapiKey - your Facebook API keysecret - your 'secret' Facebook keysessionKey - the session-id to useconnectionTimeout - the connection timeout to apply when making API requests to Facebook, in millisecondsreadTimeout - the read timeout to apply when making API requests to Facebook, in milliseconds| Method Detail |
|---|
public java.lang.String getResponseFormat()
getResponseFormat in class ExtensibleClient<java.lang.Object>public java.lang.String extractString(java.lang.Object val)
extractString in class ExtensibleClient<java.lang.Object>val -
public FriendsGetResponse friends_get()
throws FacebookException
IFacebookRestClient
friends_get in interface IFacebookRestClient<java.lang.Object>friends_get in class ExtensibleClient<java.lang.Object>FacebookExceptionhttp://wiki.developers.facebook.com/index.php/Friends.getpublic FriendsGetResponse getCacheFriendsList()
public void setCacheFriendsList(java.util.List<java.lang.Long> ids)
public static FriendsGetResponse toFriendsGetResponse(java.util.List<java.lang.Long> ids)
public java.lang.String auth_getSession(java.lang.String authToken)
throws FacebookException
auth_getSession in interface IFacebookRestClient<java.lang.Object>auth_getSession in class ExtensibleClient<java.lang.Object>authToken - the token returned by auth_createToken or passed back to your callback_url.
FacebookExceptionhttp://wiki.developers.facebook.com/index.php/Auth.getSession
protected java.lang.Object parseCallResult(java.io.InputStream data,
IFacebookMethod method)
throws FacebookException
parseCallResult in class ExtensibleClient<java.lang.Object>data - an InputStream with the results of a request to the Facebook serversmethod - the method
FacebookException - if data represents an error
java.io.IOException - if data is not readable
protected java.net.URL extractURL(java.lang.Object url)
throws java.io.IOException
extractURL in class ExtensibleClient<java.lang.Object>url -
java.io.IOExceptionprotected int extractInt(java.lang.Object val)
extractInt in class ExtensibleClient<java.lang.Object>val -
protected boolean extractBoolean(java.lang.Object val)
extractBoolean in class ExtensibleClient<java.lang.Object>val -
protected java.lang.Long extractLong(java.lang.Object val)
extractLong in class ExtensibleClient<java.lang.Object>val -
public java.util.List<Listing> marketplace_getListings(java.util.List<java.lang.Long> listingIds,
java.util.List<java.lang.Long> uids)
throws FacebookException
IFacebookRestClient
listingIds - the ids of listings to filter by, only listings matching the specified ids will be returned.uids - the ids of users to filter by, only listings submitted by those users will be returned.
FacebookException - if an error happens when executing the API call.
public java.util.List<java.lang.String> marketplace_getSubCategories()
throws FacebookException
IFacebookRestClient
FacebookException - if an error happens when executing the API call.
public java.util.List<Listing> marketplace_search(MarketListingCategory category,
MarketListingSubcategory subcategory,
java.lang.String searchTerm)
throws FacebookException
IFacebookRestClient
category - the category to search in, optional (unless subcategory is specified).subcategory - the subcategory to search in, optional.searchTerm - the keyword to search for, optional.
FacebookException - if an error happens when executing the API call.
public java.lang.String admin_getAppPropertiesAsString(java.util.Collection<ApplicationProperty> properties)
throws FacebookException
IFacebookRestClient
properties - a collection indicating the properties you are interested in retrieving.
FacebookException
public java.util.List<? extends java.lang.Object> executeBatch(boolean serial)
throws FacebookException
serial - set to true, and your batch queries will always execute serially, in the same order in which your specified them. If set to false, the Facebook API
server may execute your queries in parallel and/or out of order in order to improve performance.
FacebookException
java.io.IOExceptionpublic static java.lang.String extractNodeString(org.w3c.dom.Node d)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||