com.atlassian.gadgets.renderer.internal.cache
Class ApplicationEventListener

java.lang.Object
  extended by com.atlassian.gadgets.renderer.internal.cache.ApplicationEventListener
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean

public class ApplicationEventListener
extends Object
implements org.springframework.beans.factory.InitializingBean

Applinks aware event listener that clears shindig's cache whenever an applink is registered or deleted.

Since:
v3.0

Constructor Summary
ApplicationEventListener(com.atlassian.event.api.EventPublisher eventPublisher, ClearableCacheProvider cacheProvider)
          Creates a new ApplicationEventListener.
 
Method Summary
 void afterPropertiesSet()
          Registers this event listener in the event publisher.
 void onClearCache(ClearHttpCacheEvent clearShindigCacheEvent)
          When the host applicaiton fires a clear shindig cache event this cache should be cleared!
 void onCreate(com.atlassian.applinks.api.event.ApplicationLinkAddedEvent applicationLinkEvent)
          Clears shindig's cache when a new applink has been created in UAL.
 void onDelete(com.atlassian.applinks.api.event.ApplicationLinkDeletedEvent applicationLinkEvent)
          Clears shindig's cache when an applink has been deleted in UAL.
 void onUpdateId(com.atlassian.applinks.api.event.ApplicationLinksIDChangedEvent applicationLinkEvent)
          Clears shindig's cache when an applink id has been modified in UAL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationEventListener

public ApplicationEventListener(com.atlassian.event.api.EventPublisher eventPublisher,
                                ClearableCacheProvider cacheProvider)
Creates a new ApplicationEventListener.

Parameters:
eventPublisher - an EventPublisher
cacheProvider - a cachprovider that can have its cache cleared.
Method Detail

onClearCache

@EventListener
public void onClearCache(ClearHttpCacheEvent clearShindigCacheEvent)
When the host applicaiton fires a clear shindig cache event this cache should be cleared!

Parameters:
clearShindigCacheEvent - a clear cache event

onCreate

@EventListener
public void onCreate(com.atlassian.applinks.api.event.ApplicationLinkAddedEvent applicationLinkEvent)
Clears shindig's cache when a new applink has been created in UAL.

Parameters:
applicationLinkEvent - a ApplicationLinkAddedEvent

onDelete

@EventListener
public void onDelete(com.atlassian.applinks.api.event.ApplicationLinkDeletedEvent applicationLinkEvent)
Clears shindig's cache when an applink has been deleted in UAL.

Parameters:
applicationLinkEvent - a ApplicationLinkDeletedEvent

onUpdateId

@EventListener
public void onUpdateId(com.atlassian.applinks.api.event.ApplicationLinksIDChangedEvent applicationLinkEvent)
Clears shindig's cache when an applink id has been modified in UAL.

Parameters:
applicationLinkEvent - an ApplicationLinksIDChangedEvent

afterPropertiesSet

public void afterPropertiesSet()
Registers this event listener in the event publisher.

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean


Copyright © 2014 Atlassian. All Rights Reserved.