Spring Social

org.springframework.social.oauth2
Class AbstractOAuth2ServiceProvider<S>

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

public abstract class AbstractOAuth2ServiceProvider<S>
extends java.lang.Object
implements OAuth2ServiceProvider<S>

Base class for ServiceProviders that use the OAuth2 protocol. OAuth2-based ServiceProvider implementations should extend and implement getApi(String).

Author:
Keith Donald

Constructor Summary
AbstractOAuth2ServiceProvider(OAuth2Operations oauth2Operations)
          Create a new OAuth2ServiceProvider.
 
Method Summary
abstract  S getApi(java.lang.String accessToken)
          Returns an API interface allowing the client application to access protected resources on behalf of a user.
 OAuth2Operations 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

AbstractOAuth2ServiceProvider

public AbstractOAuth2ServiceProvider(OAuth2Operations oauth2Operations)
Create a new OAuth2ServiceProvider.

Parameters:
oauth2Operations - the OAuth2Operations template for conducting the OAuth 2 flow with the provider.
Method Detail

getOAuthOperations

public final OAuth2Operations getOAuthOperations()
Description copied from interface: OAuth2ServiceProvider
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 OAuth2ServiceProvider<S>

getApi

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

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

Spring Social