com.jp.protection.pub.pro.ls
Class BasicLauncherConfigStorage

java.lang.Object
  extended by com.jp.protection.pub.pro.ls.BasicLauncherConfigStorage
All Implemented Interfaces:
LauncherConfigStorage
Direct Known Subclasses:
BasicModifiableLauncherConfigStorage, JarLauncherConfigStorage

public abstract class BasicLauncherConfigStorage
extends java.lang.Object
implements LauncherConfigStorage

Basic implementation of LauncherConfigStorage interface

Since:
3.0

Nested Class Summary
static class BasicLauncherConfigStorage.EntryLicenseReader
          Specific implementation of the License Reader intended to work with the license entry
protected  class BasicLauncherConfigStorage.EntryProtectionLauncher
           
 
Field Summary
protected  dev.util.collections.HashedBoundList fLauncherConfigs
           
(package private)  java.util.Vector fLauncherConfigStorageListeners
           
protected  boolean fModified
           
 
Constructor Summary
BasicLauncherConfigStorage()
           
 
Method Summary
 void addLauncherConfig(ProtectionLauncherConfig aLauncherConfig)
          Adds a launcher configuration into the storage
 void addLauncherConfigStorageListener(LauncherConfigStorageListener l)
          Adds a listener to the listeners list
protected  ProtectionLauncher createLauncher(LicenseStorage.LicenseEntry anEntry, ProtectionLauncherConfig aLauncherConfig, java.awt.Component anOwner)
           
protected  void fireLauncherConfigAdded(ProtectionLauncherConfig aLauncherConfig)
           
protected  void fireLauncherConfigRemoved(ProtectionLauncherConfig aLauncherConfig)
           
protected  void fireLauncherConfigStorageLoaded()
           
protected  void fireLauncherConfigStorageSaved()
           
 ProtectionLauncher getLauncher(LicenseStorage.LicenseEntry anEntry, java.awt.Component anOwner, boolean isExactMatch)
          Creates and returns a new Launcher instance capable of working with the licenses defined by the given license entry
 ProtectionLauncherConfig getLauncherConfig(LicenseStorage.LicenseEntry anEntry, boolean isExactMatch)
          Returns the launcher configuration suitable to handle given license entry
 ProtectionLauncherConfig getLauncherConfig(java.lang.String aProductID)
          Returns launcher configuration for given product identifier
 ProtectionLauncherConfig getLauncherConfig(java.lang.String aProduct, java.lang.String aProductEdition, int aMajorVersion, int aMinorVersion)
          Returns the launcher configuration suitable to handle license entry with given attributes
 java.util.Collection getLauncherConfigs()
          Returns collection of launcher configurations contained in the storage
protected  java.lang.String getLicenseFileLocation(LicenseStorage.LicenseEntry anEntry, LicenseReader aLicenseReader)
           
 LicenseReader getLicenseReader(LicenseStorage.LicenseEntry anEntry, boolean isExactMatch)
          Creates and returns LicenseReader instance capable of reading licenses defined by given license entry
 void removeLauncherConfigStorageListener(LauncherConfigStorageListener l)
          Removes a listener from the listeners list
 void setModified(boolean aModified)
          Specifies that the storage is modified
