com.atlassian.jira.license
Class MultiLicenseStoreImpl

java.lang.Object
  extended by com.atlassian.jira.license.MultiLicenseStoreImpl
All Implemented Interfaces:
MultiLicenseStore

public class MultiLicenseStoreImpl
extends Object
implements MultiLicenseStore

Since:
v6.3

Constructor Summary
MultiLicenseStoreImpl(EntityEngine entityEngine, JiraLicenseStore jiraLicenseStore, FeatureManager featureManager)
           
 
Method Summary
 Iterable<String> retrieve()
          Retrieves all product license strings.
 String retrieveServerId()
          Gets the server ID from the persistence backend
 void store(Iterable<String> newLicenseKeys)
          Persists a new state for all licenses.
 void storeServerId(String serverId)
          Stores the server ID to the persistent backend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiLicenseStoreImpl

public MultiLicenseStoreImpl(EntityEngine entityEngine,
                             JiraLicenseStore jiraLicenseStore,
                             FeatureManager featureManager)
Method Detail

retrieve

@Nonnull
public Iterable<String> retrieve()
Description copied from interface: MultiLicenseStore
Retrieves all product license strings. The returned Iterable is immutable and is ordered by the ID in the database. The returned Iterable is not null and does not contain null elements. The absence of a license is indicated by an empty list.

Specified by:
retrieve in interface MultiLicenseStore
Returns:
all current license strings from persistence

store

public void store(@Nonnull
                  Iterable<String> newLicenseKeys)
Description copied from interface: MultiLicenseStore
Persists a new state for all licenses. This will overwrite all licenses currently stored.

This method will do some cursory checking of inputs but will still store most invalid licenses if requested. The caller should test licenses strings for validity before attempting to store them. This method may throw an unspecified runtime exception if the argument is invalid, for example if it is null, empty, or contains a null element.

Until the license roles dark feature is enabled, MultiLicenseStores may operate in legacy mode. In legacy mode a single license is arbitrarily chosen and stored in the backing legacy license store, typically as an ApplicationProperties property. It is the caller's responsibility to ensure that no more than one license is attempted to be stored when in legacy mode.

Specified by:
store in interface MultiLicenseStore
Parameters:
newLicenseKeys - the license strings to store

retrieveServerId

public String retrieveServerId()
Description copied from interface: MultiLicenseStore
Gets the server ID from the persistence backend

Specified by:
retrieveServerId in interface MultiLicenseStore
Returns:
the server ID, null if not found

storeServerId

public void storeServerId(String serverId)
Description copied from interface: MultiLicenseStore
Stores the server ID to the persistent backend

Specified by:
storeServerId in interface MultiLicenseStore
Parameters:
serverId - the server ID to store


Copyright © 2002-2014 Atlassian. All Rights Reserved.