java.lang.Object | |
↳ | javax.smartcardio.CardTerminal |
A Smart Card terminal, sometimes refered to as a Smart Card Reader.
A CardTerminal object can be obtained by calling
list()
or CardTerminals.getTerminal()
.
Note that physical card readers with slots for multiple cards are
represented by one CardTerminal
object per such slot.
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new CardTerminal object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Establishes a connection to the card.
| |||||||||||
Returns the unique name of this terminal.
| |||||||||||
Returns whether a card is present in this terminal.
| |||||||||||
Waits until a card is absent in this terminal or the timeout
expires.
| |||||||||||
Waits until a card is present in this terminal or the timeout
expires.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constructs a new CardTerminal object.
This constructor is called by subclasses only. Application should
call list()
or getTerminal()
to obtain a CardTerminal object.
Establishes a connection to the card. If a connection has previously established using the specified protocol, this method returns the same Card object as the previous call.
protocol | the protocol to use ("T=0", "T=1", or "T=CL"), or "*" to connect using any available protocol. |
---|
NullPointerException | if protocol is null |
---|---|
IllegalArgumentException | if protocol is an invalid protocol specification |
CardNotPresentException | if no card is present in this terminal |
CardException | if a connection could not be established using the specified protocol or if a connection has previously been established using a different protocol |
SecurityException | if a SecurityManager exists and the
caller does not have the required
permission
|
Returns the unique name of this terminal.
Returns whether a card is present in this terminal.
CardException | if the status could not be determined |
---|
Waits until a card is absent in this terminal or the timeout expires. If the method returns due to an expired timeout, it returns false. Otherwise it return true.
If no card is present in this terminal when this method is called, it returns immediately.
timeout | if positive, block for up to timeout
milliseconds; if zero, block indefinitely; must not be negative |
---|
IllegalArgumentException | if timeout is negative |
---|---|
CardException | if the operation failed |
Waits until a card is present in this terminal or the timeout expires. If the method returns due to an expired timeout, it returns false. Otherwise it return true.
If a card is present in this terminal when this method is called, it returns immediately.
timeout | if positive, block for up to timeout
milliseconds; if zero, block indefinitely; must not be negative |
---|
IllegalArgumentException | if timeout is negative |
---|---|
CardException | if the operation failed |