com.atlassian.confluence.license.store
Class ApplicationConfigurationLicenseStore

java.lang.Object
  extended by com.atlassian.confluence.license.store.ApplicationConfigurationLicenseStore
All Implemented Interfaces:
LicenseStore, ConfluenceBootstrapConstants

@ParametersAreNonnullByDefault
public class ApplicationConfigurationLicenseStore
extends java.lang.Object
implements LicenseStore, ConfluenceBootstrapConstants


Field Summary
 
Fields inherited from interface com.atlassian.confluence.setup.ConfluenceBootstrapConstants
ATLASSIAN_LICENSE_KEY, ATTACHMENTS_DIR_PROP, CONFLUENCE_HOME_CONSTANT, CONFLUENCE_LOCAL_HOME_CONSTANT, DEFAULT_LICENSE_REGISTRY_KEY, GLOBAL_PLUGIN_STATE, INSTALLATION_DATE_KEY, LICENSE_HASH_KEY, LICENSE_MESSAGE_KEY, LUCENE_INDEX_DIR_PROP, TEMP_DIR_PROP, WEBAPP_CONTEXT_PATH_KEY
 
Constructor Summary
ApplicationConfigurationLicenseStore(com.atlassian.config.ApplicationConfiguration store, com.atlassian.extras.api.LicenseManager manager)
           
 
Method Summary
 void clearLicenseFromMemory()
          Clears the currently installed from memory, causing it to be re-read from persistent the next time LicenseStore.retrieve() is called.
 void install(java.lang.String licenseString)
          This delegates to ApplicationConfiguration.setProperty(Object, Object) but the underlying code does not call ApplicationConfiguration.save() and is thus only in memory for the time being.
 void installTransiently(java.lang.String licenseString)
          Attempts to install the given license transiently.
 void onRemoteEvent(ClusterEventWrapper wrapper)
           
 com.atlassian.extras.api.AtlassianLicense retrieve()
          Retrieves the currently installed license.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationConfigurationLicenseStore

public ApplicationConfigurationLicenseStore(com.atlassian.config.ApplicationConfiguration store,
                                            com.atlassian.extras.api.LicenseManager manager)
Method Detail

install

public void install(java.lang.String licenseString)
This delegates to ApplicationConfiguration.setProperty(Object, Object) but the underlying code does not call ApplicationConfiguration.save() and is thus only in memory for the time being.

This method does not allow concurrent invocation, thus escaping if one was detected. The reason being is that a concurrent license installation could lead to unexpected behaviour, thus we let the first invocation win and encourage the second one to be re-evaluated before being attempted again.

Specified by:
install in interface LicenseStore
Parameters:
licenseString - the encrypted license
See Also:
LicenseService.validate(String)

installTransiently

public void installTransiently(java.lang.String licenseString)
Description copied from interface: LicenseStore
Attempts to install the given license transiently. It will not publish an event that a new license has been installed. It is provided for testing purposes only.

Specified by:
installTransiently in interface LicenseStore

clearLicenseFromMemory

public void clearLicenseFromMemory()
Description copied from interface: LicenseStore
Clears the currently installed from memory, causing it to be re-read from persistent the next time LicenseStore.retrieve() is called. It is provided for testing purposes only.

Specified by:
clearLicenseFromMemory in interface LicenseStore

retrieve

@Nonnull
public com.atlassian.extras.api.AtlassianLicense retrieve()
Description copied from interface: LicenseStore
Retrieves the currently installed license.

Specified by:
retrieve in interface LicenseStore
Returns:
the currently installed license

onRemoteEvent

@EventListener
public void onRemoteEvent(ClusterEventWrapper wrapper)


Copyright © 2003-2014 Atlassian. All Rights Reserved.