Package com.labs64.netlicensing.service
Class ValidationService
java.lang.Object
com.labs64.netlicensing.service.ValidationService
Provides routines for validating the licenses.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Netlicensing
retrieveValidationFile
(Context context, String number, ValidationParameters validationParameters) Retrieves validation file for the given licensee from the server asNetlicensing
object.static ValidationResult
validate
(Context context, String number, ValidationParameters validationParameters, MetaInfo... meta) Validates active licenses of the licensee.static ValidationResult
validateOffline
(Context context, Netlicensing validationFile, MetaInfo... meta) Perform validation without connecting to the server (offline) using validation file previously retrieved byretrieveValidationFile(com.labs64.netlicensing.domain.vo.Context, java.lang.String, com.labs64.netlicensing.domain.vo.ValidationParameters)
.
-
Constructor Details
-
ValidationService
public ValidationService()
-
-
Method Details
-
validate
public static ValidationResult validate(Context context, String number, ValidationParameters validationParameters, MetaInfo... meta) throws NetLicensingException Validates active licenses of the licensee.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- licensee numbervalidationParameters
- optional validation parameters. See ValidationParameters and licensing model documentation for details.meta
- optional parameter, receiving messages returned within responsesection. - Returns:
- result of the validation
- Throws:
NetLicensingException
- in case of a service error. Check subclass and message for details.
-
retrieveValidationFile
public static Netlicensing retrieveValidationFile(Context context, String number, ValidationParameters validationParameters) throws NetLicensingException Retrieves validation file for the given licensee from the server asNetlicensing
object. The file can be stored locally for subsequent validation byvalidateOffline(com.labs64.netlicensing.domain.vo.Context, com.labs64.netlicensing.schema.context.Netlicensing, com.labs64.netlicensing.domain.vo.MetaInfo...)
method, that doesn't require connection to the server.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- licensee numbervalidationParameters
- optional validation parameters. See ValidationParameters and licensing model documentation for details.- Returns:
- validation file, possibly signed, for subsequent use in
validateOffline(com.labs64.netlicensing.domain.vo.Context, com.labs64.netlicensing.schema.context.Netlicensing, com.labs64.netlicensing.domain.vo.MetaInfo...)
- Throws:
NetLicensingException
- in case of a service error. Check subclass and message for details.
-
validateOffline
public static ValidationResult validateOffline(Context context, Netlicensing validationFile, MetaInfo... meta) throws NetLicensingException Perform validation without connecting to the server (offline) using validation file previously retrieved byretrieveValidationFile(com.labs64.netlicensing.domain.vo.Context, java.lang.String, com.labs64.netlicensing.domain.vo.ValidationParameters)
.- Parameters:
context
- determines the vendor on whose behalf the call is performedvalidationFile
- validation file returned byretrieveValidationFile(com.labs64.netlicensing.domain.vo.Context, java.lang.String, com.labs64.netlicensing.domain.vo.ValidationParameters)
call- Returns:
- result of the validation
- Throws:
NetLicensingException
- in case of a service error. Check subclass and message for details.
-