com.jp.protection.priv.pro
Class SerialNumber

java.lang.Object
  extended by com.jp.protection.priv.pro.SerialNumberBase
      extended by com.jp.protection.priv.pro.SerialNumber

Deprecated. since v2.0; Please use SerialNumber2 and related classes and methods instead

public class SerialNumber
extends SerialNumberBase

This class represents simplified license encoded into the textual form similar to: BUK3X-9AY4Z-O7NM2-D65WG-UKRXC. This simple form allows licenses to be printed on product boxes etc. This version S/N allows holding of the following license attributes:


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jp.protection.priv.pro.SerialNumberBase
SerialNumberBase.KeyCharsGenerator
 
Field Summary
protected static int FIELD_INDEX_CRC
          Deprecated.  
protected static int FIELD_INDEX_LICENSE_NUMBER
          Deprecated.  
protected static int FIELD_INDEX_LICENSE_OPTIONS
          Deprecated.  
protected static int FIELD_INDEX_NUMBER_COPIES
          Deprecated.  
protected static int FIELD_INDEX_PRODUCT
          Deprecated.  
protected static int FIELD_INDEX_PRODUCT_EDITION
          Deprecated.  
protected static int FIELD_INDEX_PRODUCT_VERSION
          Deprecated.  
protected static int[] FIELD_LENGTH_ARRAY
          Deprecated.  
protected  int fLicenseNumber
          Deprecated.  
protected  int fLicenseOptions
          Deprecated.  
protected  int fNumberCopies
          Deprecated.  
protected  int fProduct
          Deprecated.  
protected  int fProductEdition
          Deprecated.  
protected  int fProductVersion
          Deprecated.  
protected static java.text.NumberFormat INTEGER_FORMAT
          Deprecated.  
static int MAX_CRC
          Deprecated.  
static int MAX_LICENSE_NUMBER
          Deprecated.  
static int MAX_LICENSE_NUMBER_CHARS
          Deprecated.  
static int MAX_NUMBER_COPIES
          Deprecated.  
static int MAX_OPTIONS
          Deprecated.  
static int MAX_PRODUCT
          Deprecated.  
static int MAX_PRODUCT_EDITION
          Deprecated.  
static int MAX_PRODUCT_VERSION
          Deprecated.  
static int OPTION_CHECK_NUMBER_OF_COPIES
          Deprecated.  
static int OPTION_REQUIRE_ACTIVATION
          Deprecated.  
static int OPTION_REQUIRE_ACTIVATION_LOCK
          Deprecated.  
static int OPTION_REQUIRE_USER_INFO
          Deprecated.  
protected static java.text.MessageFormat SERIAL_NUMBER_FORMAT
          Deprecated.  
 
Fields inherited from class com.jp.protection.priv.pro.SerialNumberBase
fKeyChars, fKeyCharsStartOffset, N_A, PATTERN, PATTERN_CHAR, PATTERN_DELIMITER
 
Constructor Summary
SerialNumber()
          Deprecated. Creates a new instance of the SerialNumber
SerialNumber(char[] aKeyChars)
          Deprecated. Creates a new instance of the SerialNumber and assigns key characters to it
 
Method Summary
protected  void checkValue(java.lang.String aProperty, int aValue, int aMin, int aMax)
          Deprecated.  
 void decode(java.lang.String aSerialNumber)
          Deprecated. Parses textual representation of the Serial Number
 java.lang.String encode()
          Deprecated. Generates textual representation of the Serial Number
protected  java.lang.String excludeCRC(java.lang.String aValue)
          Deprecated.  
 int getLicenseNumber()
          Deprecated. Returns license number
 int getLicenseOptions()
          Deprecated. Returns license options
 int getNumberCopies()
          Deprecated. Returns number of copies
 int getProduct()
          Deprecated. Returns product short indentifer
 int getProductEdition()
          Deprecated. Returns product edition short indentifer
 int getProductVersion()
          Deprecated. Returns product version
