Interface ServiceProviderConsumerStore
-
- All Known Implementing Classes:
PersistentServiceProviderConsumerStore
public interface ServiceProviderConsumerStore
Provides persistent storage for OAuth consumers. The implementation of this store should only concern itself with the immediate task that it is being asked to perform.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(Consumer consumer)
Add the consumer to the store.void
delete(String key)
Deletes a consumer whosekey
is equal to the givenkey
Optional<Consumer>
get(String key)
Iterable<Consumer>
getAll()
Retrieve all theconsumers
from the store.void
update(Consumer consumer)
Updates an existing consumer.
-
-
-
Method Detail
-
add
void add(Consumer consumer)
Add the consumer to the store.- Parameters:
consumer
- theconsumer
to be added, cannot be null- Throws:
StoreException
- if aconsumer
with the samekey
already existsNullPointerException
- if the givenconsumer
isnull
-
get
Optional<Consumer> get(String key)
Retrieve aconsumer
from the store whosekey
attribute is equal to thekey
parameter, orempty
if such aconsumer
doesn't exist- Parameters:
key
- theconsumer key
- Returns:
Consumer
whosekey
is equal to the givenkey
, orempty
if such aconsumer
doesn't exist- Throws:
NullPointerException
- if the givenkey
isnull
-
getAll
Iterable<Consumer> getAll()
Retrieve all theconsumers
from the store.- Returns:
- all the
consumers
from the store - Throws:
StoreException
- if there is a problem retrieving one or more of theconsumers
-
delete
void delete(String key)
Deletes a consumer whosekey
is equal to the givenkey
- Parameters:
key
- thekey
of theconsumer
to be deleted- Throws:
NullPointerException
- if the givenkey
isnull
-
update
void update(Consumer consumer)
Updates an existing consumer.- Parameters:
consumer
- the consumer to update- Throws:
StoreException
- if aconsumer
with thekey
does not exists
-
-