public class PoSelection extends org.eclipse.keyple.core.card.selection.AbstractCardSelection<AbstractPoCommandBuilder<? extends AbstractPoResponseParser>>
AbstractCardSelection to manage specific features of Calypso POs
during the selection step.
The prefixed "prepare" methods allow to feed the global selection process by sending APDU orders to the PO after the card selection. These APUDs will be sent to the PO in the order in which they were prepared.
The parse method creates a CalypsoPo from the CardSelectionResponse received.
| Constructor and Description |
|---|
PoSelection(PoSelector poSelector)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected CalypsoPo |
parse(org.eclipse.keyple.core.card.message.CardSelectionResponse cardSelectionResponse)
Parses the provided
CardSelectionResponse and create a CalypsoPo object. |
void |
prepareReadRecordFile(byte sfi,
int recordNumber)
Adds a command APDU to read a single record from the indicated EF.
|
void |
prepareSelectFile(byte[] lid)
Adds a command APDU to select file with an LID provided as a 2-byte byte array.
|
void |
prepareSelectFile(SelectFileControl selectControl)
Adds a command APDU to select file according to the provided
SelectFileControl enum
entry indicating the navigation case: FIRST, NEXT or CURRENT. |
void |
prepareSelectFile(short lid)
Adds a command APDU to select file with an LID provided as a short.
|
public PoSelection(PoSelector poSelector)
The PoSelector provided contains the selection data to target a particular PO.
poSelector - A reference to a PoSelectorpublic final void prepareReadRecordFile(byte sfi,
int recordNumber)
sfi - the SFI of the EF to readrecordNumber - the record number to readjava.lang.IllegalArgumentException - if one of the provided argument is out of rangepublic void prepareSelectFile(byte[] lid)
lid - LID of the EF to select as a byte arrayjava.lang.IllegalArgumentException - if the argument is not an array of 2 bytespublic void prepareSelectFile(short lid)
lid - A shortpublic void prepareSelectFile(SelectFileControl selectControl)
SelectFileControl enum
entry indicating the navigation case: FIRST, NEXT or CURRENT.selectControl - A SelectFileControl enum entryprotected CalypsoPo parse(org.eclipse.keyple.core.card.message.CardSelectionResponse cardSelectionResponse)
CardSelectionResponse and create a CalypsoPo object.
The CalypsoPo is filled with the PO identification data from the FCI and the
possible responses to additional APDU commands executed after the selection.
parse in class org.eclipse.keyple.core.card.selection.AbstractCardSelection<AbstractPoCommandBuilder<? extends AbstractPoResponseParser>>cardSelectionResponse - A reference to a CardSelectionResponseCalypsoPoCalypsoDesynchronizedExchangesException - if the number of responses is different from
the number of requestsCalypsoPoCommandException - if a response from the PO was unexpected