public final class CardSelectionsService
extends java.lang.Object
It provides a way to do an explicit card selection or to post process a default card
selection.
The channel is kept open by default, but can be closed after each selection cases (see
prepareReleaseChannel).
Constructor and Description |
---|
CardSelectionsService()
Alternate constructor for standard usages.
|
CardSelectionsService(MultiSelectionProcessing multiSelectionProcessing)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
AbstractDefaultSelectionsRequest |
getDefaultSelectionsRequest()
The SelectionOperation is the
AbstractDefaultSelectionsRequest to process in ordered to
select a card among others through the selection process. |
void |
prepareReleaseChannel()
Prepare to close the card channel.
If this command is called before a "process" selection command then the last transmission to the PO will be associated with the indication CLOSE_AFTER in order to close the card channel. |
int |
prepareSelection(AbstractCardSelection<? extends AbstractApduCommandBuilder> cardSelectionRequest)
Prepare a selection: add the selection request from the provided selector to the selection
request set.
|
CardSelectionsResult |
processDefaultSelectionsResponse(AbstractDefaultSelectionsResponse defaultSelectionsResponse)
Parses the response to a selection operation sent to a card and return a list of
AbstractSmartCard |
CardSelectionsResult |
processExplicitSelections(Reader reader)
Execute the selection process and return a list of
AbstractSmartCard . |
public CardSelectionsService(MultiSelectionProcessing multiSelectionProcessing)
multiSelectionProcessing
- the multi card processing modepublic CardSelectionsService()
public int prepareSelection(AbstractCardSelection<? extends AbstractApduCommandBuilder> cardSelectionRequest)
cardSelectionRequest
- the selector to preparepublic final void prepareReleaseChannel()
public CardSelectionsResult processDefaultSelectionsResponse(AbstractDefaultSelectionsResponse defaultSelectionsResponse)
AbstractSmartCard
Selection cases that have not matched the current card are set to null.
defaultSelectionsResponse
- the response from the reader to the AbstractDefaultSelectionsRequest
CardSelectionsResult
containing the result of all prepared selection cases,
including AbstractSmartCard
and CardResponse
.KeypleException
- if an error occurs during the selection processpublic CardSelectionsResult processExplicitSelections(Reader reader)
AbstractSmartCard
.
Selection requests are transmitted to the card through the supplied Reader.
The process stops in the following cases:
reader
- the Reader on which the selection is madeCardSelectionsResult
containing the result of all prepared selection cases,
including AbstractSmartCard
and CardResponse
.KeypleReaderIOException
- if the communication with the reader or the card has failedKeypleException
- if an error occurs during the selection processpublic AbstractDefaultSelectionsRequest getDefaultSelectionsRequest()
AbstractDefaultSelectionsRequest
to process in ordered to
select a card among others through the selection process. This method is useful to build the
prepared selection to be executed by a reader just after a card insertion.AbstractDefaultSelectionsRequest
previously prepared with prepareSelection