org.brickred.socialauth
Class AbstractProvider

java.lang.Object
  extended by org.brickred.socialauth.AbstractProvider
All Implemented Interfaces:
Serializable, AuthProvider
Direct Known Subclasses:
AolImpl, FacebookImpl, FourSquareImpl, GenericOAuth1Provider, GenericOAuth2Provider, GoogleImpl, HotmailImpl, LinkedInImpl, MendeleyImpl, MySpaceImpl, OpenIdImpl, RunkeeperImpl, SalesForceImpl, TwitterImpl, YahooImpl, YammerImpl

public abstract class AbstractProvider
extends Object
implements AuthProvider, Serializable

It implements AuthProvider interface and provides some methods for registering and getting plugins.

Author:
tarunn@brickred.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.brickred.socialauth.AuthProvider
COUNTRY, DOB, EMAIL, EXT_NAMESPACE, FIRST_NAME, FULL_NAME, GENDER, LANGUAGE, LAST_NAME, NICK_NAME, POSTCODE
 
Constructor Summary
AbstractProvider()
           
 
Method Summary
protected abstract  OAuthStrategyBase getOauthStrategy()
          Returns the OAuthStrategyBase of a provider.
<T> T
getPlugin(Class<T> clazz)
           
protected abstract  List<String> getPluginsList()
          Returns the list of plugins of a provider.
 String getPluginsScope(OAuthConfig oauthConfig)
          Returns the scopes of custom plugins of a provider those are configured in properties file
 boolean isSupportedPlugin(Class<? extends Plugin> clazz)
           
 void registerPlugins()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.brickred.socialauth.AuthProvider
api, getAccessGrant, getContactList, getLoginRedirectURL, getProviderId, getUserProfile, logout, setAccessGrant, setPermission, updateStatus, uploadImage, verifyResponse
 

Constructor Detail

AbstractProvider

public AbstractProvider()
                 throws Exception
Throws:
Exception
Method Detail

getPlugin

public <T> T getPlugin(Class<T> clazz)
            throws Exception
Specified by:
getPlugin in interface AuthProvider
Throws:
Exception

isSupportedPlugin

public boolean isSupportedPlugin(Class<? extends Plugin> clazz)
Specified by:
isSupportedPlugin in interface AuthProvider

registerPlugins

public final void registerPlugins()
                           throws Exception
Specified by:
registerPlugins in interface AuthProvider
Throws:
Exception

getPluginsScope

public String getPluginsScope(OAuthConfig oauthConfig)
Returns the scopes of custom plugins of a provider those are configured in properties file

Parameters:
oauthConfig - OAuthConfig object of that provider
Returns:
String of comma separated scopes of all register plugins of a provider those are configured in properties file

getPluginsList

protected abstract List<String> getPluginsList()
Returns the list of plugins of a provider.

Returns:
List of plugins of a provider

getOauthStrategy

protected abstract OAuthStrategyBase getOauthStrategy()
Returns the OAuthStrategyBase of a provider.

Returns:
OAuthStrategyBase of a provider.


Copyright © 2013. All Rights Reserved.