com.dropbox.client2.session
Interface Session

All Known Implementing Classes:
AbstractSession, AndroidAuthSession, WebAuthSession

public interface Session

Keeps track of a logged in user. Contains configuration options for the DropboxAPI.


Nested Class Summary
static class Session.AccessType
           
static class Session.ProxyInfo
          Describes a proxy.
 
Method Summary
 AccessTokenPair getAccessTokenPair()
          Returns the currently logged in user's access token and secret.
 Session.AccessType getAccessType()
          Returns what Dropbox access type to use (currently app folder or entire Dropbox).
 java.lang.String getAPIServer()
          Returns the Dropbox API server.
 AppKeyPair getAppKeyPair()
          Returns the app key and secret.
 java.lang.String getContentServer()
          Returns the Dropbox content server.
 org.apache.http.client.HttpClient getHttpClient()
          Will be called every time a request is made to Dropbox, in case you want to use a new client every time.
 java.util.Locale getLocale()
          Returns the locale to use.
 Session.ProxyInfo getProxyInfo()
          Will be called every time a request is made to Dropbox, in case the proxy changes between requests.
 java.lang.String getWebServer()
          Returns the Dropbox web server.
 boolean isLinked()
          Returns whether or not this session has a user's access token and secret.
 void setRequestTimeout(org.apache.http.client.methods.HttpUriRequest request)
          Will be called every time right before a request is sent to Dropbox.
 void sign(org.apache.http.HttpRequest request)
          OAuth signs the request with the currently-set tokens and secrets.
 void unlink()
          Unlinks the session by removing any stored access token and secret.
 

Method Detail

getAppKeyPair

AppKeyPair getAppKeyPair()
Returns the app key and secret.


getAccessTokenPair

AccessTokenPair getAccessTokenPair()
Returns the currently logged in user's access token and secret.


getAccessType

Session.AccessType getAccessType()
Returns what Dropbox access type to use (currently app folder or entire Dropbox).


getLocale

java.util.Locale getLocale()
Returns the locale to use. Must not return null. Currently, this is used for user-facing messages that are returned by the API. You should not cache this value, but instead get it every time from the system in case the locale changes.


isLinked

boolean isLinked()
Returns whether or not this session has a user's access token and secret.


unlink

void unlink()
Unlinks the session by removing any stored access token and secret.


sign

void sign(org.apache.http.HttpRequest request)
OAuth signs the request with the currently-set tokens and secrets.

Parameters:
request - an HttpRequest.

getProxyInfo

Session.ProxyInfo getProxyInfo()
Will be called every time a request is made to Dropbox, in case the proxy changes between requests. Return null if you do not want to use a proxy, or a Session.ProxyInfo object with a host and optionally a port set.


getHttpClient

org.apache.http.client.HttpClient getHttpClient()
Will be called every time a request is made to Dropbox, in case you want to use a new client every time. However, it's highly recommended to create a client once and reuse it to take advantage of connection reuse.


setRequestTimeout

void setRequestTimeout(org.apache.http.client.methods.HttpUriRequest request)
Will be called every time right before a request is sent to Dropbox. It should set the socket and connection timeouts on the request if you want to override the default values. This is abstracted out to cope with signature changes in the Apache HttpClient libraries.


getAPIServer

java.lang.String getAPIServer()
Returns the Dropbox API server. Changing this will break things.


getContentServer

java.lang.String getContentServer()
Returns the Dropbox content server. Changing this will break things.


getWebServer

java.lang.String getWebServer()
Returns the Dropbox web server. Changing this will break things.