Interface SzProduct


public interface SzProduct

Defines the Java interface to the Senzing product functions. The Senzing product functions provide information regarding the Senzing product installation and user license.

An SzProduct instance is typically obtained from an SzEnvironment instance via the SzEnvironment.getProduct() method as follows:

// How to obtain an SzProduct instance
try {
    // obtain the SzEnvironment (varies by application)
    SzEnvironment env = getEnvironment();

    SzProduct product = env.getProduct();

    ...

} catch (SzException e) {
    // handle or rethrow the exception
    logError("Failed to get SzProduct.", e);
}

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the currently configured license details.
    Returns the currently installed version details.
  • Method Details

    • getLicense

      String getLicense() throws SzException
      Returns the currently configured license details.

      Usage:

      // How to obtain the Senzing product license JSON
      try {
          // obtain the SzEnvironment (varies by application)
          SzEnvironment env = getEnvironment();
      
          // get the SzProduct instance
          SzProduct product = env.getProduct();
      
          // obtain the license JSON
          String license = product.getLicense();
      
          // do something with the returned JSON (e.g.: parse it and extract values)
          JsonObject jsonObj = Json.createReader(
              new StringReader(license)).readObject();
      
          String  expiration  = jsonObj.getString("expireDate");
          int     recordLimit = jsonObj.getInt("recordLimit");
      
          ...
      
      } catch (SzException e) {
          // handle or rethrow the exception
          logError("Failed to get license information.", e);
      }
      

      Returns:
      The JSON document describing the license details.
      Throws:
      SzException - If a failure occurs.
    • getVersion

      String getVersion() throws SzException
      Returns the currently installed version details.

      Usage:

      // How to obtain the Senzing product version JSON
      try {
          // obtain the SzEnvironment (varies by application)
          SzEnvironment env = getEnvironment();
      
          // get the SzProduct instance
          SzProduct product = env.getProduct();
      
          // obtain the version JSON
          String versionJson = product.getVersion();
      
          // do something with the returned JSON (e.g.: parse it and extract values)
          JsonObject jsonObj = Json.createReader(
              new StringReader(versionJson)).readObject();
      
          String version      = jsonObj.getString("VERSION");
          String buildDate    = jsonObj.getString("BUILD_DATE");
      
          ...
      
      } catch (SzException e) {
          logError("Failed to get version information.", e);
      }
      

      Returns:
      The JSON document of version details.
      Throws:
      SzException - If a failure occurs.