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 resolves
ConnectionFactorys according to the current site. Basically, each site
has it's own connection registry, which is used to find the corresponding ConnectionFactory 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
FieldsModifier and TypeFieldDescriptionprotected org.craftercms.core.util.cache.CacheTemplateprotected List<ConfigurationParser<?>>static final Stringprotected org.springframework.social.connect.ConnectionFactoryLocatorstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<A> org.springframework.social.connect.ConnectionFactory<A>getConnectionFactory(Class<A> apiType) org.springframework.social.connect.ConnectionFactory<?>getConnectionFactory(String providerId) protected org.springframework.social.connect.ConnectionFactoryLocatorvoidsetCacheTemplate(org.craftercms.core.util.cache.CacheTemplate cacheTemplate) voidsetConfigParsers(List<ConfigurationParser<?>> configParsers) voidsetDefaultLocator(org.springframework.social.connect.ConnectionFactoryLocator defaultLocator)
-
Field Details
-
SOCIAL_CONNECTIONS_KEY
- See Also:
-
CONNECTION_FACTORY_LOCATOR_CACHE_KEY
- See Also:
-
defaultLocator
protected org.springframework.social.connect.ConnectionFactoryLocator defaultLocator -
cacheTemplate
protected org.craftercms.core.util.cache.CacheTemplate cacheTemplate -
configParsers
-
-
Constructor Details
-
ConfigAwareConnectionFactoryLocator
public ConfigAwareConnectionFactoryLocator()
-
-
Method Details
-
setDefaultLocator
public void setDefaultLocator(org.springframework.social.connect.ConnectionFactoryLocator defaultLocator) -
setCacheTemplate
public void setCacheTemplate(org.craftercms.core.util.cache.CacheTemplate cacheTemplate) -
setConfigParsers
-
getConnectionFactory
public org.springframework.social.connect.ConnectionFactory<?> getConnectionFactory(String providerId) - Specified by:
getConnectionFactoryin interfaceorg.springframework.social.connect.ConnectionFactoryLocator
-
getConnectionFactory
public <A> org.springframework.social.connect.ConnectionFactory<A> getConnectionFactory(Class<A> apiType) - Specified by:
getConnectionFactoryin interfaceorg.springframework.social.connect.ConnectionFactoryLocator
-
registeredProviderIds
- Specified by:
registeredProviderIdsin interfaceorg.springframework.social.connect.ConnectionFactoryLocator
-
getCurrentConnectionFactoryLocator
protected org.springframework.social.connect.ConnectionFactoryLocator getCurrentConnectionFactoryLocator()
-