eID middleware |

# be.portugal.eid.PTEID_ReaderContext Class Reference

This class represent a reader. More...

Inheritance diagram for be.portugal.eid.PTEID_ReaderContext:

List of all members.

## Public Member Functions
synchronized void | delete ()
| PTEID_ReaderContext (PTEID_FileType fileType, String fileName)
| Constructor using a fileType and fileName (virtual card reader).
| PTEID_ReaderContext (PTEID_FileType fileType, PTEID_ByteArray data)
| Constructor using a fileType and its content (for compatibility with SetRawFile()).
| PTEID_ReaderContext (PTEID_RawData_Eid data)
| Constructor using Raw data for an Eid card No reader are connected (m_reader=NULL).
| PTEID_ReaderContext (PTEID_RawData_Sis data)
| Constructor using Raw data for a Sis card No reader are connected (m_reader=NULL).
String | getName () throws java.lang.Exception
| Get the name of the reader.
boolean | isCardPresent () throws java.lang.Exception
| Return true if a card is present in the reader and false otherwise.
void | releaseCard (boolean bAllReference) throws java.lang.Exception
| Release the card.
void | releaseCard () throws java.lang.Exception
boolean | isCardChanged (PTEID_ulwrapper ulOldId) throws java.lang.Exception
| Check if the card in the reader is changed.
PTEID_CardType | getCardType () throws java.lang.Exception
| Return the type of the card in the reader.
PTEID_Card | getCard () throws java.lang.Exception
| Get the card in the reader Instantiation is made regarding the type of the card (PTEID_EIDCard, PTEID_KidsCard, PTEID_ForeignerCard or PTEID_SISCard).
PTEID_EIDCard | getEIDCard () throws java.lang.Exception
| Get the EIDcard in the reader Instantiation is made regarding the type of the card (PTEID_EIDCard, PTEID_KidsCard, PTEID_ForeignerCard).
PTEID_KidsCard | getKidsCard () throws java.lang.Exception
| Get the KidsCard in the reader.
PTEID_ForeignerCard | getForeignerCard () throws java.lang.Exception
| Get the ForeignerCard in the reader.
PTEID_SISCard | getSISCard () throws java.lang.Exception
| Get the SISCard in the reader.
long | SetEventCallback (Callback callback, Object pvRef) throws java.lang.Exception
| Specify a callback object to be used each time a card is inserted/removed in/from this reader.
void | StopEventCallback (long ulHandle) throws java.lang.Exception
| Stop the callback for this card reader.
void | BeginTransaction () throws java.lang.Exception
| Begin a transaction with the reader.
void | EndTransaction () throws java.lang.Exception
| End the transaction.
boolean | isVirtualReader () throws java.lang.Exception
| Return true if this is a virtual reader (created from a file).
## Static Public Member Functions
static void | doJavaCallBack (int iKey, long lRet, long ulState)
## Protected Member Functions
| PTEID_ReaderContext (long cPtr, boolean cMemoryOwn)
void | finalize ()
## Static Protected Member Functions
static long | getCPtr (PTEID_ReaderContext obj)

## Detailed Description

This class represent a reader.

A reader object can be obtained from the ReaderSet either by its index (getReaderByNum()) or by its name (getReaderByName()). Once you have a reader object, it can be checked if a card is present (isCardPresent()). Using the type of card (getCardType()), a card object can be obtained using: getCard(), getEIDCard(), getKidsCard(), getForeignerCard() or getSISCard()

## Constructor & Destructor Documentation

be.portugal.eid.PTEID_ReaderContext.PTEID_ReaderContext | ( | long | cPtr,
|  | boolean | cMemoryOwn |
| ) |  |  | `[protected]`

be.portugal.eid.PTEID_ReaderContext.PTEID_ReaderContext | ( | PTEID_FileType | fileType,
|  | String | fileName |
| ) |  |  |

Constructor using a fileType and fileName (virtual card reader).

References be.portugal.eid.PTEID_FileType.swigValue.

be.portugal.eid.PTEID_ReaderContext.PTEID_ReaderContext | ( | PTEID_FileType | fileType,
|  | PTEID_ByteArray | data |
| ) |  |  |

Constructor using a fileType and its content (for compatibility with SetRawFile()).

References be.portugal.eid.PTEID_FileType.swigValue.

be.portugal.eid.PTEID_ReaderContext.PTEID_ReaderContext | ( | PTEID_RawData_Eid | data | ) |

Constructor using Raw data for an Eid card No reader are connected (m_reader=NULL).

be.portugal.eid.PTEID_ReaderContext.PTEID_ReaderContext | ( | PTEID_RawData_Sis | data | ) |

Constructor using Raw data for a Sis card No reader are connected (m_reader=NULL).

## Member Function Documentation

