Interface ConsumerStore
-
- All Known Implementing Classes:
AbstractConsumerStore
,FileSystemConsumerStore
,RdfConsumerStore
public interface ConsumerStore
Manages persistence of OAuth consumers.- Author:
- Samuel Padgett
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LyoOAuthConsumer
addConsumer(LyoOAuthConsumer consumer)
Adds a new consumer.void
closeConsumerStore()
Closes the consumer store.Collection<LyoOAuthConsumer>
getAllConsumers()
Gets all OAuth consumers.LyoOAuthConsumer
getConsumer(String consumerKey)
Gets the consumer for a key.LyoOAuthConsumer
getConsumer(net.oauth.OAuthMessage requestMessage)
Gets the consumer for this message.LyoOAuthConsumer
removeConsumer(String consumerKey)
Removes a consumer.LyoOAuthConsumer
updateConsumer(LyoOAuthConsumer consumer)
Updates a consumer.
-
-
-
Method Detail
-
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
Collection<LyoOAuthConsumer> getAllConsumers() throws ConsumerStoreException
Gets all OAuth consumers.- Returns:
- all OAuth consumers, provisional and approved
- Throws:
ConsumerStoreException
- on errors
-
getConsumer
LyoOAuthConsumer getConsumer(String consumerKey) throws ConsumerStoreException
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
LyoOAuthConsumer addConsumer(LyoOAuthConsumer consumer) throws ConsumerStoreException
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
LyoOAuthConsumer removeConsumer(String consumerKey) throws ConsumerStoreException
Removes a consumer.- Returns:
- the removed consumer or null if it wasn't previously in the store
- Throws:
ConsumerStoreException
- on errors
-
updateConsumer
LyoOAuthConsumer updateConsumer(LyoOAuthConsumer consumer) throws ConsumerStoreException
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.
-
-