Class ScanbotSDK


  • public class ScanbotSDK
    extends java.lang.Object
    The class is responsible for initializing the Scanbot SDK functionality and managing global SDK settings.
    • Constructor Summary

      Constructors 
      Constructor Description
      ScanbotSDK()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void deregisterDevice()
      Effectively notifies the server that the license is no longer used by this device.
      static LicenseInfo getLicenseInfo()
      Returns the current license info.
      static void initialize​(java.lang.String licenceKey, java.lang.String writablePath)
      Initializes the Scanbot SDK with the given license key.
      static void setLogging​(boolean enable)
      Sets the logging state of the SDK.
      static void waitForDeviceDeregistrationCompletion​(int timeoutMs)
      Wait for the completion of the all device deregistration processes.
      static void waitForOnlineLicenseCheckCompletion​(int timeoutMs)
      Wait for the completion of the online license check.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ScanbotSDK

        public ScanbotSDK()
    • Method Detail

      • initialize

        public static void initialize​(java.lang.String licenceKey,
                                      java.lang.String writablePath)
                               throws java.io.IOException,
                                      LicenseException
        Initializes the Scanbot SDK with the given license key. Should be called before creating any other SDK objects.
        Parameters:
        licenceKey - The license key that was provided to you.
        writablePath - The path to a writable directory where the SDK can store temporary files.
        Throws:
        java.io.IOException - If an io operation on writable path failed.
        LicenseException - If failed to initialize the SDK with the given license key.
      • deregisterDevice

        public static void deregisterDevice()
        Effectively notifies the server that the license is no longer used by this device. After calling the method SDK behaves like no license is available. You should call this method if you are using floating license to notify the server that the device is no longer using the license and so another device can use it. If you are using a floating license, but you do not call this method, the license will be released automatically after a period specified in the license. If during work with the SDK you initialize the SDK with multiple licenses, there is no need to call the function after finishing work with each of the licenses, only with the last one. For others, the function is implicitly called automatically. The function returns immediately, but the deregistration process may take some time. You can use DeviceSession helper class to use this method in a try-with-resources statement.
      • waitForDeviceDeregistrationCompletion

        public static void waitForDeviceDeregistrationCompletion​(int timeoutMs)
                                                          throws java.util.concurrent.TimeoutException
        Wait for the completion of the all device deregistration processes. Returns immediately if there's no deregistration in progress. See deregisterDevice().
        Parameters:
        timeoutMs - Timeout in milliseconds to wait for the device deregistration.
        Throws:
        java.util.concurrent.TimeoutException - If the device deregistration did not complete within the given timeout.
      • getLicenseInfo

        public static LicenseInfo getLicenseInfo()
        Returns the current license info.
        Returns:
        The current license info.
      • setLogging

        public static void setLogging​(boolean enable)
        Sets the logging state of the SDK.
        Parameters:
        enable - If true, the SDK will log messages to the console.
      • waitForOnlineLicenseCheckCompletion

        public static void waitForOnlineLicenseCheckCompletion​(int timeoutMs)
                                                        throws java.util.concurrent.TimeoutException
        Wait for the completion of the online license check. Returns immediately if there's no online license check in progress.
        Parameters:
        timeoutMs - : Timeout in milliseconds
        Throws:
        java.util.concurrent.TimeoutException - if the online license check did not complete within the given timeout