|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jp.protection.priv.LicenseWriterFacade
public class LicenseWriterFacade
This class represents a "facade" that significantly simplifies licenses generation and licenses writing process to files or output streams
Field Summary | |
---|---|
protected ProductsStorage |
fProductsStorage
|
protected boolean |
fSkipEncryption
|
protected boolean |
fVerbose
|
Constructor Summary | |
---|---|
LicenseWriterFacade(java.io.File aProductsStorageFile)
Creates a new instance of the LicenseWriterFacade and loads a product
storage from the specified file |
|
LicenseWriterFacade(java.io.InputStream aProductsStorageInputStream)
Creates a new instance of the LicenseWriterFacade and loads a product
storage from the specified stream |
|
LicenseWriterFacade(java.io.InputStream aProductsStorageInputStream,
ProductsStorage.PasswordResolver aPasswordResolver)
Creates a new instance of the LicenseWriterFacade and loads a product storage from the specified stream |
|
LicenseWriterFacade(ProductsStorage aProductsStorage)
Creates a new instance of the LicenseWriterFacade and associates it
with the specified products storage |
Method Summary | |
---|---|
LicenseImpl |
createLicense(LicenseBase aLicenseInfo)
Creates new license according to the specified license information |
static LicenseImpl |
createLicense(Product aProduct,
int aLicenseType)
Creates a license for specified product. |
static LicenseImpl |
createLicense(Product aProduct,
java.lang.String aProductEditionID,
int aLicenseType)
Creates a license for specified product and product edition. |
LicenseImpl |
createLicense(java.lang.String aProductID,
java.lang.String aProductEditionID,
int aLicenseType)
Creates a license for the specified product and product edition. |
LicenseImpl |
createLicenseForAlias(java.lang.String aLicenseAlias,
java.lang.String aLicenseNumber)
Creates a license for the specified alias (e.g. |
protected LicenseImpl |
createLicenseForSerialNumber(SerialNumber aSerialNumber)
|
LicenseImpl |
createLicenseForSerialNumber(java.lang.String aSerialNumber)
Creates license for given S/N. |
LicenseImpl |
createLicenseForSerialNumber(java.lang.String aSerialNumber,
int aSerialNumberVersion)
Creates license for given S/N. |
protected ProductLicenseWriter |
getLicenseWriter(Product product)
|
ProductsStorage |
getProductsStorage()
Returns products storage |
boolean |
isSkipEncryption()
Checks whether license encryption should be skipped. |
boolean |
isVerbose()
Checks whether writer runs in verbose mode. |
void |
setSkipEncryption(boolean aSkipEncryption)
Specifies that license encryption should be skipped. |
void |
setVerbose(boolean aVerbose)
Specifies that writer should run in verbose mode. |
void |
writeLicense(License aLicense,
java.io.File aFile)
Encodes license and writes it to the specified file |
void |
writeLicense(License aLicense,
java.io.OutputStream anOutputStream)
Encodes license and writes it to the specified stream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean fSkipEncryption
protected ProductsStorage fProductsStorage
protected boolean fVerbose
Constructor Detail |
---|
public LicenseWriterFacade(ProductsStorage aProductsStorage)
LicenseWriterFacade
and associates it
with the specified products storage
aProductsStorage
- products storage to workpublic LicenseWriterFacade(java.io.InputStream aProductsStorageInputStream) throws java.io.IOException
LicenseWriterFacade
and loads a product
storage from the specified stream
aProductsStorageInputStream
- input stream to load a products storage from
java.io.IOException
- in case of errors during a products storage loading processpublic LicenseWriterFacade(java.io.InputStream aProductsStorageInputStream, ProductsStorage.PasswordResolver aPasswordResolver) throws java.io.IOException
LicenseWriterFacade
and loads a product storage from the specified stream
aProductsStorageInputStream
- input stream to load a products storage fromaPasswordResolver
- password resolver to allow opening of read-protected product storage
java.io.IOException
- in case of errors during a products storage loading processpublic LicenseWriterFacade(java.io.File aProductsStorageFile) throws java.io.IOException
LicenseWriterFacade
and loads a product
storage from the specified file
aProductsStorageFile
- file to load a products storage from
java.io.IOException
- in case of errors a products storage loading processMethod Detail |
---|
public ProductsStorage getProductsStorage()
public LicenseImpl createLicenseForAlias(java.lang.String aLicenseAlias, java.lang.String aLicenseNumber)
Creates a license for the specified alias (e.g. UPC code). In the process of the license creation it:
It's responsibility of the developer to assign all other license attributes.
aLicenseAlias
- license alias such as store inventory identifier or UPC codeaLicenseNumber
- license number to assign
License
public LicenseImpl createLicenseForSerialNumber(java.lang.String aSerialNumber) throws SerialNumberException
aSerialNumber
- serial number in textual form to create license for
SerialNumberException
- if S/N is invalidpublic LicenseImpl createLicenseForSerialNumber(java.lang.String aSerialNumber, int aSerialNumberVersion) throws SerialNumberException
aSerialNumber
- serial number in textual form to create license foraSerialNumberVersion
- version of S/N
SerialNumberException
- if S/N is invalidprotected LicenseImpl createLicenseForSerialNumber(SerialNumber aSerialNumber) throws SerialNumberException
SerialNumberException
public LicenseImpl createLicense(java.lang.String aProductID, java.lang.String aProductEditionID, int aLicenseType)
Creates a license for the specified product and product edition. In the process of the license creation it:
It's responsibility of the developer to assign all other license attributes.
aProductID
- identifier of the product for which license would be createdaProductEditionID
- identifier of the product edition for which license would be created.
aProductEditionID can be initialized to null
if the product has no defined editions.aLicenseType
- license type to be created; should be one of the License.TYPE_
constants
License
public static LicenseImpl createLicense(Product aProduct, int aLicenseType)
Creates a license for specified product. In the process of the license creation it:
It's responsibility of the developer to assign all other license attributes.
aProduct
- product to create license for
aProductEditionID can initialized to null
if the product has no defined editions.aLicenseType
- license type to be created; should be one of the License.TYPE_
constants
License
public static LicenseImpl createLicense(Product aProduct, java.lang.String aProductEditionID, int aLicenseType)
Creates a license for specified product and product edition. In the process of the license creation it:
It's responsibility of the developer to assign all other license attributes.
aProduct
- product to create license foraProductEditionID
- ID of the product edition to create license for.
aProductEditionID can initialized to null
if the product has no defined editions.aLicenseType
- license type to be created; should be one of the License.TYPE_
constants
License
public LicenseImpl createLicense(LicenseBase aLicenseInfo)
aLicenseInfo
- license information
public void writeLicense(License aLicense, java.io.File aFile) throws java.io.IOException
aLicense
- license to encode and writeaFile
- file to write license to
java.io.IOException
- in case of errors during license writingprotected ProductLicenseWriter getLicenseWriter(Product product)
public void writeLicense(License aLicense, java.io.OutputStream anOutputStream) throws java.io.IOException
aLicense
- license to encode and writeanOutputStream
- stream to write license to
java.io.IOException
- in case of errors during license writingpublic boolean isSkipEncryption()
true
license encryption should be skipped,
false
otherwise.public void setSkipEncryption(boolean aSkipEncryption)
aSkipEncryption
- true
if license encryption should be skipped, false
otherwise.public boolean isVerbose()
true
if writer runs in verbose mode, false
otherwise.public void setVerbose(boolean aVerbose)
stderr
.
Otherwise there is no output generated in order to prevent the "code flow" analysis.
aVerbose
- true
if writer should run in verbose mode,
false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |