Class PersistentServiceProviderConsumerStore
- java.lang.Object
-
- com.atlassian.bitbucket.jenkins.internal.applink.oauth.serviceprovider.AbstractPersistentStore<Consumer>
-
- com.atlassian.bitbucket.jenkins.internal.applink.oauth.serviceprovider.consumer.PersistentServiceProviderConsumerStore
-
- All Implemented Interfaces:
ServiceProviderConsumerStore
,Saveable
,OnMaster
@Singleton public class PersistentServiceProviderConsumerStore extends AbstractPersistentStore<Consumer> implements ServiceProviderConsumerStore
AServiceProviderConsumerStore
implementation that persists theconsumers
to an XML fileOnly one instance of this class must be created per Jenkins instance.
-
-
Field Summary
-
Fields inherited from class com.atlassian.bitbucket.jenkins.internal.applink.oauth.serviceprovider.AbstractPersistentStore
entityMap, xStream
-
-
Constructor Summary
Constructors Constructor Description PersistentServiceProviderConsumerStore()
-
Method Summary
All Methods Instance Methods Concrete 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.protected Class<Consumer>
getEntityClass()
protected String
getStoreEntryName()
protected String
getStoreKeyName()
protected String
getStoreValueName()
void
update(Consumer consumer)
Updates an existing consumer.-
Methods inherited from class com.atlassian.bitbucket.jenkins.internal.applink.oauth.serviceprovider.AbstractPersistentStore
decrypt, encrypt, getConfigFile, load, save
-
-
-
-
Method Detail
-
add
public void add(Consumer consumer)
Description copied from interface:ServiceProviderConsumerStore
Add the consumer to the store.- Specified by:
add
in interfaceServiceProviderConsumerStore
- Parameters:
consumer
- theconsumer
to be added, cannot be null
-
get
public Optional<Consumer> get(String key)
Description copied from interface:ServiceProviderConsumerStore
Retrieve aconsumer
from the store whosekey
attribute is equal to thekey
parameter, orempty
if such aconsumer
doesn't exist- Specified by:
get
in interfaceServiceProviderConsumerStore
- Parameters:
key
- theconsumer key
- Returns:
Consumer
whosekey
is equal to the givenkey
, orempty
if such aconsumer
doesn't exist
-
getAll
public Iterable<Consumer> getAll()
Description copied from interface:ServiceProviderConsumerStore
Retrieve all theconsumers
from the store.- Specified by:
getAll
in interfaceServiceProviderConsumerStore
- Returns:
- all the
consumers
from the store
-
delete
public void delete(String key)
Description copied from interface:ServiceProviderConsumerStore
Deletes a consumer whosekey
is equal to the givenkey
- Specified by:
delete
in interfaceServiceProviderConsumerStore
- Parameters:
key
- thekey
of theconsumer
to be deleted
-
update
public void update(Consumer consumer)
Description copied from interface:ServiceProviderConsumerStore
Updates an existing consumer.- Specified by:
update
in interfaceServiceProviderConsumerStore
- Parameters:
consumer
- the consumer to update
-
getEntityClass
protected Class<Consumer> getEntityClass()
- Specified by:
getEntityClass
in classAbstractPersistentStore<Consumer>
-
getStoreEntryName
protected String getStoreEntryName()
- Specified by:
getStoreEntryName
in classAbstractPersistentStore<Consumer>
-
getStoreKeyName
protected String getStoreKeyName()
- Specified by:
getStoreKeyName
in classAbstractPersistentStore<Consumer>
-
getStoreValueName
protected String getStoreValueName()
- Specified by:
getStoreValueName
in classAbstractPersistentStore<Consumer>
-
-