void be.portugal.eid.PTEID_ReaderContext.BeginTransaction | ( |  | ) | throws java.lang.Exception

Begin a transaction with the reader.

synchronized void be.portugal.eid.PTEID_ReaderContext.delete | ( |  | ) |

Reimplemented from be.portugal.eid.PTEID_Object.

References be.portugal.eid.PTEID_Object.swigCMemOwn.

static void be.portugal.eid.PTEID_ReaderContext.doJavaCallBack | ( | int | iKey,
|  | long | lRet,
|  | long | ulState |
| ) |  |  | `[static]`

void be.portugal.eid.PTEID_ReaderContext.EndTransaction | ( |  | ) | throws java.lang.Exception

End the transaction.

void be.portugal.eid.PTEID_ReaderContext.finalize | ( |  | ) | `[protected]`

Reimplemented from be.portugal.eid.PTEID_Object.

PTEID_Card be.portugal.eid.PTEID_ReaderContext.getCard | ( |  | ) | throws java.lang.Exception

Get the card in the reader Instantiation is made regarding the type of the card (PTEID_EIDCard, PTEID_KidsCard, PTEID_ForeignerCard or PTEID_SISCard).

If no card is present in the reader, exception PTEID_ExNoCardPresent() is thrown If the card type is not supported, exception PTEID_ExCardTypeUnknown() is thrown

PTEID_CardType be.portugal.eid.PTEID_ReaderContext.getCardType | ( |  | ) | throws java.lang.Exception

Return the type of the card in the reader.

Throws PTEID_ExNoCardPresent() exception if no card is present

References be.portugal.eid.PTEID_CardType.swigToEnum().

static long be.portugal.eid.PTEID_ReaderContext.getCPtr | ( | PTEID_ReaderContext | obj | ) | `[static, protected]`

References be.portugal.eid.PTEID_ReaderContext.swigCPtr.

PTEID_EIDCard be.portugal.eid.PTEID_ReaderContext.getEIDCard | ( |  | ) | throws java.lang.Exception

Get the EIDcard in the reader Instantiation is made regarding the type of the card (PTEID_EIDCard, PTEID_KidsCard, PTEID_ForeignerCard).

If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown If the card is not an EIDcard, exception PTEID_ExCardBadType is thrown

PTEID_ForeignerCard be.portugal.eid.PTEID_ReaderContext.getForeignerCard | ( |  | ) | throws java.lang.Exception

Get the ForeignerCard in the reader.

If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown If the card is not a ForeignerCard, exception PTEID_ExCardBadType is thrown

PTEID_KidsCard be.portugal.eid.PTEID_ReaderContext.getKidsCard | ( |  | ) | throws java.lang.Exception

Get the KidsCard in the reader.

If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown If the card is not a KidsCard, exception PTEID_ExCardBadType is thrown

String be.portugal.eid.PTEID_ReaderContext.getName | ( |  | ) | throws java.lang.Exception

Get the name of the reader.

PTEID_SISCard be.portugal.eid.PTEID_ReaderContext.getSISCard | ( |  | ) | throws java.lang.Exception

Get the SISCard in the reader.

If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown If the card is not a SISCard, exception PTEID_ExCardBadType is thrown

boolean be.portugal.eid.PTEID_ReaderContext.isCardChanged | ( | PTEID_ulwrapper | ulOldId | ) | throws java.lang.Exception

Check if the card in the reader is changed.

Parameters:

  | ulOldId | the Id received when setting the callback for this reader

boolean be.portugal.eid.PTEID_ReaderContext.isCardPresent | ( |  | ) | throws java.lang.Exception

Return true if a card is present in the reader and false otherwise.

boolean be.portugal.eid.PTEID_ReaderContext.isVirtualReader | ( |  | ) | throws java.lang.Exception

Return true if this is a virtual reader (created from a file).

void be.portugal.eid.PTEID_ReaderContext.releaseCard | ( |  | ) | throws java.lang.Exception

void be.portugal.eid.PTEID_ReaderContext.releaseCard | ( | boolean | bAllReference | ) | throws java.lang.Exception

Release the card.

Parameters:

  | bAllReference | If true all the invalid reference/pointer are destroyed. THIS PARAMETER IS THREAD UNSAFE. You have to be sure that you will not use any old reference/pointer after calling this function

long be.portugal.eid.PTEID_ReaderContext.SetEventCallback | ( | Callback | callback,
|  | Object | pvRef |
| ) |  |  | throws java.lang.Exception

Specify a callback object to be used each time a card is inserted/removed in/from this reader.

Returns:
  A handle that can be used to stop the callbacks when they are no longer needed.

void be.portugal.eid.PTEID_ReaderContext.StopEventCallback | ( | long | ulHandle | ) | throws java.lang.Exception

Stop the callback for this card reader.

Parameters:

  | ulHandle | the handle returned by SetEventCallback()