protected  int[] parseFields(java.lang.String aSerialNumber)
          Deprecated.  
 void setLicenseNumber(int aLicenseNumber)
          Deprecated. Specifies license number
 void setLicenseOptions(int aLicenseOptions)
          Deprecated. Specifies license options as any combination of OPTION_ constants
 void setNumberCopies(int aNumberCopies)
          Deprecated. Specifies number of copies
 void setProduct(int aProduct)
          Deprecated. Specifies product short indentifer
 void setProductEdition(int aProductEdition)
          Deprecated. Specifies product edition short indentifer
 void setProductVersion(int aProductVersion)
          Deprecated. Specifies product version
protected  int trancateCRC(long aCRC)
          Deprecated.  
 
Methods inherited from class com.jp.protection.priv.pro.SerialNumberBase
checkValidChars, contains, decode, encode, encode, generateCRC, getKeyChars, getOffset, invalidSerialNumberError, keyCharsNotSpecifiedError, setKeyChars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_NUMBER_COPIES

public static final int MAX_NUMBER_COPIES
Deprecated. 
See Also:
Constant Field Values

MAX_LICENSE_NUMBER

public static final int MAX_LICENSE_NUMBER
Deprecated. 
See Also:
Constant Field Values

MAX_PRODUCT_VERSION

public static final int MAX_PRODUCT_VERSION
Deprecated. 
See Also:
Constant Field Values

MAX_PRODUCT_EDITION

public static final int MAX_PRODUCT_EDITION
Deprecated. 
See Also:
Constant Field Values

MAX_PRODUCT

public static final int MAX_PRODUCT
Deprecated. 
See Also:
Constant Field Values

MAX_CRC

public static final int MAX_CRC
Deprecated. 
See Also:
Constant Field Values

MAX_OPTIONS

public static final int MAX_OPTIONS
Deprecated. 
See Also:
Constant Field Values

MAX_LICENSE_NUMBER_CHARS

public static final int MAX_LICENSE_NUMBER_CHARS
Deprecated. 
See Also:
Constant Field Values

fProduct

protected int fProduct
Deprecated. 

fProductEdition

protected int fProductEdition
Deprecated. 

fProductVersion

protected int fProductVersion
Deprecated. 

fLicenseNumber

protected int fLicenseNumber
Deprecated. 

fLicenseOptions

protected int fLicenseOptions
Deprecated. 

fNumberCopies

protected int fNumberCopies
Deprecated. 

OPTION_REQUIRE_ACTIVATION

public static final int OPTION_REQUIRE_ACTIVATION
Deprecated. 
See Also:
Constant Field Values

OPTION_REQUIRE_ACTIVATION_LOCK

public static final int OPTION_REQUIRE_ACTIVATION_LOCK
Deprecated. 
See Also:
Constant Field Values

OPTION_CHECK_NUMBER_OF_COPIES

public static final int OPTION_CHECK_NUMBER_OF_COPIES
Deprecated. 
See Also:
Constant Field Values

OPTION_REQUIRE_USER_INFO

public static final int OPTION_REQUIRE_USER_INFO
Deprecated. 
See Also:
Constant Field Values

SERIAL_NUMBER_FORMAT

protected static java.text.MessageFormat SERIAL_NUMBER_FORMAT
Deprecated. 

FIELD_LENGTH_ARRAY

protected static int[] FIELD_LENGTH_ARRAY
Deprecated. 

FIELD_INDEX_CRC

protected static final int FIELD_INDEX_CRC
Deprecated. 
See Also:
Constant Field Values

FIELD_INDEX_PRODUCT

protected static final int FIELD_INDEX_PRODUCT
Deprecated. 
See Also:
Constant Field Values

FIELD_INDEX_PRODUCT_EDITION

protected static final int FIELD_INDEX_PRODUCT_EDITION
Deprecated. 
See Also:
Constant Field Values

FIELD_INDEX_PRODUCT_VERSION

protected static final int FIELD_INDEX_PRODUCT_VERSION
Deprecated. 
See Also:
Constant Field Values

FIELD_INDEX_LICENSE_NUMBER

