Interface ServiceProviderConsumerStore
- 
- All Known Implementing Classes:
 PersistentServiceProviderConsumerStore
public interface ServiceProviderConsumerStoreProvides 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 voidadd(Consumer consumer)Add the consumer to the store.voiddelete(String key)Deletes a consumer whosekeyis equal to the givenkeyOptional<Consumer>get(String key)Iterable<Consumer>getAll()Retrieve all theconsumersfrom the store.voidupdate(Consumer consumer)Updates an existing consumer. 
 - 
 
- 
- 
Method Detail
- 
add
void add(Consumer consumer)
Add the consumer to the store.- Parameters:
 consumer- theconsumerto be added, cannot be null- Throws:
 StoreException- if aconsumerwith the samekeyalready existsNullPointerException- if the givenconsumerisnull
 
- 
get
Optional<Consumer> get(String key)
Retrieve aconsumerfrom the store whosekeyattribute is equal to thekeyparameter, oremptyif such aconsumerdoesn't exist- Parameters:
 key- theconsumer key- Returns:
 Consumerwhosekeyis equal to the givenkey, oremptyif such aconsumerdoesn't exist- Throws:
 NullPointerException- if the givenkeyisnull
 
- 
getAll
Iterable<Consumer> getAll()
Retrieve all theconsumersfrom the store.- Returns:
 - all the 
consumersfrom the store - Throws:
 StoreException- if there is a problem retrieving one or more of theconsumers
 
- 
delete
void delete(String key)
Deletes a consumer whosekeyis equal to the givenkey- Parameters:
 key- thekeyof theconsumerto be deleted- Throws:
 NullPointerException- if the givenkeyisnull
 
- 
update
void update(Consumer consumer)
Updates an existing consumer.- Parameters:
 consumer- the consumer to update- Throws:
 StoreException- if aconsumerwith thekeydoes not exists
 
 - 
 
 -