|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jp.protection.pub.pro.ls.BasicLicenseStorage
public abstract class BasicLicenseStorage
Basic implementation of the LicenseStorage
interface that can be used to build actual
LicenseStorage
implementations.
Nested Class Summary | |
---|---|
static class |
BasicLicenseStorage.BasicLicenseEntry
Basic implementation of the LicenseEntry interface |
static class |
BasicLicenseStorage.EntryLicenseReader
License Reader implementation to allow license reading from the license storage |
Nested classes/interfaces inherited from interface com.jp.protection.pub.pro.ls.LicenseStorage |
---|
LicenseStorage.LicenseEntry |
Field Summary | |
---|---|
protected java.util.HashMap |
fLicenseEntryIDMap
|
protected dev.util.HashDualMap |
fLicenseEntryMap
|
protected java.util.Vector |
fLicenseStorageListeners
|
protected boolean |
fModified
|
Fields inherited from interface com.jp.protection.pub.pro.ls.LicenseStorage |
---|
ANY_LICENSE_TYPE, ANY_MAJOR_VERSION, ANY_MINOR_VERSION, ANY_PRODUCT, ANY_PRODUCT_EDITION, ANY_USER_LICENSING_MODEL |
Constructor Summary | |
---|---|
BasicLicenseStorage()
|
Method Summary | |
---|---|
void |
addLicenseEntry(LicenseStorage.LicenseEntry anEntry,
java.lang.String aName)
Adds a license entry into the license storage |
protected void |
addLicenseEntryImpl(LicenseStorage.LicenseEntry anEntry,
java.lang.String aName)
|
void |
addLicenseStorageListener(LicenseStorageListener l)
Adds a listener to the listeners list |
void |
assignNewID(LicenseStorage.LicenseEntry aLicenseEntry)
Assigns new unique identifier for the license entry |
protected void |
calculateCurrentID()
|
protected void |
checkLicenseExistence(LicenseStorage.LicenseEntry anEntry,
byte[] aLicenseBytes)
|
LicenseStorage.LicenseEntry |
createLicenseEntry()
Creates a new instance of LicenseEntry |
protected void |
fireBeforeLicenseStorageLoad()
|
protected void |
fireBeforeLicenseStorageSave()
|
protected void |
fireLicenseEntryAdded(LicenseStorage.LicenseEntry aLicenseEntry)
|
protected void |
fireLicenseEntryRemoved(LicenseStorage.LicenseEntry aLicenseEntry)
|
protected void |
fireLicenseEntryUpdated(LicenseStorage.LicenseEntry aLicenseEntry)
|
protected void |
fireLicenseStorageLoaded(boolean isSuccess)
|
protected void |
fireLicenseStorageSaved(boolean isSuccess)
|
java.util.Collection |
getLicenseEntries(java.lang.String aPath,
boolean isIncludeSubPaths)
Returns collection of the license entries for the given path |
java.util.Collection |
getLicenseEntries(java.lang.String aProduct,
java.lang.String aProductEdition,
int aMajorVersion,
int aMinorVersion,
int aLicenseType)
Returns collection of the mathced license entries for the given parameters |
java.util.Collection |
getLicenseEntries(java.lang.String aProduct,
java.lang.String aProductEdition,
int aMajorVersion,
int aMinorVersion,
int aLicenseType,
boolean isExactMatch)
Returns collection of the license entries those match for the given parameters |
LicenseStorage.LicenseEntry |
getLicenseEntry(int anID)
Returns the license entry for the given unique identifier |
LicenseStorage.LicenseEntry |
getLicenseEntry(java.lang.String aName)
Returns license entry for the given name |
LicenseStorage.LicenseEntry |
getLicenseEntryForLicenseNumber(java.lang.String aLicenseNumber)
Returns license entry for the given license number |
static java.lang.String |
getLicenseEntryPath(java.lang.String aName)
Returns path component for the given license entry name |
static java.lang.String |
getLicenseEntryShortName(java.lang.String aName)
Returns short name for given full one |
java.lang.String |
getName(LicenseStorage.LicenseEntry anEntry)
Returns the name for the given license entry |
int |
getNewID()
Calculates and returns new unique identifier |
static java.lang.String |
getNewLicenseEntryName(LicenseStorage.LicenseEntry aLicenseEntry)
|
boolean |
isModified()
Returns whether this license storage has been modified |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
removeLicenseEntry(LicenseStorage.LicenseEntry anEntry)
Removes a license entry from the license storage |
void |
removeLicenseStorageListener(LicenseStorageListener l)
Removes a listener from the listeners list |
void |
setModified(boolean aModified)
Specifies that this license storage is modified |
void |
updateLicenseEntry(LicenseStorage.LicenseEntry anEntry,
java.lang.String aName)
Updates a license entry in the license storage |
protected void |
updateLicenseEntryImpl(LicenseStorage.LicenseEntry anEntry,
java.lang.String aName)
|
static void |
updateLicenseEntryProperties(License aLicense,
LicenseStorage.LicenseEntry aLicenseEntry)
Updates license entry properties from the given license |
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.LicenseStorage |
---|
createLicenseReader, load, store |
Field Detail |
---|
protected java.util.HashMap fLicenseEntryIDMap
protected dev.util.HashDualMap fLicenseEntryMap
protected transient java.util.Vector fLicenseStorageListeners
protected boolean fModified
Constructor Detail |
---|
public BasicLicenseStorage()
Method Detail |
---|
public int getNewID()
protected void calculateCurrentID()
public void assignNewID(LicenseStorage.LicenseEntry aLicenseEntry)
LicenseStorage
assignNewID
in interface LicenseStorage
aLicenseEntry
- license entry to assign unique identifier topublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public LicenseStorage.LicenseEntry createLicenseEntry()
LicenseStorage
LicenseEntry
createLicenseEntry
in interface LicenseStorage
LicenseEntry
public void addLicenseEntry(LicenseStorage.LicenseEntry anEntry, java.lang.String aName)
LicenseStorage
addLicenseEntry
in interface LicenseStorage
anEntry
- license entry to addaName
- license entry name. The name may contain slashes to denote path componentsprotected void addLicenseEntryImpl(LicenseStorage.LicenseEntry anEntry, java.lang.String aName) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void updateLicenseEntry(LicenseStorage.LicenseEntry anEntry, java.lang.String aName)
LicenseStorage
updateLicenseEntry
in interface LicenseStorage
anEntry
- license entry to updateaName
- license entry name. The name may contain slashes to denote path componentsprotected void updateLicenseEntryImpl(LicenseStorage.LicenseEntry anEntry, java.lang.String aName)
protected void checkLicenseExistence(LicenseStorage.LicenseEntry anEntry, byte[] aLicenseBytes)
public java.util.Collection getLicenseEntries(java.lang.String aPath, boolean isIncludeSubPaths)
LicenseStorage
getLicenseEntries
in interface LicenseStorage
aPath
- path value. Only absolute paths are supported so each path should start with \ so "\" path
denotes root.isIncludeSubPaths
- defines that sub paths should be searched too
public LicenseStorage.LicenseEntry getLicenseEntryForLicenseNumber(java.lang.String aLicenseNumber)
LicenseStorage
getLicenseEntryForLicenseNumber
in interface LicenseStorage
aLicenseNumber
- license number
null
of no license entry foundpublic java.util.Collection getLicenseEntries(java.lang.String aProduct, java.lang.String aProductEdition, int aMajorVersion, int aMinorVersion, int aLicenseType, boolean isExactMatch)
aProduct
- product identifier or ANY_PRODUCT
constant if any product is acceptableaProductEdition
- product edition identifier or ANY_PRODUCT_EDITION
constant if any product edition is
acceptableaMajorVersion
- major version or ANY_MAJOR_VERSION
constant if any major version is acceptableaMinorVersion
- minor version or ANY_MINOR_VERSION
constant if any minor version is acceptableaLicenseType
- license type as one of the License.TYPE_
constants or ANY_LICENSE_TYPE
constant if any license type is acceptableisExactMatch
- specifies whether only the license entries that matches the given criteria exactly should be
returned. If no license entries were found and the exact match is not required then the method will try to find the
license entries by sequentially applying ANY_*
constants’ values to the method parameters
(from right to left).
- Returns:
- collection of the license entries
public java.util.Collection getLicenseEntries(java.lang.String aProduct, java.lang.String aProductEdition, int aMajorVersion, int aMinorVersion, int aLicenseType)
LicenseStorage
getLicenseEntries
in interface LicenseStorage
aProduct
- product identifier or the ANY_PRODUCT
constant if any product is acceptableaProductEdition
- product edition identifier or ANY_PRODUCT_EDITION
constant if any product edition
is acceptableaMajorVersion
- major version or the ANY_MAJOR_VERSION
constant if any major version is acceptableaMinorVersion
- minor version or the ANY_MINOR_VERSION
constant if any minor version is acceptableaLicenseType
- license type as one of the License.TYPE_
constants
or the ANY_LICENSE_TYPE
constant if any license type is acceptable
public LicenseStorage.LicenseEntry getLicenseEntry(java.lang.String aName)
LicenseStorage
getLicenseEntry
in interface LicenseStorage
aName
- license entry name
null
of no license entry foundpublic java.lang.String getName(LicenseStorage.LicenseEntry anEntry)
LicenseStorage
getName
in interface LicenseStorage
anEntry
- license entry to get name for
public static java.lang.String getLicenseEntryShortName(java.lang.String aName)
aName
- full name of license entry
public static java.lang.String getLicenseEntryPath(java.lang.String aName)
aName
- license entry name
public void removeLicenseEntry(LicenseStorage.LicenseEntry anEntry)
LicenseStorage
removeLicenseEntry
in interface LicenseStorage
anEntry
- license entry to removepublic LicenseStorage.LicenseEntry getLicenseEntry(int anID)
LicenseStorage
getLicenseEntry
in interface LicenseStorage
anID
- unique identifier
null
of no license entry foundpublic void addLicenseStorageListener(LicenseStorageListener l)
LicenseStorage
addLicenseStorageListener
in interface LicenseStorage
l
- listener to addpublic void removeLicenseStorageListener(LicenseStorageListener l)
LicenseStorage
removeLicenseStorageListener
in interface LicenseStorage
l
- listener to removeprotected void fireLicenseEntryAdded(LicenseStorage.LicenseEntry aLicenseEntry)
protected void fireLicenseEntryUpdated(LicenseStorage.LicenseEntry aLicenseEntry)
protected void fireLicenseEntryRemoved(LicenseStorage.LicenseEntry aLicenseEntry)
protected void fireBeforeLicenseStorageLoad()
protected void fireLicenseStorageLoaded(boolean isSuccess)
protected void fireBeforeLicenseStorageSave()
protected void fireLicenseStorageSaved(boolean isSuccess)
public boolean isModified()
LicenseStorage
isModified
in interface LicenseStorage
true
if this license storage is modified; false
otherwisepublic void setModified(boolean aModified)
LicenseStorage
setModified
in interface LicenseStorage
aModified
- true
if this license storage should be modified; false
otherwisepublic static void updateLicenseEntryProperties(License aLicense, LicenseStorage.LicenseEntry aLicenseEntry)
aLicense
- license to get properties fromaLicenseEntry
- license entry to update properties forpublic static java.lang.String getNewLicenseEntryName(LicenseStorage.LicenseEntry aLicenseEntry)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |