A
- the service API typepublic class OAuth1Connection<A> extends AbstractConnection<A>
OAuth1ConnectionFactory
should be favored to encapsulate details specific to an OAuth1-based provider.OAuth1ConnectionFactory
,
Serialized FormConstructor and Description |
---|
OAuth1Connection(ConnectionData data,
OAuth1ServiceProvider<A> serviceProvider,
ApiAdapter<A> apiAdapter)
Creates a new
OAuth1Connection from the data provided. |
OAuth1Connection(String providerId,
String providerUserId,
String accessToken,
String secret,
OAuth1ServiceProvider<A> serviceProvider,
ApiAdapter<A> apiAdapter)
Creates a new
OAuth1Connection from a OAuth1 access token response. |
Modifier and Type | Method and Description |
---|---|
ConnectionData |
createData()
Creates a data transfer object that can be used to persist the state of this connection.
|
boolean |
equals(Object obj) |
A |
getApi()
A Java binding to the service provider's native API.
|
int |
hashCode() |
fetchUserProfile, getDisplayName, getImageUrl, getKey, getMonitor, getProfileUrl, hasExpired, initKey, refresh, sync, test, updateStatus
public OAuth1Connection(String providerId, String providerUserId, String accessToken, String secret, OAuth1ServiceProvider<A> serviceProvider, ApiAdapter<A> apiAdapter)
OAuth1Connection
from a OAuth1 access token response.
Designed to be called to establish a new OAuth1Connection
after receiving an access token response successfully.
The providerUserId may be null in this case: if so, this constructor will try to resolve it using the service API obtained from the OAuth1ServiceProvider
.providerId
- the provider id e.g. "twitter"providerUserId
- the provider user ID (may be null if not returned as part of the access token response)accessToken
- the granted access tokensecret
- the access token secret (OAuth1-specific)serviceProvider
- the OAuth1-based ServiceProviderapiAdapter
- the ApiAdapter for the ServiceProviderpublic OAuth1Connection(ConnectionData data, OAuth1ServiceProvider<A> serviceProvider, ApiAdapter<A> apiAdapter)
OAuth1Connection
from the data provided.
Designed to be called when re-constituting an existing Connection
using ConnectionData
.data
- the data holding the state of this connectionserviceProvider
- the OAuth1-based ServiceProviderapiAdapter
- the ApiAdapter for the ServiceProviderpublic A getApi()
Connection
getApi
in interface Connection<A>
getApi
in class AbstractConnection<A>
public ConnectionData createData()
Connection
createData
in interface Connection<A>
createData
in class AbstractConnection<A>
public int hashCode()
hashCode
in class AbstractConnection<A>
public boolean equals(Object obj)
equals
in class AbstractConnection<A>