Interface ConsumerStore
- All Known Implementing Classes:
AbstractConsumerStore
,FileSystemConsumerStore
,RdfConsumerStore
public interface ConsumerStore
Manages persistence of OAuth consumers.
- Author:
- Samuel Padgett
-
Method Summary
Modifier and TypeMethodDescriptionaddConsumer
(LyoOAuthConsumer consumer) Adds a new consumer.void
Closes the consumer store.Gets all OAuth consumers.getConsumer
(String consumerKey) Gets the consumer for a key.getConsumer
(net.oauth.OAuthMessage requestMessage) Gets the consumer for this message.removeConsumer
(String consumerKey) Removes a consumer.updateConsumer
(LyoOAuthConsumer consumer) Updates a consumer.
-
Method Details
-
getConsumer
LyoOAuthConsumer getConsumer(net.oauth.OAuthMessage requestMessage) throws net.oauth.OAuthException, IOException, ConsumerStoreException Gets the consumer for this message.- Parameters:
requestMessage
- the OAuth message- Returns:
- the consumer
- Throws:
net.oauth.OAuthException
- if the OAuth message does not contain a consumer keyIOException
- on errors reading the messageConsumerStoreException
- on other errors
-
getAllConsumers
Gets all OAuth consumers.- Returns:
- all OAuth consumers, provisional and approved
- Throws:
ConsumerStoreException
- on errors
-
getConsumer
Gets the consumer for a key.- Parameters:
consumerKey
- the consumer key- Returns:
- the consumer or null if there is no consumer for this key
- Throws:
ConsumerStoreException
- on errors
-
addConsumer
Adds a new consumer.- Parameters:
consumer
- the consumer- Returns:
- the previous consumer associated with this key or null if there wasn't one
- Throws:
ConsumerStoreException
-
removeConsumer
Removes a consumer.- Returns:
- the removed consumer or null if it wasn't previously in the store
- Throws:
ConsumerStoreException
- on errors
-
updateConsumer
Updates a consumer.- Parameters:
consumer
- the consumer- Returns:
- the same consumer or null if it wasn't previously in the store
- Throws:
ConsumerStoreException
- on errors
-
closeConsumerStore
void closeConsumerStore()Closes the consumer store. It is unavailable for further use.
-