Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.oauth.consumers
Class OAuthConsumerRegistryImpl

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.platform.oauth.consumers.OAuthConsumerRegistryImpl
All Implemented Interfaces:
OAuthConsumerRegistry, Adaptable, Component, Extensible

public class OAuthConsumerRegistryImpl
extends DefaultComponent
implements OAuthConsumerRegistry

Implementation of the OAuthConsumerRegistry Service. It's basically a simple Storage API on top of an SQL Directory.

Author:
tiry

Field Summary
static String DIRECTORY_NAME
           
 
Constructor Summary
OAuthConsumerRegistryImpl()
           
 
Method Summary
 void deleteConsumer(String consumerKey)
          remove a Consumer
 NuxeoOAuthConsumer getConsumer(String consumerKey)
          Get a Consumer from its consumerKey.
 NuxeoOAuthConsumer getConsumer(String consumerKey, String keyType)
          Get a Consumer from its consumerKey.
 List<NuxeoOAuthConsumer> listConsumers()
          List all registered Consumers
 NuxeoOAuthConsumer storeConsumer(NuxeoOAuthConsumer consumer)
          Store a new Consumer
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, applicationStarted, deactivate, getAdapter, registerContribution, registerExtension, unregisterContribution, unregisterExtension
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTORY_NAME

public static final String DIRECTORY_NAME
See Also:
Constant Field Values
Constructor Detail

OAuthConsumerRegistryImpl

public OAuthConsumerRegistryImpl()
Method Detail

getConsumer

public NuxeoOAuthConsumer getConsumer(String consumerKey,
                                      String keyType)
Description copied from interface: OAuthConsumerRegistry
Get a Consumer from its consumerKey.

The keyType param indicates if we need HMAC or RSA secret. This is needed because the default OAuthValidator implementation only uses 1 field for both Keys. If keyType is OAUth.RSA_SHA1, the consumerSecret field will be polupated with the RSA public key rather than the HMAC secret.

Specified by:
getConsumer in interface OAuthConsumerRegistry

getConsumer

public NuxeoOAuthConsumer getConsumer(String consumerKey)
Description copied from interface: OAuthConsumerRegistry
Get a Consumer from its consumerKey.

Specified by:
getConsumer in interface OAuthConsumerRegistry

storeConsumer

public NuxeoOAuthConsumer storeConsumer(NuxeoOAuthConsumer consumer)
                                 throws Exception
Description copied from interface: OAuthConsumerRegistry
Store a new Consumer

Specified by:
storeConsumer in interface OAuthConsumerRegistry
Throws:
Exception

deleteConsumer

public void deleteConsumer(String consumerKey)
Description copied from interface: OAuthConsumerRegistry
remove a Consumer

Specified by:
deleteConsumer in interface OAuthConsumerRegistry

listConsumers

public List<NuxeoOAuthConsumer> listConsumers()
Description copied from interface: OAuthConsumerRegistry
List all registered Consumers

Specified by:
listConsumers in interface OAuthConsumerRegistry

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.