Package io.scanbot.sdk
Class DeviceSession
- java.lang.Object
-
- io.scanbot.sdk.DeviceSession
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class DeviceSession extends java.lang.Object implements java.lang.AutoCloseableConvenience class to manage device usage for a floating license.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_CLOSE_TIMEOUT_MSDefault 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 voidclose()Effectively calls theScanbotSDK.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.
-
-
-
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.TimeoutExceptionEffectively calls theScanbotSDK.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:
closein interfacejava.lang.AutoCloseable- Throws:
java.util.concurrent.TimeoutException
-
-