com.atlassian.crowd.horde.license
Class LicenseMonitorServiceImpl

java.lang.Object
  extended by com.atlassian.crowd.horde.license.LicenseMonitorServiceImpl
All Implemented Interfaces:
LicenseMonitorService

public class LicenseMonitorServiceImpl
extends Object
implements LicenseMonitorService

The purpose of this service is to monitor the License File in OnDemand to watch for changes.


Constructor Summary
LicenseMonitorServiceImpl()
           
 
Method Summary
 void forceNotification()
          Force all the listeners to be notified of the last license change event.
 com.google.common.base.Optional<LicenseChangedEvent> getLastChangedEvent()
          Gets the last license changed event that was sent.
 void registerListener(LicenseChangeListener licenseChangeListener)
          Add a listener to be notified of changes to the license.
 void setListeners(List<LicenseChangeListener> listeners)
           
 void startMonitoring()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LicenseMonitorServiceImpl

public LicenseMonitorServiceImpl()
Method Detail

startMonitoring

public void startMonitoring()

setListeners

public void setListeners(List<LicenseChangeListener> listeners)

getLastChangedEvent

public com.google.common.base.Optional<LicenseChangedEvent> getLastChangedEvent()
Description copied from interface: LicenseMonitorService
Gets the last license changed event that was sent. It is possible that the license has never been successfully read by this point in time so please take that into account.

Specified by:
getLastChangedEvent in interface LicenseMonitorService
Returns:
A license changed event that was the last read (or absent if there were problems reading the license).

registerListener

public void registerListener(LicenseChangeListener licenseChangeListener)
Description copied from interface: LicenseMonitorService
Add a listener to be notified of changes to the license.

Important: Upon being added to this service the listener will be informed of the very last successful LicenseChangedEvent. Your listener should be able to handle that correctly.

Specified by:
registerListener in interface LicenseMonitorService
Parameters:
licenseChangeListener - An implementation of the listener interface. It will be called upon license change though there may be a delay.

forceNotification

public void forceNotification()
Description copied from interface: LicenseMonitorService
Force all the listeners to be notified of the last license change event.

Specified by:
forceNotification in interface LicenseMonitorService


Copyright © 2013 Atlassian. All Rights Reserved.