com.jp.protection.pub.pro.ls
Interface LicenseStorage

All Known Implementing Classes:
BasicLicenseStorage, JarLicenseStorage

public interface LicenseStorage

The interface describes the license storage intended to hold unlimited number of different licenses

Since:
3.0

Nested Class Summary
static interface LicenseStorage.LicenseEntry
          Interface describes single license stored in the license storage
 
Field Summary
static int ANY_LICENSE_TYPE
          Specifies that the license entry of any license type is acceptable
static int ANY_MAJOR_VERSION
          Specifies that the license entry of any major version is acceptable
static int ANY_MINOR_VERSION
          Specifies that the license entry of any minor version is acceptable
static java.lang.String ANY_PRODUCT
          Specifies that the license entry of any product identifier is acceptable
static java.lang.String ANY_PRODUCT_EDITION
          Specifies that the license entry of any product edition identifier is acceptable
static int ANY_USER_LICENSING_MODEL
          Specifies that the license entry of any user licensing model is acceptable
 
Method Summary
 void addLicenseEntry(LicenseStorage.LicenseEntry anEntry, java.lang.String aName)
          Adds a license entry into the license storage
 void addLicenseStorageListener(LicenseStorageListener l)
          Adds a listener to the listeners list
 void assignNewID(LicenseStorage.LicenseEntry aLicenseEntry)
          Assigns new unique identifier for the license entry
 LicenseStorage.LicenseEntry createLicenseEntry()
          Creates a new instance of LicenseEntry
 LicenseReader createLicenseReader(java.lang.String aLicenseEntryName)
          Creates and returns LicenseReader instance capable of reading license from the license storage
 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
 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
 java.lang.String getName(LicenseStorage.LicenseEntry anEntry)
          Returns the name for the given license entry
 boolean isModified()
          Returns whether this license storage has been modified
 void load(java.io.InputStream anInputStream)
          Loads license storage from the given stream
 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 store(java.io.OutputStream anOutputStream)
          Stores license storage to the given stream
 void updateLicenseEntry(LicenseStorage.LicenseEntry anEntry, java.lang.String aName)
          Updates a license entry in the license storage
 

Field Detail

ANY_PRODUCT

static final java.lang.String ANY_PRODUCT
Specifies that the license entry of any product identifier is acceptable


ANY_PRODUCT_EDITION

static final java.lang.String ANY_PRODUCT_EDITION
Specifies that the license entry of any product edition identifier is acceptable


ANY_MAJOR_VERSION

static final int ANY_MAJOR_VERSION
Specifies that the license entry of any major version is acceptable

See Also:
Constant Field Values

ANY_MINOR_VERSION

static final int ANY_MINOR_VERSION
Specifies that the license entry of any minor version is acceptable

See Also:
Constant Field Values

ANY_LICENSE_TYPE

static final int ANY_LICENSE_TYPE
Specifies that the license entry of any license type is acceptable

See Also:
Constant Field Values

ANY_USER_LICENSING_MODEL

static final int ANY_USER_LICENSING_MODEL
Specifies that the license entry of any user licensing model is acceptable

See Also:
Constant Field Values
Method Detail

createLicenseEntry

LicenseStorage.LicenseEntry createLicenseEntry()
Creates a new instance of LicenseEntry

Returns:
a new instance of LicenseEntry

assignNewID

void assignNewID(LicenseStorage.LicenseEntry aLicenseEntry)
Assigns new unique identifier for the license entry

Parameters:
aLicenseEntry - license entry to assign unique identifier to

getLicenseEntry

LicenseStorage.LicenseEntry getLicenseEntry(int anID)
Returns the license entry for the given unique identifier

Parameters:
anID - unique identifier
Returns:
license entry or null of no license entry found

getLicenseEntry

LicenseStorage.LicenseEntry getLicenseEntry(java.lang.String aName)
Returns license entry for the given name

Parameters:
aName - license entry name
Returns:
license entry or null of no license entry found

getLicenseEntryForLicenseNumber

LicenseStorage.LicenseEntry getLicenseEntryForLicenseNumber(java.lang.String aLicenseNumber)
Returns license entry for the given license number

Parameters:
aLicenseNumber - license number
Returns:
license entry or null of no license entry found

getLicenseEntries

java.util.Collection getLicenseEntries(java.lang.String aPath,
                                       boolean isIncludeSubPaths)
Returns collection of the license entries for the given path

Parameters:
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
Returns:
collection of the license entries

getLicenseEntries

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

Parameters:
aProduct - product identifier or the ANY_PRODUCT constant if any product is acceptable
aProductEdition - product edition identifier or ANY_PRODUCT_EDITION constant if any product edition is acceptable
aMajorVersion - major version or the ANY_MAJOR_VERSION constant if any major version is acceptable
aMinorVersion - minor version or the ANY_MINOR_VERSION constant if any minor version is acceptable
aLicenseType - license type as one of the License.TYPE_ constants or the ANY_LICENSE_TYPE constant if any license type is acceptable
Returns:
collection of the license entries

getName

java.lang.String getName(LicenseStorage.LicenseEntry anEntry)
Returns the name for the given license entry

Parameters:
anEntry - license entry to get name for
Returns:
name of the license entry

addLicenseEntry

void addLicenseEntry(LicenseStorage.LicenseEntry anEntry,
                     java.lang.String aName)
Adds a license entry into the license storage

Parameters:
anEntry - license entry to add
aName - license entry name. The name may contain slashes to denote path components

updateLicenseEntry

void updateLicenseEntry(LicenseStorage.LicenseEntry anEntry,
                        java.lang.String aName)
Updates a license entry in the license storage

Parameters:
anEntry - license entry to update
aName - license entry name. The name may contain slashes to denote path components
Since:
4.8.0

removeLicenseEntry

void removeLicenseEntry(LicenseStorage.LicenseEntry anEntry)
Removes a license entry from the license storage

Parameters:
anEntry - license entry to remove

addLicenseStorageListener

void addLicenseStorageListener(LicenseStorageListener l)
Adds a listener to the listeners list

Parameters:
l - listener to add

removeLicenseStorageListener

void removeLicenseStorageListener(LicenseStorageListener l)
Removes a listener from the listeners list

Parameters:
l - listener to remove

isModified

boolean isModified()
Returns whether this license storage has been modified

Returns:
true if this license storage is modified; false otherwise

setModified

void setModified(boolean aModified)
Specifies that this license storage is modified

Parameters:
aModified - true if this license storage should be modified; false otherwise

load

void load(java.io.InputStream anInputStream)
          throws java.io.IOException,
                 java.lang.UnsupportedOperationException
Loads license storage from the given stream

Parameters:
anInputStream - stream to load license storage from
Throws:
java.io.IOException - for any errors occured during loading
java.lang.UnsupportedOperationException - if loading is not supported by the license storage implementation

store

void store(java.io.OutputStream anOutputStream)
           throws java.io.IOException,
                  java.lang.UnsupportedOperationException
Stores license storage to the given stream

Parameters:
anOutputStream - stream to store license storage to
Throws:
java.io.IOException - for any errors occured during storing
java.lang.UnsupportedOperationException - if storing is not supported by the license storage implementation

createLicenseReader

LicenseReader createLicenseReader(java.lang.String aLicenseEntryName)
Creates and returns LicenseReader instance capable of reading license from the license storage

Parameters:
aLicenseEntryName - name of the license entry to get License Reader for
Returns:
LicenseReader instance