Spring Social

org.springframework.social.oauth1
Class AbstractOAuth1ServiceProvider<S>

java.lang.Object
  extended by org.springframework.social.oauth1.AbstractOAuth1ServiceProvider<S>
Type Parameters:
S - the service API type
All Implemented Interfaces:
OAuth1ServiceProvider<S>, ServiceProvider<S>

public abstract class AbstractOAuth1ServiceProvider<S>
extends java.lang.Object
implements OAuth1ServiceProvider<S>

Base class for ServiceProviders that use the OAuth1 protocol. OAuth1-based ServiceProvider implementors should extend and implement getApi(String, String). They should also define a single constructor that accepts the consumerKey/consumerSecret and internally creates and passes up a OAuth1Operations instance.

Author:
Keith Donald

Constructor Summary
AbstractOAuth1ServiceProvider(java.lang.String consumerKey, java.lang.String consumerSecret, OAuth1Operations oauth1Operations)
          Creates a OAuth1ServiceProvider.
 
Method Summary
abstract  S getApi(java.lang.String accessToken, java.lang.String secret)
          Returns an API interface allowing the client application to access protected resources on behalf of a user.
protected  java.lang.String getConsumerKey()
          The consumer (or client) key assigned to the application by the provider.
protected  java.lang.String getConsumerSecret()
          The consumer (or client) secret assigned to the application by the provider.
 OAuth1Operations getOAuthOperations()
          Get the service interface for carrying out the "OAuth dance" with this provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOAuth1ServiceProvider

public AbstractOAuth1ServiceProvider(java.lang.String consumerKey,
                                     java.lang.String consumerSecret,
                                     OAuth1Operations oauth1Operations)
Creates a OAuth1ServiceProvider.

Parameters:
consumerKey - the consumer (or client) key assigned to the application by the provider.
consumerSecret - the consumer (or client) secret assigned to the application by the provider.
oauth1Operations - the template that allows the OAuth1-based authorization flow to be conducted with the provider.
Method Detail

getOAuthOperations

public final OAuth1Operations getOAuthOperations()
Description copied from interface: OAuth1ServiceProvider
Get the service interface for carrying out the "OAuth dance" with this provider. The result of the OAuth dance is an access token that can be used to obtain a API binding.

Specified by:
getOAuthOperations in interface OAuth1ServiceProvider<S>

getApi

public abstract S getApi(java.lang.String accessToken,
                         java.lang.String secret)
Description copied from interface: OAuth1ServiceProvider
Returns an API interface allowing the client application to access protected resources on behalf of a user.

Specified by:
getApi in interface OAuth1ServiceProvider<S>
Parameters:
accessToken - the API access token
secret - the access token secret
Returns:
the binding to the service provider's API

getConsumerKey

protected final java.lang.String getConsumerKey()
The consumer (or client) key assigned to the application by the provider. Exposed to subclasses to support constructing service API instances.

See Also:
getApi(String, String)

getConsumerSecret

protected final java.lang.String getConsumerSecret()
The consumer (or client) secret assigned to the application by the provider. Exposed to subclasses to support constructing service API instances.

See Also:
getApi(String, String)

Spring Social