|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dropbox.client2.session.AbstractSession
public abstract class AbstractSession
Keeps track of a logged in user and contains configuration options for the
DropboxAPI
. This is a base class to use for creating your own
Session
s.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.dropbox.client2.session.Session |
---|
Session.AccessType, Session.ProxyInfo |
Constructor Summary | |
---|---|
AbstractSession(AppKeyPair appKeyPair,
Session.AccessType type)
Creates a new session with the given app key and secret, and access type. |
|
AbstractSession(AppKeyPair appKeyPair,
Session.AccessType type,
AccessTokenPair accessTokenPair)
Creates a new session with the given app key and secret, and access type. |
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 |
setAccessTokenPair(AccessTokenPair accessTokenPair)
Links the session with the given 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)
Signs the request by using's OAuth's HTTP header authorization scheme and the PLAINTEXT signature method. |
void |
unlink()
Unlinks the session by removing any stored access token and secret. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractSession(AppKeyPair appKeyPair, Session.AccessType type)
public AbstractSession(AppKeyPair appKeyPair, Session.AccessType type, AccessTokenPair accessTokenPair)
Method Detail |
---|
public void setAccessTokenPair(AccessTokenPair accessTokenPair)
public AppKeyPair getAppKeyPair()
Session
getAppKeyPair
in interface Session
public AccessTokenPair getAccessTokenPair()
Session
getAccessTokenPair
in interface Session
public Session.AccessType getAccessType()
Session
getAccessType
in interface Session
public java.util.Locale getLocale()
Locale.ENLISH
, but you
are highly encouraged to localize your application and return the system
locale instead. Note: as of the time this was written, Dropbox supports
the de, en, es, fr, and ja locales - if you use a locale other than
these, messages will be returned in English. However, it is good
practice to pass along the correct locale as we will add more languages
in the future.
getLocale
in interface Session
public boolean isLinked()
Session
isLinked
in interface Session
public void unlink()
Session
unlink
in interface Session
public void sign(org.apache.http.HttpRequest request)
sign
in interface Session
request
- an HttpRequest
.Session.sign(org.apache.http.HttpRequest)
public Session.ProxyInfo getProxyInfo()
Session.ProxyInfo
object with a host and optionally a
port set.
getProxyInfo
in interface Session
public org.apache.http.client.HttpClient getHttpClient()
getHttpClient
in interface Session
public void setRequestTimeout(org.apache.http.client.methods.HttpUriRequest request)
setRequestTimeout
in interface Session
public java.lang.String getAPIServer()
Session
getAPIServer
in interface Session
public java.lang.String getContentServer()
Session
getContentServer
in interface Session
public java.lang.String getWebServer()
Session
getWebServer
in interface Session
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |