Class DeviceSession

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class DeviceSession
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Convenience class to manage device usage for a floating license.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_CLOSE_TIMEOUT_MS
      Default timeout for device deregistration in milliseconds which is used if no timeout is specified.
    • Constructor Summary

      Constructors 
      Constructor Description
      DeviceSession()
      Constructor to create a DeviceSession with a default timeout 15000 milliseconds (15 seconds).
      DeviceSession​(int closeTimeoutMs)
      Constructor to create a DeviceSession with a given close timeout.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Effectively calls the ScanbotSDK.deregisterDevice() method to notify the server that the device is no longer using the license and then waits for the completion of the deregistration process.
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_CLOSE_TIMEOUT_MS

        public static final int DEFAULT_CLOSE_TIMEOUT_MS
        Default timeout for device deregistration in milliseconds which is used if no timeout is specified.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DeviceSession

        public DeviceSession​(int closeTimeoutMs)
        Constructor to create a DeviceSession with a given close timeout.
        Parameters:
        closeTimeoutMs - The timeout in milliseconds for device deregistration.
      • DeviceSession

        public DeviceSession()
        Constructor to create a DeviceSession with a default timeout 15000 milliseconds (15 seconds).
    • Method Detail

      • close

        public void close()
                   throws java.util.concurrent.TimeoutException
        Effectively calls the ScanbotSDK.deregisterDevice() method to notify the server that the device is no longer using the license and then waits for the completion of the deregistration process.
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.util.concurrent.TimeoutException