public abstract class CardTerminal
extends java.lang.Object
Note that physical card readers with slots for multiple cards are
represented by one CardTerminal object per such slot.
CardTerminals,
TerminalFactory| Modifier | Constructor and Description |
|---|---|
protected |
CardTerminal()
Constructs a new CardTerminal object.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Card |
connect(java.lang.String protocol)
Establishes a connection to the card.
|
abstract java.lang.String |
getName()
Returns the unique name of this terminal.
|
abstract boolean |
isCardPresent()
Returns whether a card is present in this terminal.
|
abstract boolean |
waitForCardAbsent(long timeout)
Waits until a card is absent in this terminal or the timeout
expires.
|
abstract boolean |
waitForCardPresent(long timeout)
Waits until a card is present in this terminal or the timeout
expires.
|
protected CardTerminal()
This constructor is called by subclasses only. Application should call list() or getTerminal() to obtain a CardTerminal object.
public abstract java.lang.String getName()
public abstract Card connect(java.lang.String protocol) throws CardException
protocol - the protocol to use ("T=0", "T=1", or "T=CL"), or "*" to
connect using any available protocol.java.lang.NullPointerException - if protocol is nulljava.lang.IllegalArgumentException - if protocol is an invalid protocol
specificationCardNotPresentException - if no card is present in this terminalCardException - if a connection could not be established
using the specified protocol or if a connection has previously been
established using a different protocoljava.lang.SecurityException - if a SecurityManager exists and the
caller does not have the required
permissionpublic abstract boolean isCardPresent()
throws CardException
CardException - if the status could not be determinedpublic abstract boolean waitForCardPresent(long timeout)
throws CardException
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 negativejava.lang.IllegalArgumentException - if timeout is negativeCardException - if the operation failedpublic abstract boolean waitForCardAbsent(long timeout)
throws CardException
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 negativejava.lang.IllegalArgumentException - if timeout is negativeCardException - if the operation failed