public class BeIDCards extends Object
BeIDCardManager
(but BeIDCards uses an underlying
BeIDCardManager
to achieve it's goals). It's main purpose is to have
a very simple way to get a user's BeIDCard instance, abstracting away and
delegating issues such as terminal connection, card insertion, and handling
multiple eligible cards.
BeIDCards handle user interaction (if any) through an instance of BeIDCardsUI, which can be supplied at construction, or left to the supplied default, which will instantiate a be.fedict.commons.eid.dialogs.DefaultBeIDCardsUI (which needs to be available on the class path)
Constructor and Description |
---|
BeIDCards()
a BeIDCards without logging, using the default BeIDCardsUI
|
BeIDCards(BeIDCardsUI ui)
a BeIDCards without logging, using the supplied BeIDCardsUI
|
BeIDCards(Logger logger)
a BeIDCards logging to supplied logger, using the default BeIDCardsUI
|
BeIDCards(Logger logger,
BeIDCardsUI ui)
a BeIDCards logging to logger, using the supplied BeIDCardsUI and locale
|
Modifier and Type | Method and Description |
---|---|
BeIDCards |
close()
call close() if you no longer need this BeIDCards instance.
|
Set<BeIDCard> |
getAllBeIDCards()
return Set of all BeID Cards present.
|
Locale |
getLocale() |
BeIDCard |
getOneBeIDCard()
return exactly one BeID Card.
|
BeIDCard |
getOneBeIDCard(javax.smartcardio.CardTerminal terminal)
return a BeID Card inserted into a given CardTerminal
|
boolean |
hasBeIDCards()
Return whether any BeID Cards are currently present.
|
boolean |
hasBeIDCards(javax.smartcardio.CardTerminal terminal)
Return whether any BeID Cards are currently present.
|
boolean |
hasCardTerminals() |
BeIDCards |
setLocale(Locale newLocale)
Set the Locale to use for subsequent UI operations.
|
BeIDCards |
waitUntilCardRemoved(BeIDCard card)
wait for a particular BeID card to be removed.
|
public BeIDCards()
public BeIDCards(BeIDCardsUI ui)
ui
- an instance of be.fedict.commons.eid.client.spi.BeIDCardsUI that
will be called upon for any user interaction required to handle
other calls. The UI's Locale will be used globally for subsequent
UI actions, as if setLocale() was called, except where the Locale
is explicity set for individual BeIDCard instances.public BeIDCards(Logger logger)
logger
- an instance of be.fedict.commons.eid.spi.Logger that will be
send all the logspublic BeIDCards(Logger logger, BeIDCardsUI ui)
logger
- an instance of be.fedict.commons.eid.spi.Logger that will be
send all the logsui
- an instance of be.fedict.commons.eid.client.spi.BeIDCardsUI
that will be called upon for any user interaction required to
handle other calls. The UI's Locale will be used globally for
subsequent UI actions, as if setLocale() was called, except
where the Locale is explicity set for individual BeIDCard
instances.public boolean hasBeIDCards()
public boolean hasBeIDCards(javax.smartcardio.CardTerminal terminal)
terminal
- if not null, only this terminal will be considered in
determining whether beID Cards are present.public Set<BeIDCard> getAllBeIDCards()
public BeIDCard getOneBeIDCard() throws CancelledException
CancelledException
public BeIDCard getOneBeIDCard(javax.smartcardio.CardTerminal terminal) throws CancelledException
terminal
- if not null, only BeID Cards in this particular CardTerminal
will be considered.
May block when called when no BeID Cards are present, until
at least one BeID card is inserted, at which point this will
be returned. If, at time of call, more than one BeID card is
present, will request the UI to select between those, and
return the selected card. If the UI is called upon to request
the user to select between different cards, or to insert one
card, and the user declines, CancelledException is thrown.CancelledException
public BeIDCards waitUntilCardRemoved(BeIDCard card)
getOneBeIDCard()
or
getAllBeIDCards()
methods from the same BeIDCards instance. If, at
time of call, that particular card is present, the UI is called upon to
prompt the user to remove that card.card
- public boolean hasCardTerminals()
public BeIDCards close() throws InterruptedException
InterruptedException
public BeIDCards setLocale(Locale newLocale)
newLocale
- will be used globally for subsequent UI actions, as if
setLocale() was called, except where the Locale is explicity
set for individual BeIDCard instances.public Locale getLocale()
Copyright © 2012–2024 e-Contract.be BV. All rights reserved.