Spring Social

org.springframework.social.connect
Interface ConnectionFactoryLocator

All Known Implementing Classes:
ConnectionFactoryRegistry

public interface ConnectionFactoryLocator

A ServiceLocator for ConnectionFactory instances. Supports lookup by providerId and by apiType.

Author:
Keith Donald
See Also:
ConnectionFactory

Method Summary
<A> ConnectionFactory<A>
getConnectionFactory(java.lang.Class<A> apiType)
          Lookup a ConnectionFactory by apiType; for example, FacebookApi.class.
 ConnectionFactory<?> getConnectionFactory(java.lang.String providerId)
          Lookup a ConnectionFactory by providerId; for example, "facebook".
 java.util.Set<java.lang.String> registeredProviderIds()
          Returns the set of providerIds for which a ConnectionFactory is registered; for example, { "twitter", "facebook", "foursquare" } Elements in this set can be passed to getConnectionFactory(String) to fetch a specific factory instance.
 

Method Detail

getConnectionFactory

ConnectionFactory<?> getConnectionFactory(java.lang.String providerId)
Lookup a ConnectionFactory by providerId; for example, "facebook". The returned factory can be used to create connections to the provider. Used to support connection creation in a dynamic manner across the set of registered providers.


getConnectionFactory

<A> ConnectionFactory<A> getConnectionFactory(java.lang.Class<A> apiType)
Lookup a ConnectionFactory by apiType; for example, FacebookApi.class. The returned factory can be used to create connections to the provider. Primarily used in support of connection restoration requested by application code.

See Also:
ConnectionRepository.getPrimaryConnection(Class)

registeredProviderIds

java.util.Set<java.lang.String> registeredProviderIds()
Returns the set of providerIds for which a ConnectionFactory is registered; for example, { "twitter", "facebook", "foursquare" } Elements in this set can be passed to getConnectionFactory(String) to fetch a specific factory instance.


Spring Social