Package io.scanbot.sdk
Class DeviceSession
java.lang.Object
io.scanbot.sdk.DeviceSession
- All Implemented Interfaces:
AutoCloseable
Convenience class to manage device usage for a floating license.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault timeout for device deregistration in milliseconds which is used if no timeout is specified. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor 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
Modifier and TypeMethodDescriptionvoidclose()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 Details
-
DEFAULT_CLOSE_TIMEOUT_MS
public static final int DEFAULT_CLOSE_TIMEOUT_MSDefault timeout for device deregistration in milliseconds which is used if no timeout is specified.- See Also:
-
-
Constructor Details
-
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 Details
-
close
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.- Specified by:
closein interfaceAutoCloseable- Throws:
TimeoutException
-