com.atlassian.jira.oauth.consumer
Class CachingConsumerStore

java.lang.Object
  extended by com.atlassian.jira.oauth.consumer.CachingConsumerStore
All Implemented Interfaces:
com.atlassian.oauth.consumer.core.ConsumerServiceStore, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class CachingConsumerStore
extends Object
implements com.atlassian.oauth.consumer.core.ConsumerServiceStore, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

Provides a caching consumer store implementation. Note that in general on the consumer side there's really only one consumer (the instance 'itself'). But there's the ability for administrators to add additional consumer service information because sites like Netflix and TripIt assign developers the consumer key and consumer secret that they should use when communicating with the site. So to make it possible to write gadgets for these services, we need a way to add that consumer information and have a gadget pick that consumer information to use.

Since:
v4.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.oauth.consumer.core.ConsumerServiceStore
com.atlassian.oauth.consumer.core.ConsumerServiceStore.ConsumerAndSecret
 
Constructor Summary
CachingConsumerStore(com.atlassian.oauth.consumer.core.ConsumerServiceStore delegateStore, com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.cache.CacheManager cacheManager)
           
 
Method Summary
 void afterPropertiesSet()
           
 void clearCaches(ClearCacheEvent event)
           
 void destroy()
           
 com.atlassian.oauth.consumer.core.ConsumerServiceStore.ConsumerAndSecret get(String service)
           
 Iterable<com.atlassian.oauth.Consumer> getAllServiceProviders()
           
 com.atlassian.oauth.consumer.core.ConsumerServiceStore.ConsumerAndSecret getByKey(String key)
           
 void put(String service, com.atlassian.oauth.consumer.core.ConsumerServiceStore.ConsumerAndSecret cas)
           
 void removeByKey(String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingConsumerStore

public CachingConsumerStore(com.atlassian.oauth.consumer.core.ConsumerServiceStore delegateStore,
                            com.atlassian.event.api.EventPublisher eventPublisher,
                            com.atlassian.cache.CacheManager cacheManager)
Method Detail

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

clearCaches

@EventListener
public void clearCaches(ClearCacheEvent event)

get

public com.atlassian.oauth.consumer.core.ConsumerServiceStore.ConsumerAndSecret get(String service)
Specified by:
get in interface com.atlassian.oauth.consumer.core.ConsumerServiceStore

getByKey

public com.atlassian.oauth.consumer.core.ConsumerServiceStore.ConsumerAndSecret getByKey(String key)
Specified by:
getByKey in interface com.atlassian.oauth.consumer.core.ConsumerServiceStore

put

public void put(String service,
                com.atlassian.oauth.consumer.core.ConsumerServiceStore.ConsumerAndSecret cas)
Specified by:
put in interface com.atlassian.oauth.consumer.core.ConsumerServiceStore

removeByKey

public void removeByKey(String key)
Specified by:
removeByKey in interface com.atlassian.oauth.consumer.core.ConsumerServiceStore

getAllServiceProviders

public Iterable<com.atlassian.oauth.Consumer> getAllServiceProviders()
Specified by:
getAllServiceProviders in interface com.atlassian.oauth.consumer.core.ConsumerServiceStore


Copyright © 2002-2014 Atlassian. All Rights Reserved.