Class ConfigAwareConnectionFactoryLocator
- java.lang.Object
-
- org.craftercms.engine.util.spring.social.ConfigAwareConnectionFactoryLocator
-
- All Implemented Interfaces:
org.springframework.social.connect.ConnectionFactoryLocator
public class ConfigAwareConnectionFactoryLocator extends Object implements org.springframework.social.connect.ConnectionFactoryLocator
ConnectionFactoryLocator
that resolvesConnectionFactory
s according to the current site. Basically, each site has it's own connection registry, which is used to find the correspondingConnectionFactory
for the site. The registry is created from the site configuration. If there's no site configuration for connections, the default locator is used.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description protected org.craftercms.core.util.cache.CacheTemplate
cacheTemplate
protected List<ConfigurationParser<?>>
configParsers
static String
CONNECTION_FACTORY_LOCATOR_CACHE_KEY
protected org.springframework.social.connect.ConnectionFactoryLocator
defaultLocator
static String
SOCIAL_CONNECTIONS_KEY
-
Constructor Summary
Constructors Constructor Description ConfigAwareConnectionFactoryLocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A> org.springframework.social.connect.ConnectionFactory<A>
getConnectionFactory(Class<A> apiType)
org.springframework.social.connect.ConnectionFactory<?>
getConnectionFactory(String providerId)
protected org.springframework.social.connect.ConnectionFactoryLocator
getCurrentConnectionFactoryLocator()
Set<String>
registeredProviderIds()
void
setCacheTemplate(org.craftercms.core.util.cache.CacheTemplate cacheTemplate)
void
setConfigParsers(List<ConfigurationParser<?>> configParsers)
void
setDefaultLocator(org.springframework.social.connect.ConnectionFactoryLocator defaultLocator)
-
-
-
Field Detail
-
SOCIAL_CONNECTIONS_KEY
public static final String SOCIAL_CONNECTIONS_KEY
- See Also:
- Constant Field Values
-
CONNECTION_FACTORY_LOCATOR_CACHE_KEY
public static final String CONNECTION_FACTORY_LOCATOR_CACHE_KEY
- See Also:
- Constant Field Values
-
defaultLocator
protected org.springframework.social.connect.ConnectionFactoryLocator defaultLocator
-
cacheTemplate
protected org.craftercms.core.util.cache.CacheTemplate cacheTemplate
-
configParsers
protected List<ConfigurationParser<?>> configParsers
-
-
Method Detail
-
setDefaultLocator
public void setDefaultLocator(org.springframework.social.connect.ConnectionFactoryLocator defaultLocator)
-
setCacheTemplate
public void setCacheTemplate(org.craftercms.core.util.cache.CacheTemplate cacheTemplate)
-
setConfigParsers
public void setConfigParsers(List<ConfigurationParser<?>> configParsers)
-
getConnectionFactory
public org.springframework.social.connect.ConnectionFactory<?> getConnectionFactory(String providerId)
- Specified by:
getConnectionFactory
in interfaceorg.springframework.social.connect.ConnectionFactoryLocator
-
getConnectionFactory
public <A> org.springframework.social.connect.ConnectionFactory<A> getConnectionFactory(Class<A> apiType)
- Specified by:
getConnectionFactory
in interfaceorg.springframework.social.connect.ConnectionFactoryLocator
-
registeredProviderIds
public Set<String> registeredProviderIds()
- Specified by:
registeredProviderIds
in interfaceorg.springframework.social.connect.ConnectionFactoryLocator
-
getCurrentConnectionFactoryLocator
protected org.springframework.social.connect.ConnectionFactoryLocator getCurrentConnectionFactoryLocator()
-
-