Package com.senzing.g2.engine
Class G2ProductJNI
- java.lang.Object
-
- com.senzing.g2.engine.G2ProductJNI
-
- All Implemented Interfaces:
G2Fallible
,G2Product
public class G2ProductJNI extends Object implements G2Product
Implements theG2Product
interface to call the native implementations of each function.
-
-
Constructor Summary
Constructors Constructor Description G2ProductJNI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearLastException()
Clears the information about the last error the system received.int
destroy()
Uninitializes the G2 product API.String
getLastException()
Returns a string about the last error the system received.int
getLastExceptionCode()
Returns the exception code of the last error the system received.int
initV2(String moduleName, String iniParams, boolean verboseLogging)
Initializes the G2 product API with the specified module name, init parameters and flag indicating verbose logging.String
license()
Returns the currently configured license details.int
validateLicenseFile(String licenseFile, StringBuffer errorResponse)
Determines whether a specified license file is validString
version()
Returns the currently installed version details
-
-
-
Method Detail
-
initV2
public int initV2(String moduleName, String iniParams, boolean verboseLogging)
Initializes the G2 product API with the specified module name, init parameters and flag indicating verbose logging. If theG2CONFIGFILE
init parameter is absent then the default configuration from the repository is used.- Specified by:
initV2
in interfaceG2Product
- Parameters:
moduleName
- A short name given to this instance of the product API.iniParams
- A JSON string containing configuration parameters.verboseLogging
- Enable diagnostic logging which will print a massive amount of information to stdout.- Returns:
- Zero (0) on success and non-zero on failure.
-
destroy
public int destroy()
Uninitializes the G2 product API.
-
license
public String license()
Returns the currently configured license details.
-
validateLicenseFile
public int validateLicenseFile(String licenseFile, StringBuffer errorResponse)
Determines whether a specified license file is valid- Specified by:
validateLicenseFile
in interfaceG2Product
- Parameters:
licenseFile
- The patherrorResponse
- TheStringBuffer
to write any error response to (if an error occurs).- Returns:
- Zero (0) for valid license, one (1) for invalid, and a negative number for errors.
-
version
public String version()
Returns the currently installed version details
-
getLastException
public String getLastException()
Returns a string about the last error the system received. This is most commonly called after an API function returns an error code (non-zero or NULL)- Specified by:
getLastException
in interfaceG2Fallible
- Returns:
- An error message
-
getLastExceptionCode
public int getLastExceptionCode()
Returns the exception code of the last error the system received. This is most commonly called after an API function returns an error code (non-zero or NULL)- Specified by:
getLastExceptionCode
in interfaceG2Fallible
- Returns:
- An error code
-
clearLastException
public void clearLastException()
Clears the information about the last error the system received.- Specified by:
clearLastException
in interfaceG2Fallible
-
-