com.jp.protection.pub.launch
Class ProtectionLauncher

java.lang.Object
  extended by com.jp.protection.pub.launch.HeadlessProtectionLauncher
      extended by com.jp.protection.pub.launch.ProtectionLauncher
Direct Known Subclasses:
BasicLauncherConfigStorage.EntryProtectionLauncher

public class ProtectionLauncher
extends HeadlessProtectionLauncher

This class represents the entry point to the licensing functionality. It holds all the Protection! configuration data and provides various access and utility methods. The sample use case would be as follows:


 ProtectionLauncherConfigReader reader = new ProtectionLauncherConfigReader();
 reader.setDecryptKeyBytes(...);
 reader.setSecurityAlgorithm("RSA - 512");
 ProtectionLauncher launcher = ProtectionLauncher.getProtectionLauncher(reader, ProtectionLauncher.class,
   "DemoCalc.launcher", owner);
 launcher.checkLicense();
 

Note, launcher can be generated via Products Screen | Build | Build Launcher.

Since:
3.0

Field Summary
protected  javax.swing.ImageIcon fActivationWizardLogo
           
protected  int fActivationWizardOptions
           
protected  javax.swing.ImageIcon fDeactivationWizardLogo
           
protected  int fDeactivationWizardOptions
           
protected  javax.swing.ImageIcon fLicenseLockWizardLogo
           
protected  int fLicenseLockWizardOptions
           
protected  javax.swing.ImageIcon fLicensingWizardLogo
           
protected  int fLicensingWizardOptions
           
protected static java.text.MessageFormat FMT_CHECKOUT_FAIL
           
protected static java.text.MessageFormat FMT_CHECKOUT_SUCCESS
           
protected  java.awt.Component fOwner
           
(package private) static java.util.ResourceBundle res
           
 
Fields inherited from class com.jp.protection.pub.launch.HeadlessProtectionLauncher
fLauncherConfig, fLicenseHost, fLicenseListener, fLicenseReader, fVerbose
 
Constructor Summary
ProtectionLauncher(ProtectionLauncherConfig aLauncherConfig)
          Creates a new instance of the launcher.
ProtectionLauncher(ProtectionLauncherConfig aLauncherConfig, java.awt.Component anOwner)
          Creates a new instance of the launcher.
ProtectionLauncher(ProtectionLauncherConfig aLauncherConfig, java.awt.Component anOwner, LicenseReader aLicenseReader)
          Creates a new instance of the launcher.
 
Method Summary
 boolean checkoutLicense()
          Checks out a License for offline use without need to lock the License using Licensing Server
 boolean checkoutLicense(boolean isShowMessage)
          Checks out a License for offline use without need to lock the License using Licensing Server.
protected  LicenseAcceptanceDelegate createLicenseAcceptanceDelegate()
           
protected  LicenseDeactivationWizard createLicenseDeactivationWizard(java.awt.Component anOwner)
           
protected  LicenseHost createLicenseHost()
           
protected  LicenseHostIssueResolver createLicenseHostIssueResolver()
           
protected  LicenseReaderIssueResolver createLicenseReaderIssueResolver()
           
protected  LicensingWizard createLicensingWizard(java.awt.Component anOwner)
           
 int deactivateLicense(java.awt.Component anOwner)
          Provides ability to deactivate license by use of Deactivation Assistant
static ProtectionLauncher getProtectionLauncher(ProtectionLauncherConfigReader aReader, java.lang.Class aBaseCLass, java.lang.String aLauncherConfigResourceName)
          Creates a new launcher instance and initializes it with configuration loaded from resource.
static ProtectionLauncher getProtectionLauncher(ProtectionLauncherConfigReader aReader, java.lang.Class aBaseCLass, java.lang.String aLauncherConfigResourceName, java.awt.Component anOwner)
          Creates a new launcher instance and initializes it with configuration loaded from resource.
