Class OAuthServiceProviderRegistryImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.platform.oauth.providers.OAuthServiceProviderRegistryImpl
-
- All Implemented Interfaces:
OAuthServiceProviderRegistry
,Adaptable
,Component
,Extensible
,TimestampedService
public class OAuthServiceProviderRegistryImpl extends DefaultComponent implements OAuthServiceProviderRegistry
Implementation of theOAuthServiceProviderRegistry
. The main storage backend is a SQL Directory. Readonly providers (contributed directly at OpenSocialService level) are managed in memory.- Author:
- tiry
-
-
Field Summary
Fields Modifier and Type Field Description static String
DIRECTORY_NAME
protected Map<String,NuxeoOAuthServiceProvider>
inMemoryProviders
protected static Log
log
protected static Random
RANDOM
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description OAuthServiceProviderRegistryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NuxeoOAuthServiceProvider
addReadOnlyProvider(String gadgetUri, String serviceName, String consumerKey, String consumerSecret, String publicKey)
This method is here for compatibility reasons.void
deleteProvider(String providerId)
Deletes a provider.void
deleteProvider(String gadgetUri, String serviceName)
Deletes a provider.protected String
getBareGadgetUri(String gadgetUri)
protected DocumentModel
getBestEntry(DocumentModelList entries, String gadgetUri, String serviceName)
protected NuxeoOAuthServiceProvider
getEntry(String gadgetUri, String serviceName, Set<String> ftFilter)
NuxeoOAuthServiceProvider
getProvider(String gadgetUri, String serviceName)
Select the best provider given.List<NuxeoOAuthServiceProvider>
listProviders()
Return the list of all know providers (both readonly and editable ones).protected String
mkStringIdx(String gadgetUri, String serviceName)
protected String
preProcessServiceName(String serviceName)
-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
log
protected static final Log log
-
DIRECTORY_NAME
public static final String DIRECTORY_NAME
- See Also:
- Constant Field Values
-
RANDOM
protected static final Random RANDOM
-
inMemoryProviders
protected Map<String,NuxeoOAuthServiceProvider> inMemoryProviders
-
-
Method Detail
-
getProvider
public NuxeoOAuthServiceProvider getProvider(String gadgetUri, String serviceName)
Description copied from interface:OAuthServiceProviderRegistry
Select the best provider given.- Specified by:
getProvider
in interfaceOAuthServiceProviderRegistry
- Parameters:
gadgetUri
- the gadget url (or AppId)serviceName
- the service name as defined in MakeRequest
-
getBestEntry
protected DocumentModel getBestEntry(DocumentModelList entries, String gadgetUri, String serviceName) throws PropertyException
- Throws:
PropertyException
-
getEntry
protected NuxeoOAuthServiceProvider getEntry(String gadgetUri, String serviceName, Set<String> ftFilter)
-
addReadOnlyProvider
public NuxeoOAuthServiceProvider addReadOnlyProvider(String gadgetUri, String serviceName, String consumerKey, String consumerSecret, String publicKey)
Description copied from interface:OAuthServiceProviderRegistry
This method is here for compatibility reasons. Providers that are directly contributed to the OpenSocialService are forwarded to the new centralized service.- Specified by:
addReadOnlyProvider
in interfaceOAuthServiceProviderRegistry
-
deleteProvider
public void deleteProvider(String gadgetUri, String serviceName)
Description copied from interface:OAuthServiceProviderRegistry
Deletes a provider.- Specified by:
deleteProvider
in interfaceOAuthServiceProviderRegistry
-
deleteProvider
public void deleteProvider(String providerId)
Description copied from interface:OAuthServiceProviderRegistry
Deletes a provider.- Specified by:
deleteProvider
in interfaceOAuthServiceProviderRegistry
-
listProviders
public List<NuxeoOAuthServiceProvider> listProviders()
Description copied from interface:OAuthServiceProviderRegistry
Return the list of all know providers (both readonly and editable ones).- Specified by:
listProviders
in interfaceOAuthServiceProviderRegistry
-
-