protected static final int FIELD_INDEX_LICENSE_NUMBER
Deprecated. 
See Also:
Constant Field Values

FIELD_INDEX_NUMBER_COPIES

protected static final int FIELD_INDEX_NUMBER_COPIES
Deprecated. 
See Also:
Constant Field Values

FIELD_INDEX_LICENSE_OPTIONS

protected static final int FIELD_INDEX_LICENSE_OPTIONS
Deprecated. 
See Also:
Constant Field Values

INTEGER_FORMAT

protected static java.text.NumberFormat INTEGER_FORMAT
Deprecated. 
Constructor Detail

SerialNumber

public SerialNumber()
Deprecated. 
Creates a new instance of the SerialNumber


SerialNumber

public SerialNumber(char[] aKeyChars)
Deprecated. 
Creates a new instance of the SerialNumber and assigns key characters to it

Parameters:
aKeyChars - key characters
Method Detail

getProduct

public int getProduct()
Deprecated. 
Returns product short indentifer

Returns:
product short indentifer

checkValue

protected void checkValue(java.lang.String aProperty,
                          int aValue,
                          int aMin,
                          int aMax)
                   throws SerialNumberException
Deprecated. 
Throws:
SerialNumberException

setProduct

public void setProduct(int aProduct)
                throws SerialNumberException
Deprecated. 
Specifies product short indentifer

Parameters:
aProduct - product short indentifer
Throws:
SerialNumberException - if product short indentifer has an invalid value

getProductEdition

public int getProductEdition()
Deprecated. 
Returns product edition short indentifer

Returns:
product edition short indentifer

setProductEdition

public void setProductEdition(int aProductEdition)
                       throws SerialNumberException
Deprecated. 
Specifies product edition short indentifer

Parameters:
aProductEdition - product edition short indentifer
Throws:
SerialNumberException - if product edition short indentifer has an invalid value

getProductVersion

public int getProductVersion()
Deprecated. 
Returns product version

Returns:
product version

setProductVersion

public void setProductVersion(int aProductVersion)
                       throws SerialNumberException
Deprecated. 
Specifies product version

Parameters:
aProductVersion - product version
Throws:
SerialNumberException - if product version has an invalid value

getLicenseNumber

public int getLicenseNumber()
Deprecated. 
Returns license number

Returns:
license number

setLicenseNumber

public void setLicenseNumber(int aLicenseNumber)
                      throws SerialNumberException
Deprecated. 
Specifies license number

Parameters:
aLicenseNumber - license number
Throws:
SerialNumberException - if license number has an invalid value

getNumberCopies

public int getNumberCopies()
Deprecated. 
Returns number of copies

Returns:
number of copies

setNumberCopies

public void setNumberCopies(int aNumberCopies)
                     throws SerialNumberException
Deprecated. 
Specifies number of copies

Parameters:
aNumberCopies - number of copies
Throws:
SerialNumberException - if number of copies has an invalid value

getLicenseOptions

public int getLicenseOptions()
Deprecated. 
Returns license options

Returns:
license options

setLicenseOptions

public void setLicenseOptions(int aLicenseOptions)
Deprecated. 
Specifies license options as any combination of OPTION_ constants

Parameters:
aLicenseOptions - license options

encode

public java.lang.String encode()
                        throws SerialNumberException
Deprecated. 
Generates textual representation of the Serial Number

Specified by:
encode in class SerialNumberBase
Returns:
textual representation of the Serial Number
Throws:
SerialNumberException - on any errors

excludeCRC

protected java.lang.String excludeCRC(java.lang.String aValue)
Deprecated. 

trancateCRC

protected int trancateCRC(long aCRC)
Deprecated. 

decode

public void decode(java.lang.String aSerialNumber)
            throws SerialNumberException
Deprecated. 
Parses textual representation of the Serial Number

Specified by:
decode in class SerialNumberBase
Parameters:
aSerialNumber - textual representation of the Serial Number
Throws:
SerialNumberException - if provided textual representation of the Serial Number is invalid

parseFields

protected int[] parseFields(java.lang.String aSerialNumber)
Deprecated.