static ProtectionLauncher getProtectionLauncher(ProtectionLauncherConfigReader aReader, java.lang.Class aBaseCLass, java.lang.String aLauncherConfigResourceName, java.awt.Component anOwner, LicenseReader aLicenseReader)
          Creates a new launcher instance and initializes it with configuration loaded from resource.
 void init()
          Initializes launcher instance
protected  void initLicenseHost()
           
protected  void initLicenseListener()
           
protected  void initLicenseReader()
           
protected  void initProfessional(ProtectionLauncherConfig config)
           
 boolean isAutoUpdateLicenseFromLicensingServer()
          Returns whether automatic update of license from Licening Server is enabled.
protected  javax.swing.ImageIcon loadIcon(java.lang.String aFileName, java.lang.String aResource)
           
 void setActivationWizardLogo(javax.swing.ImageIcon anActivationWizardLogo)
          Specifies image used as the logo for Activation Assistant
protected  void setActivationWizardOptions(int anOptions)
           
 void setAutoUpdateLicenseFromLicensingServer(boolean autoUpdateLicenseFromLicensingServer)
          Specifies that automatic update of license from Licening Server is enabled.
protected  void setDeactivationWizardLogo(javax.swing.ImageIcon aDeactivationWizardLogo)
           
protected  void setDeactivationWizardOptions(int anOptions)
           
protected  void setLicenseLockWizardLogo(javax.swing.ImageIcon aLicenseLockWizardLogo)
           
protected  void setLicenseLockWizardOptions(int anOptions)
           
 void setLicensingWizardLogo(javax.swing.ImageIcon aLicensingWizardLogo)
          Specifies image used as the logo for Licensing Assistant
protected  void setLicensingWizardOptions(int anOptions)
           
 void showAboutDialog()
          Shows About dialog which displays product and company information, license details, company logo and copyright note
 boolean updateLicenseFromLicensingServer()
          Utility method that allows to update license from Licensing Server.
 boolean upgradeLicense(java.awt.Component anOwner)
          Provides ability to upgrade existing license by showing Licensing Assistant to the user allowing him/her to use various ways to get upgrade.
 
Methods inherited from class com.jp.protection.pub.launch.HeadlessProtectionLauncher
canCheckoutLicense, canTerminateLicensePass, checkLicense, checkLicense, createLicenseReader, error, getHeadlessProtectionLauncher, getHeadlessProtectionLauncher, getLauncherConfig, getLicenseHost, getLicenseReader, getPreferences, getProductEditionName, getProductInfo, initLicensingFacades, initLicensingServerConnections, initSecretStorages, isVerbose, replaceDefaultLicenseListener, setVerbose, terminateLicensePass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fOwner

protected java.awt.Component fOwner

fLicensingWizardLogo

protected javax.swing.ImageIcon fLicensingWizardLogo

fActivationWizardLogo

protected javax.swing.ImageIcon fActivationWizardLogo

fLicensingWizardOptions

protected int fLicensingWizardOptions

fActivationWizardOptions

protected int fActivationWizardOptions

fDeactivationWizardLogo

protected javax.swing.ImageIcon fDeactivationWizardLogo

fDeactivationWizardOptions

protected int fDeactivationWizardOptions

fLicenseLockWizardLogo

protected javax.swing.ImageIcon fLicenseLockWizardLogo

fLicenseLockWizardOptions

protected int fLicenseLockWizardOptions

res

static java.util.ResourceBundle res

FMT_CHECKOUT_SUCCESS

protected static final java.text.MessageFormat FMT_CHECKOUT_SUCCESS

FMT_CHECKOUT_FAIL

protected static final java.text.MessageFormat FMT_CHECKOUT_FAIL
Constructor Detail

ProtectionLauncher

public ProtectionLauncher(ProtectionLauncherConfig aLauncherConfig)
Creates a new instance of the launcher.

Parameters:
aLauncherConfig - launcher configuration

ProtectionLauncher

public ProtectionLauncher(ProtectionLauncherConfig aLauncherConfig,
                          java.awt.Component anOwner)
Creates a new instance of the launcher.

