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 the
OAuthServiceProviderRegistry
. The main storage backend is a SQL Directory. Readonly
providers (contributed directly at OpenSocialService level) are managed in memory.- Author:
- tiry
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected Map<String,
NuxeoOAuthServiceProvider> protected static final Random
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddReadOnlyProvider
(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
getProvider
(String gadgetUri, String serviceName) Select the best provider given.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
getApplicationStartedOrder
-
Field Details
-
DIRECTORY_NAME
- See Also:
-
RANDOM
-
inMemoryProviders
-
-
Constructor Details
-
OAuthServiceProviderRegistryImpl
public OAuthServiceProviderRegistryImpl()
-
-
Method Details
-
getProvider
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
-
getBareGadgetUri
-
preProcessServiceName
-
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) -
mkStringIdx
-
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
Description copied from interface:OAuthServiceProviderRegistry
Deletes a provider.- Specified by:
deleteProvider
in interfaceOAuthServiceProviderRegistry
-
deleteProvider
Description copied from interface:OAuthServiceProviderRegistry
Deletes a provider.- Specified by:
deleteProvider
in interfaceOAuthServiceProviderRegistry
-
listProviders
Description copied from interface:OAuthServiceProviderRegistry
Return the list of all know providers (both readonly and editable ones).- Specified by:
listProviders
in interfaceOAuthServiceProviderRegistry
-