Package org.jopensignature.sign
Interface SigningDevice
-
- All Known Implementing Classes:
NativeColorDevice
,NativeDevice
,NativeG12Device
,NativeG13Device
,NativeMonochromeDevice
,SoHeadlessSigningDevice
,SoSigningDevice
public interface SigningDevice
Representation of a typically physical signing device.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SigningDevice.UnsupportedMessageException
Indicates a unsupportedmessage
sent usingsend(BaseMessage)
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
SigningDeviceCapabilities
getCapabilities()
Returns the device capabilities.java.lang.String
getIdentifier()
Returns a unique identifier of the SigningDevice.SigningDeviceInfo
getInfo(java.util.Locale locale)
void
send(BaseMessage message)
Send the givenBaseMessage
instance to the device.
-
-
-
Method Detail
-
getCapabilities
SigningDeviceCapabilities getCapabilities()
Returns the device capabilities.- Returns:
-
getIdentifier
java.lang.String getIdentifier()
Returns a unique identifier of the SigningDevice. TheSignatureServiceProvider
implementation has to ensure that all theSigningDevice
s it returns have a unique identifier. Identifiers forSigningDevice
s coming from differentSignatureServiceProvider
s might have overlapping identifiers.- Returns:
-
getInfo
SigningDeviceInfo getInfo(java.util.Locale locale)
- Parameters:
locale
- the locale in which theSigningDeviceInfo
shall be returned. Iflocale
isnull
,Locale.getDefault()
shall be used. If there is no matching translation is available, the implementation shall use the closest substitute. How a substitute is selected is up to the implementation. We encourage to follow the guidelines ofResourceBundle
.
-
send
void send(BaseMessage message) throws SigningDevice.UnsupportedMessageException
Send the givenBaseMessage
instance to the device. Somemessages
might require replies. Receiving replies may be achieved by sending messages extendingReplyableMessage
.- Parameters:
message
- themessage
to be sent- Throws:
java.lang.IllegalArgumentException
- ifmessage
isnull
.SigningDevice.UnsupportedMessageException
- if themessage
is unsupported. Whether amessage
is supported or not, may be checked usinggetCapabilities()
.isMessageSupported(Class)
-
close
void close()
-
-