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 theG2Productinterface 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 voidclearLastException()Clears the information about the last error the system received.intdestroy()Uninitializes the G2 product API.StringgetLastException()Returns a string about the last error the system received.intgetLastExceptionCode()Returns the exception code of the last error the system received.intinitV2(String moduleName, String iniParams, boolean verboseLogging)Initializes the G2 product API with the specified module name, init parameters and flag indicating verbose logging.Stringlicense()Returns the currently configured license details.intvalidateLicenseFile(String licenseFile, StringBuffer errorResponse)Determines whether a specified license file is validStringversion()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 theG2CONFIGFILEinit parameter is absent then the default configuration from the repository is used.- Specified by:
initV2in 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:
validateLicenseFilein interfaceG2Product- Parameters:
licenseFile- The patherrorResponse- TheStringBufferto 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:
getLastExceptionin 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:
getLastExceptionCodein interfaceG2Fallible- Returns:
- An error code
-
clearLastException
public void clearLastException()
Clears the information about the last error the system received.- Specified by:
clearLastExceptionin interfaceG2Fallible
-
-