Parameters:
aLauncherConfig - launcher configuration
anOwner - owner for all dialogs can be shown by the launcher

ProtectionLauncher

public ProtectionLauncher(ProtectionLauncherConfig aLauncherConfig,
                          java.awt.Component anOwner,
                          LicenseReader aLicenseReader)
Creates a new instance of the launcher.

Parameters:
aLauncherConfig - launcher configuration
anOwner - owner for all dialogs can be shown by the launcher
aLicenseReader - LicenseReader custom license reader should be used by the launcher to locate and read licenses
Method Detail

showAboutDialog

public void showAboutDialog()
Shows About dialog which displays product and company information, license details, company logo and copyright note


initLicenseReader

protected void initLicenseReader()
Overrides:
initLicenseReader in class HeadlessProtectionLauncher

init

public void init()
Description copied from class: HeadlessProtectionLauncher
Initializes launcher instance

Overrides:
init in class HeadlessProtectionLauncher

createLicenseReaderIssueResolver

protected LicenseReaderIssueResolver createLicenseReaderIssueResolver()
Overrides:
createLicenseReaderIssueResolver in class HeadlessProtectionLauncher

initLicenseListener

protected void initLicenseListener()
Overrides:
initLicenseListener in class HeadlessProtectionLauncher

initLicenseHost

protected void initLicenseHost()
Overrides:
initLicenseHost in class HeadlessProtectionLauncher

createLicenseHostIssueResolver

protected LicenseHostIssueResolver createLicenseHostIssueResolver()
Overrides:
createLicenseHostIssueResolver in class HeadlessProtectionLauncher

createLicenseAcceptanceDelegate

protected LicenseAcceptanceDelegate createLicenseAcceptanceDelegate()
Overrides:
createLicenseAcceptanceDelegate in class HeadlessProtectionLauncher

createLicenseHost

protected LicenseHost createLicenseHost()
Overrides:
createLicenseHost in class HeadlessProtectionLauncher

initProfessional

protected void initProfessional(ProtectionLauncherConfig config)
Overrides:
initProfessional in class HeadlessProtectionLauncher

loadIcon

protected javax.swing.ImageIcon loadIcon(java.lang.String aFileName,
                                         java.lang.String aResource)

setLicensingWizardLogo

public void setLicensingWizardLogo(javax.swing.ImageIcon aLicensingWizardLogo)
Specifies image used as the logo for Licensing Assistant

Parameters:
aLicensingWizardLogo - image to specify

setActivationWizardLogo

public void setActivationWizardLogo(javax.swing.ImageIcon anActivationWizardLogo)
Specifies image used as the logo for Activation Assistant

Parameters:
anActivationWizardLogo - image to specify

setLicensingWizardOptions

protected void setLicensingWizardOptions(int anOptions)

setActivationWizardOptions

protected void setActivationWizardOptions(int anOptions)

setDeactivationWizardLogo

protected void setDeactivationWizardLogo(javax.swing.ImageIcon aDeactivationWizardLogo)

setDeactivationWizardOptions

protected void setDeactivationWizardOptions(int anOptions)

setLicenseLockWizardLogo

protected void setLicenseLockWizardLogo(javax.swing.ImageIcon aLicenseLockWizardLogo)

setLicenseLockWizardOptions

protected void setLicenseLockWizardOptions(int anOptions)

upgradeLicense

public boolean upgradeLicense(java.awt.Component anOwner)
Provides ability to upgrade existing license by showing Licensing Assistant to the user allowing him/her to use various ways to get upgrade.

Parameters:
anOwner - a component from which Licensing Assistant should be displayed
Returns:
true if new license is acquired, properly read and validated; false otherwise

createLicensingWizard

protected LicensingWizard createLicensingWizard(java.awt.Component anOwner)

deactivateLicense

public int deactivateLicense(java.awt.Component anOwner)
Provides ability to deactivate license by use of Deactivation Assistant