protected  void updateLicenseEntryProperties(LicenseStorage.LicenseEntry aLicenseEntry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jp.protection.pub.pro.ls.LauncherConfigStorage
load
 

Field Detail

fLauncherConfigs

protected dev.util.collections.HashedBoundList fLauncherConfigs

fModified

protected boolean fModified

fLauncherConfigStorageListeners

transient java.util.Vector fLauncherConfigStorageListeners
Constructor Detail

BasicLauncherConfigStorage

public BasicLauncherConfigStorage()
Method Detail

getLauncher

public ProtectionLauncher getLauncher(LicenseStorage.LicenseEntry anEntry,
                                      java.awt.Component anOwner,
                                      boolean isExactMatch)
Description copied from interface: LauncherConfigStorage
Creates and returns a new Launcher instance capable of working with the licenses defined by the given license entry

Specified by:
getLauncher in interface LauncherConfigStorage
Parameters:
anEntry - license entry to create Launcher for
anOwner - owner component for all dialogs can be shown with help of Launcher
isExactMatch - defines that if there is no Launcher has been found and parameter is false then the method should try to find first suitable Launcher ignoring some of license entry properties.
Returns:
new Launcher instance

getLauncherConfig

public ProtectionLauncherConfig getLauncherConfig(LicenseStorage.LicenseEntry anEntry,
                                                  boolean isExactMatch)
Description copied from interface: LauncherConfigStorage
Returns the launcher configuration suitable to handle given license entry

Specified by:
getLauncherConfig in interface LauncherConfigStorage
Parameters:
anEntry - the license entry to get the launcher configuration for
isExactMatch - defines that if there is no launcher configuration has been found and parameter is false then the method should try to find first suitable launcher configuration ignoring some of license entry properties.
Returns:
launcher configuration

getLauncherConfig

public ProtectionLauncherConfig getLauncherConfig(java.lang.String aProduct,
                                                  java.lang.String aProductEdition,
                                                  int aMajorVersion,
                                                  int aMinorVersion)
Description copied from interface: LauncherConfigStorage
Returns the launcher configuration suitable to handle license entry with given attributes

Specified by:
getLauncherConfig in interface LauncherConfigStorage
Parameters:
aProduct - product identifier
aProductEdition - product edition identifier
aMajorVersion - major version
aMinorVersion - minor version
Returns:
launcher configuration

createLauncher

protected ProtectionLauncher createLauncher(LicenseStorage.LicenseEntry anEntry,
                                            ProtectionLauncherConfig aLauncherConfig,
                                            java.awt.Component anOwner)

addLauncherConfig

public void addLauncherConfig(ProtectionLauncherConfig aLauncherConfig)
Description copied from interface: LauncherConfigStorage
Adds a launcher configuration into the storage

Specified by:
addLauncherConfig in interface LauncherConfigStorage
Parameters:
aLauncherConfig - a launcher configuration to add

getLauncherConfig

public ProtectionLauncherConfig getLauncherConfig(java.lang.String aProductID)
Returns launcher configuration for given product identifier

Parameters:
aProductID - product identifier
Returns:
launcher configuration

getLauncherConfigs

public java.util.Collection getLauncherConfigs()
Description copied from interface: LauncherConfigStorage
Returns collection of launcher configurations contained in the storage

Specified by:
getLauncherConfigs in interface LauncherConfigStorage
Returns:
collection of launcher configurations

getLicenseReader

public LicenseReader getLicenseReader(LicenseStorage.LicenseEntry anEntry,
                                      boolean isExactMatch)
Description copied from interface: LauncherConfigStorage
Creates and returns LicenseReader instance capable of reading licenses defined by given license entry

Specified by:
getLicenseReader in interface LauncherConfigStorage
Parameters:
anEntry - license entry to get License Reader for
isExactMatch - defines that if no License Reader is found and parameter is false the method should try to find first suitable License Reader ignoring some of license entry properties
Returns:
LicenseReader instance

setModified

public void setModified(boolean aModified)
Specifies that the storage is modified

Parameters:
aModified - value to set

getLicenseFileLocation

protected java.lang.String getLicenseFileLocation(LicenseStorage.LicenseEntry anEntry,
                                                  LicenseReader aLicenseReader)

updateLicenseEntryProperties

protected void updateLicenseEntryProperties(LicenseStorage.LicenseEntry aLicenseEntry)

addLauncherConfigStorageListener

public void addLauncherConfigStorageListener(LauncherConfigStorageListener l)
Description copied from interface: LauncherConfigStorage
Adds a listener to the listeners list

Specified by:
addLauncherConfigStorageListener in interface LauncherConfigStorage
Parameters:
l - listener to add

removeLauncherConfigStorageListener

public void removeLauncherConfigStorageListener(LauncherConfigStorageListener l)
Description copied from interface: LauncherConfigStorage
Removes a listener from the listeners list

Specified by:
removeLauncherConfigStorageListener in interface LauncherConfigStorage
Parameters:
l - listener to remove

fireLauncherConfigAdded

protected void fireLauncherConfigAdded(ProtectionLauncherConfig aLauncherConfig)

fireLauncherConfigRemoved

protected void fireLauncherConfigRemoved(ProtectionLauncherConfig aLauncherConfig)

fireLauncherConfigStorageLoaded

protected void fireLauncherConfigStorageLoaded()

fireLauncherConfigStorageSaved

protected void fireLauncherConfigStorageSaved()