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 StringDIRECTORY_NAMEprotected Map<String,NuxeoOAuthServiceProvider>inMemoryProvidersprotected static Loglogprotected static RandomRANDOM-
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 NuxeoOAuthServiceProvideraddReadOnlyProvider(String gadgetUri, String serviceName, String consumerKey, String consumerSecret, String publicKey)This method is here for compatibility reasons.voiddeleteProvider(String providerId)Deletes a provider.voiddeleteProvider(String gadgetUri, String serviceName)Deletes a provider.protected StringgetBareGadgetUri(String gadgetUri)protected DocumentModelgetBestEntry(DocumentModelList entries, String gadgetUri, String serviceName)protected NuxeoOAuthServiceProvidergetEntry(String gadgetUri, String serviceName, Set<String> ftFilter)NuxeoOAuthServiceProvidergetProvider(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 StringmkStringIdx(String gadgetUri, String serviceName)protected StringpreProcessServiceName(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:OAuthServiceProviderRegistrySelect the best provider given.- Specified by:
getProviderin 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:OAuthServiceProviderRegistryThis method is here for compatibility reasons. Providers that are directly contributed to the OpenSocialService are forwarded to the new centralized service.- Specified by:
addReadOnlyProviderin interfaceOAuthServiceProviderRegistry
-
deleteProvider
public void deleteProvider(String gadgetUri, String serviceName)
Description copied from interface:OAuthServiceProviderRegistryDeletes a provider.- Specified by:
deleteProviderin interfaceOAuthServiceProviderRegistry
-
deleteProvider
public void deleteProvider(String providerId)
Description copied from interface:OAuthServiceProviderRegistryDeletes a provider.- Specified by:
deleteProviderin interfaceOAuthServiceProviderRegistry
-
listProviders
public List<NuxeoOAuthServiceProvider> listProviders()
Description copied from interface:OAuthServiceProviderRegistryReturn the list of all know providers (both readonly and editable ones).- Specified by:
listProvidersin interfaceOAuthServiceProviderRegistry
-
-