com.google.code.facebookapi
Class BasicClient

java.lang.Object
  extended by com.google.code.facebookapi.BasicClient

public class BasicClient
extends java.lang.Object

Basic client taking care of rest call mechanics (signing, etc) to facebook. Little api knowledge, no response interpretation is planned.


Field Summary
protected  java.lang.String apiKey
           
protected  boolean batchMode
           
protected static org.apache.commons.logging.Log log
           
protected  java.lang.String permissionsApiKey
           
protected  java.util.List<com.google.code.facebookapi.BatchQuery> queries
           
protected  java.lang.String secret
           
protected  java.net.URL serverUrl
           
protected  java.net.URL serverUrlHttps
           
protected  boolean sessionSecret
           
 
Constructor Summary
protected BasicClient(java.lang.String apiKey, java.lang.String secret, boolean sessionSecret)
           
protected BasicClient(java.net.URL serverUrl, java.net.URL serverUrlHttps, java.lang.String apiKey, java.lang.String secret, boolean sessionSecret, CommunicationStrategy communicationStrategy)
           
 
Method Summary
protected  java.util.List<java.lang.String> batch_run(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)
           
 java.lang.String callMethod(java.lang.String responseFormat, IFacebookMethod method, Pair<java.lang.String,java.lang.CharSequence>... paramPairs)
           
 java.lang.String callMethod(java.lang.String responseFormat, IFacebookMethod method, java.lang.String sessionKey, java.util.Collection<Pair<java.lang.String,java.lang.CharSequence>> paramPairs)
           
 java.lang.String callMethod(java.lang.String responseFormat, IFacebookMethod method, java.lang.String sessionKey, java.util.Collection<Pair<java.lang.String,java.lang.CharSequence>> paramPairs, java.lang.String fileName, java.io.InputStream fileStream)
           
 java.lang.String callMethod(java.lang.String responseFormat, IFacebookMethod method, java.lang.String sessionKey, Pair<java.lang.String,java.lang.CharSequence>... paramPairs)
           
protected static java.lang.String encodeMethods(java.util.List<com.google.code.facebookapi.BatchQuery> queryList)
           
 void endPermissionsMode()
           
 java.util.List<java.lang.String> executeBatch(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()
           
protected  java.util.List<com.google.code.facebookapi.BatchQuery> getQueries()
           
 java.lang.String getSecret()
           
 boolean isBatchMode()
           
 boolean isSessionSecret()
           
protected  java.util.SortedMap<java.lang.String,java.lang.String> prepareRequestParams(java.lang.String responseFormat, IFacebookMethod method, java.lang.String sessionKey, java.util.Collection<Pair<java.lang.String,java.lang.CharSequence>> paramPairs)
           
 void setServerUrl(java.lang.String newUrl)
           
 void setServerUrlHttps(java.lang.String newUrl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log

serverUrl

protected java.net.URL serverUrl

serverUrlHttps

protected java.net.URL serverUrlHttps

apiKey

protected final java.lang.String apiKey

secret

protected final java.lang.String secret

sessionSecret

protected boolean sessionSecret

batchMode

protected boolean batchMode

queries

protected java.util.List<com.google.code.facebookapi.BatchQuery> queries

permissionsApiKey

protected java.lang.String permissionsApiKey
Constructor Detail

BasicClient

protected BasicClient(java.lang.String apiKey,
                      java.lang.String secret,
                      boolean sessionSecret)

BasicClient

protected BasicClient(java.net.URL serverUrl,
                      java.net.URL serverUrlHttps,
                      java.lang.String apiKey,
                      java.lang.String secret,
                      boolean sessionSecret,
                      CommunicationStrategy communicationStrategy)
Method Detail

isBatchMode

public boolean isBatchMode()

getQueries

protected java.util.List<com.google.code.facebookapi.BatchQuery> getQueries()

getApiKey

public java.lang.String getApiKey()

getSecret

public java.lang.String getSecret()

isSessionSecret

public boolean isSessionSecret()

beginPermissionsMode

public void beginPermissionsMode(java.lang.String apiKey)

endPermissionsMode

public void endPermissionsMode()

setServerUrl

public void setServerUrl(java.lang.String newUrl)

setServerUrlHttps

public void setServerUrlHttps(java.lang.String newUrl)

callMethod

public java.lang.String callMethod(java.lang.String responseFormat,
                                   IFacebookMethod method,
                                   java.lang.String sessionKey,
                                   Pair<java.lang.String,java.lang.CharSequence>... paramPairs)
                            throws FacebookException
Throws:
FacebookException

callMethod

public java.lang.String callMethod(java.lang.String responseFormat,
                                   IFacebookMethod method,
                                   java.lang.String sessionKey,
                                   java.util.Collection<Pair<java.lang.String,java.lang.CharSequence>> paramPairs)
                            throws FacebookException
Throws:
FacebookException

callMethod

public java.lang.String callMethod(java.lang.String responseFormat,
                                   IFacebookMethod method,
                                   Pair<java.lang.String,java.lang.CharSequence>... paramPairs)
                            throws FacebookException
Throws:
FacebookException

callMethod

public java.lang.String callMethod(java.lang.String responseFormat,
                                   IFacebookMethod method,
                                   java.util.Collection<Pair<java.lang.String,java.lang.CharSequence>> paramPairs)
                            throws FacebookException
Throws:
FacebookException

prepareRequestParams

protected java.util.SortedMap<java.lang.String,java.lang.String> prepareRequestParams(java.lang.String responseFormat,
                                                                                      IFacebookMethod method,
                                                                                      java.lang.String sessionKey,
                                                                                      java.util.Collection<Pair<java.lang.String,java.lang.CharSequence>> paramPairs)
                                                                               throws FacebookException
Throws:
FacebookException

callMethod

public java.lang.String callMethod(java.lang.String responseFormat,
                                   IFacebookMethod method,
                                   java.lang.String sessionKey,
                                   java.util.Collection<Pair<java.lang.String,java.lang.CharSequence>> paramPairs,
                                   java.lang.String fileName,
                                   java.io.InputStream fileStream)
                            throws FacebookException
Throws:
FacebookException

beginBatch

public void beginBatch()

executeBatch

public java.util.List<java.lang.String> executeBatch(boolean serial)
                                              throws FacebookException
Returns a list of String raw responses which will be further broken down by the adapters into the actual individual responses. One string is returned per 20 methods in the batch.

Throws:
FacebookException

batch_run

protected java.util.List<java.lang.String> batch_run(java.lang.String methods,
                                                     boolean serial)
                                              throws FacebookException
Throws:
FacebookException

encodeMethods

protected static java.lang.String encodeMethods(java.util.List<com.google.code.facebookapi.BatchQuery> queryList)
                                         throws FacebookException
Throws:
FacebookException


Copyright © 2010. All Rights Reserved.