Parameters:
anOwner - a component from which Deactivation Assistant should be displayed
Returns:
operation result code as one of LicenseDeactivationWizard.DEACTIVATE_ constants.

createLicenseDeactivationWizard

protected LicenseDeactivationWizard createLicenseDeactivationWizard(java.awt.Component anOwner)

getProtectionLauncher

public static ProtectionLauncher getProtectionLauncher(ProtectionLauncherConfigReader aReader,
                                                       java.lang.Class aBaseCLass,
                                                       java.lang.String aLauncherConfigResourceName,
                                                       java.awt.Component anOwner,
                                                       LicenseReader aLicenseReader)
                                                throws java.io.IOException
Creates a new launcher instance and initializes it with configuration loaded from resource.

Parameters:
aReader - reader used to read launcher configuration
aBaseCLass - base class used to to load configuration resource
aLauncherConfigResourceName - name of resource
anOwner - owner for all dialogs can be shown by the launcher
aLicenseReader - LicenseReader custom license reader should be used by the launcher to locate and read licenses
Returns:
launcher instance
Throws:
java.io.IOException - when any error occured during configuration load

getProtectionLauncher

public static ProtectionLauncher getProtectionLauncher(ProtectionLauncherConfigReader aReader,
                                                       java.lang.Class aBaseCLass,
                                                       java.lang.String aLauncherConfigResourceName,
                                                       java.awt.Component anOwner)
                                                throws java.io.IOException
Creates a new launcher instance and initializes it with configuration loaded from resource.

Parameters:
aReader - reader used to read launcher configuration
aBaseCLass - base class used to to load configuration resource
aLauncherConfigResourceName - name of resource
anOwner - owner for all dialogs can be shown by the launcher
Returns:
launcher instance
Throws:
java.io.IOException - when any error occured during configuration load

getProtectionLauncher

public static ProtectionLauncher getProtectionLauncher(ProtectionLauncherConfigReader aReader,
                                                       java.lang.Class aBaseCLass,
                                                       java.lang.String aLauncherConfigResourceName)
                                                throws java.io.IOException
Creates a new launcher instance and initializes it with configuration loaded from resource.

Parameters:
aReader - reader used to read launcher configuration
aBaseCLass - base class used to to load configuration resource
aLauncherConfigResourceName - name of resource
Returns:
launcher instance
Throws:
java.io.IOException - when any error occured during configuration load

setAutoUpdateLicenseFromLicensingServer

public void setAutoUpdateLicenseFromLicensingServer(boolean autoUpdateLicenseFromLicensingServer)
Specifies that automatic update of license from Licening Server is enabled. If getLicenseReader().getIssueResolver() is not an instance of DefaultLicenseReaderIssueResolverPro this call does nothing.

Parameters:
autoUpdateLicenseFromLicensingServer - true if automatic update of license from Licening Server should be enabled; false otherwise.
Since:
v4.8

isAutoUpdateLicenseFromLicensingServer

public boolean isAutoUpdateLicenseFromLicensingServer()
Returns whether automatic update of license from Licening Server is enabled.

Returns:
true if automatic update of license from Licensing Server is enabled; false otherwise.
Since:
v4.8

updateLicenseFromLicensingServer

public boolean updateLicenseFromLicensingServer()
Utility method that allows to update license from Licensing Server. Result of this operation can be either license removal, updated license or nothing if current license is up-to-date.

Returns:
true if update was successful; false otherwise
Since:
v4.8

checkoutLicense

public boolean checkoutLicense()
Checks out a License for offline use without need to lock the License using Licensing Server

Overrides:
checkoutLicense in class HeadlessProtectionLauncher
Returns:
true if license has been successfully checked out; false otherwise
Since:
v5.0

checkoutLicense

public boolean checkoutLicense(boolean isShowMessage)
Checks out a License for offline use without need to lock the License using Licensing Server. A message with the result of operation can be optionally shown.

Parameters:
isShowMessage - true if a message with the result of operation should be shown; false otherwise
Returns:
true if license has been successfully checked out; false otherwise
Since:
v5.0