gov.nasa.arc.brahms.common.data
Class Validator

java.lang.Object
  extended by gov.nasa.arc.brahms.common.data.Validator

public final class Validator
extends java.lang.Object

Validator is responsible for reading, decoding and validating a license file.

Version:
4 March 2002
Author:
Ron van Hoof

Field Summary
static int ERROR_READING_FILE
           
static int INVALID_LICENSE_KEY
           
static int LICENSE_KEY_EXPIRED
           
static int VALID_LICENSE_KEY
           
 
Constructor Summary
Validator()
           
 
Method Summary
 java.lang.String getApplicationName()
          Returns the application name for which this license is valid
 java.util.GregorianCalendar getExpirationDate()
          Returns the expiration date set in the license, null if the license doesn't expire.
 int getMajorVersion()
          Returns the major version number of the application for which this license is valid.
 java.lang.String getMinorVersion()
          Returns the minor version number of the application for which this license is valid
 java.lang.String getSerialNumber()
          Returns the serial number assigned to the application.
 int validateLicense(java.io.File licenseFile)
          Reads in the specified license file and validates its contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALID_LICENSE_KEY

public static final int VALID_LICENSE_KEY
See Also:
Constant Field Values

ERROR_READING_FILE

public static final int ERROR_READING_FILE
See Also:
Constant Field Values

INVALID_LICENSE_KEY

public static final int INVALID_LICENSE_KEY
See Also:
Constant Field Values

LICENSE_KEY_EXPIRED

public static final int LICENSE_KEY_EXPIRED
See Also:
Constant Field Values
Constructor Detail

Validator

public Validator()
Method Detail

validateLicense

public int validateLicense(java.io.File licenseFile)
Reads in the specified license file and validates its contents.

Parameters:
licenseFile - the license file to be validated
Returns:
int -1 if the license is ok, an error code > 0 if not

getApplicationName

public java.lang.String getApplicationName()
Returns the application name for which this license is valid

Returns:
String the application name

getMajorVersion

public int getMajorVersion()
Returns the major version number of the application for which this license is valid.

Returns:
int the major version number

getMinorVersion

public java.lang.String getMinorVersion()
Returns the minor version number of the application for which this license is valid

Returns:
String the minor version

getSerialNumber

public java.lang.String getSerialNumber()
Returns the serial number assigned to the application.

Returns:
String the serial number

getExpirationDate

public java.util.GregorianCalendar getExpirationDate()
Returns the expiration date set in the license, null if the license doesn't expire.

Returns:
GregorianCalendar the expiration date if the license expires, null if the license does not expire.


Copyright © 1997-2012 All Rights Reserved.