|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.code.facebookapi.BasicClient
public class BasicClient
Basic client taking care of rest call mechanics (signing, etc) to facebook. No api knowledge, nor response interpretation is planned.
| Field Summary | |
|---|---|
protected java.lang.String |
_apiKey
|
protected boolean |
_isDesktop
|
protected int |
_readTimeout
|
protected java.lang.String |
_secret
|
protected java.net.URL |
_serverUrl
|
protected int |
_timeout
|
protected boolean |
batchMode
|
protected java.lang.Long |
cacheSessionExpires
|
protected java.lang.String |
cacheSessionKey
|
protected java.lang.String |
cacheSessionSecret
filled in when session is established only used for desktop apps |
protected static java.lang.String |
CRLF
|
protected static org.apache.commons.logging.Log |
log
|
protected java.lang.String |
permissionsApiKey
|
protected static java.lang.String |
PREF
|
protected java.util.List<com.google.code.facebookapi.BatchQuery> |
queries
|
protected java.lang.String |
rawResponse
|
protected static int |
UPLOAD_BUFFER_SIZE
|
| Constructor Summary | |
|---|---|
protected |
BasicClient(java.lang.String apiKey,
java.lang.String secret)
|
protected |
BasicClient(java.lang.String apiKey,
java.lang.String secret,
int timeout)
|
protected |
BasicClient(java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey)
|
protected |
BasicClient(java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int timeout)
|
protected |
BasicClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey)
|
protected |
BasicClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int timeout)
|
protected |
BasicClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int timeout,
int readTimeout)
|
| Method Summary | |
|---|---|
java.lang.String |
batch_run(java.lang.String responseFormat,
java.lang.String methods,
boolean serial)
|
void |
beginBatch()
|
void |
beginPermissionsMode(java.lang.String apiKey)
|
java.lang.String |
callMethod(java.lang.String responseFormat,
IFacebookMethod method,
java.util.Collection<Pair<java.lang.String,java.lang.CharSequence>> paramPairs)
Call the specified method, with the given parameters, and return a DOM tree with the results. |
java.lang.String |
callMethod(java.lang.String responseFormat,
IFacebookMethod method,
java.util.Collection<Pair<java.lang.String,java.lang.CharSequence>> paramPairs,
java.lang.String fileName,
java.io.InputStream fileStream)
|
protected java.lang.String |
callMethod(java.lang.String responseFormat,
IFacebookMethod method,
Pair<java.lang.String,java.lang.CharSequence>... paramPairs)
Call the specified method, with the given parameters, and return a DOM tree with the results. |
static java.lang.String |
encodeMethods(java.util.List<com.google.code.facebookapi.BatchQuery> queryList)
|
void |
endPermissionsMode()
|
java.util.List<java.lang.String> |
executeBatch(java.lang.String responseFormat,
boolean serial)
Returns a list of String raw responses which will be further broken down by the adapters into the actual individual responses. |
java.lang.String |
getApiKey()
|
java.lang.Long |
getCacheSessionExpires()
|
java.lang.String |
getCacheSessionKey()
|
java.lang.String |
getCacheSessionSecret()
|
java.util.List<com.google.code.facebookapi.BatchQuery> |
getQueries()
|
java.lang.String |
getRawResponse()
|
java.lang.String |
getSecret()
|
java.lang.String |
getSessionSecret()
Gets the session-token used by Facebook to authenticate a desktop application. |
boolean |
isBatchMode()
|
boolean |
isDesktop()
|
protected java.lang.String |
postFileRequest(java.util.Map<java.lang.String,java.lang.String> params,
java.lang.String fileName,
java.io.InputStream fileStream)
Helper function for posting a request that includes raw file data, eg #photos_upload. |
void |
setCacheSessionExpires(java.lang.Long cacheSessionExpires)
|
void |
setCacheSessionKey(java.lang.String cacheSessionKey)
|
void |
setCacheSessionSecret(java.lang.String cacheSessionSecret)
|
void |
setServerUrl(java.lang.String newUrl)
|
void |
setSessionSecret(java.lang.String key)
Allows the session-token to be manually overridden when running a desktop application. |
| 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
protected static final java.lang.String CRLF
protected static final java.lang.String PREF
protected static final int UPLOAD_BUFFER_SIZE
protected java.net.URL _serverUrl
protected int _timeout
protected int _readTimeout
protected final java.lang.String _apiKey
protected final java.lang.String _secret
protected boolean _isDesktop
protected java.lang.String cacheSessionKey
protected java.lang.Long cacheSessionExpires
protected java.lang.String cacheSessionSecret
protected java.lang.String rawResponse
protected boolean batchMode
protected java.util.List<com.google.code.facebookapi.BatchQuery> queries
protected java.lang.String permissionsApiKey
| Constructor Detail |
|---|
protected BasicClient(java.lang.String apiKey,
java.lang.String secret)
protected BasicClient(java.lang.String apiKey,
java.lang.String secret,
int timeout)
protected BasicClient(java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey)
protected BasicClient(java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int timeout)
protected BasicClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int timeout)
protected BasicClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey,
int timeout,
int readTimeout)
protected BasicClient(java.net.URL serverUrl,
java.lang.String apiKey,
java.lang.String secret,
java.lang.String sessionKey)
| Method Detail |
|---|
public boolean isBatchMode()
public java.util.List<com.google.code.facebookapi.BatchQuery> getQueries()
public boolean isDesktop()
public java.lang.String getRawResponse()
public java.lang.String getApiKey()
public java.lang.String getSecret()
public void beginPermissionsMode(java.lang.String apiKey)
public void endPermissionsMode()
public java.lang.String getSessionSecret()
public void setSessionSecret(java.lang.String key)
key - the new value to set. Incorrect values may cause your application to fail to run.public java.lang.String getCacheSessionSecret()
public void setCacheSessionSecret(java.lang.String cacheSessionSecret)
public java.lang.Long getCacheSessionExpires()
public void setCacheSessionExpires(java.lang.Long cacheSessionExpires)
public java.lang.String getCacheSessionKey()
public void setCacheSessionKey(java.lang.String cacheSessionKey)
protected java.lang.String callMethod(java.lang.String responseFormat,
IFacebookMethod method,
Pair<java.lang.String,java.lang.CharSequence>... paramPairs)
throws FacebookException
method - the fieldName of the methodparamPairs - a list of arguments to the method
java.lang.Exception - with a description of any errors given to us by the server.
FacebookException
public java.lang.String callMethod(java.lang.String responseFormat,
IFacebookMethod method,
java.util.Collection<Pair<java.lang.String,java.lang.CharSequence>> paramPairs)
throws FacebookException
method - the fieldName of the methodparamPairs - a list of arguments to the method
java.lang.Exception - with a description of any errors given to us by the server.
FacebookException
public java.lang.String callMethod(java.lang.String responseFormat,
IFacebookMethod method,
java.util.Collection<Pair<java.lang.String,java.lang.CharSequence>> paramPairs,
java.lang.String fileName,
java.io.InputStream fileStream)
throws FacebookException
FacebookException
protected java.lang.String postFileRequest(java.util.Map<java.lang.String,java.lang.String> params,
java.lang.String fileName,
java.io.InputStream fileStream)
throws java.io.IOException
#photos_upload.
methodName - the name of the methodparams - request parameters (not including the file)doEncode - whether to UTF8-encode the parameters
java.io.IOException#photos_uploadpublic void beginBatch()
public java.lang.String batch_run(java.lang.String responseFormat,
java.lang.String methods,
boolean serial)
throws FacebookException
FacebookExceptionpublic void setServerUrl(java.lang.String newUrl)
public java.util.List<java.lang.String> executeBatch(java.lang.String responseFormat,
boolean serial)
throws FacebookException
FacebookException
public static java.lang.String encodeMethods(java.util.List<com.google.code.facebookapi.BatchQuery> queryList)
throws FacebookException
FacebookException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||