Package pt.gov.cartaodecidadao
Class PTEID_ReaderSet
java.lang.Object
pt.gov.cartaodecidadao.PTEID_Object
pt.gov.cartaodecidadao.PTEID_ReaderSet
This is a singleton class that is the starting point to get all other objects.
You get an instance from the static instance() method (or using the define ReaderSet).
Then you get a READER (PTEID_ReaderContext)
-> from this reader, you a CARD (PTEID_Card or derived class)
-> from this card, you get identity or address objects (PTEID_EId or PTEID_Address)
-> ...
You get an instance from the static instance() method (or using the define ReaderSet).
Then you get a READER (PTEID_ReaderContext)
-> from this reader, you a CARD (PTEID_Card or derived class)
-> from this card, you get identity or address objects (PTEID_EId or PTEID_Address)
-> ...
-
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()booleanFlush the cacheReturn the first readercontext with a card.
If no card is present, return the firs reader.
If no reader exist, throw an exception PTEID_ExNoReader.getReaderByCardSerialNumber(String cardSerialNumber) Return the reader containing the card with this SN.
If no card with this SN is found, throw an exception PTEID_ExParamRange.getReaderByName(String readerName) Get the reader by its name.getReaderByNum(long ulIndex) Get the reader by its Index.
Throw PTEID_ExParamRange exception if the index is out of range.getReaderName(long ulIndex) Get the name of the reader by its Index.
Throw PTEID_ExParamRange exception if the index is out of range.static voidinitSDK()Init the SDK (Optional).
static voidinitSDK(boolean bManageTestCard) Init the SDK (Optional).static PTEID_ReaderSetinstance()Return the singleton object (create it at first use)booleanReturn true if readers has been added or removedlongReturn the number of card readers connected to the computer.
longreaderCount(boolean bForceRefresh) Return the number of card readers connected to the computer.
String[]Get the list of the reader.
Return an array of const char *
The last pointer is NULL
Usage : const char * const *ppList=PTEID_ReaderSet::readerList();
for(const char * const *ppName=ppList;*ppName!=NULL;ppName++) {...}
String[]readerList(boolean bForceRefresh) Get the list of the reader.
Return an array of const char *
The last pointer is NULL
Usage : const char * const *ppList=PTEID_ReaderSet::readerList();
for(const char * const *ppName=ppList;*ppName!=NULL;ppName++) {...}
voidRelease the readers (Useful if readers had changed).
voidreleaseReaders(boolean bAllReference) Release the readers (Useful if readers had changed).
static voidRelease the SDK
-
Method Details
-
delete
public void delete()- Overrides:
deletein classPTEID_Object
-
instance
Return the singleton object (create it at first use)- Throws:
PTEID_Exception
-
initSDK
Init the SDK (Optional).- Parameters:
bManageTestCard- If true the applayer must ask if test cards are allowed (used for compatibility with old C
API).bManageTestCard- If false other applications (ex. gui) take that into their scope- Throws:
PTEID_Exception
-
initSDK
Init the SDK (Optional).
- Throws:
PTEID_Exception
-
releaseSDK
Release the SDK- Throws:
PTEID_Exception
-
releaseReaders
Release the readers (Useful if readers had changed).
- Parameters:
bAllReference- If true all the invalid reference/pointer are destroyed.bAllReference- PUT THIS PARAMETER TO TRUE IS THREAD UNSAFE.bAllReference- You have to be sure that you will not use any old reference/pointer after this release- Throws:
PTEID_Exception
-
releaseReaders
Release the readers (Useful if readers had changed).
- Throws:
PTEID_Exception
-
isReadersChanged
Return true if readers has been added or removed- Throws:
PTEID_Exception
-
readerList
Get the list of the reader.
Return an array of const char *
The last pointer is NULL
Usage : const char * const *ppList=PTEID_ReaderSet::readerList();
for(const char * const *ppName=ppList;*ppName!=NULL;ppName++) {...}
- Parameters:
bForceRefresh- force the reconnection to the lower layer to see if reader list have changed- Throws:
PTEID_Exception
-
readerList
Get the list of the reader.
Return an array of const char *
The last pointer is NULL
Usage : const char * const *ppList=PTEID_ReaderSet::readerList();
for(const char * const *ppName=ppList;*ppName!=NULL;ppName++) {...}
- Throws:
PTEID_Exception
-
getReader
Return the first readercontext with a card.
If no card is present, return the firs reader.
If no reader exist, throw an exception PTEID_ExNoReader.- Throws:
PTEID_Exception
-
getReaderByName
Get the reader by its name.- Throws:
PTEID_Exception
-
readerCount
Return the number of card readers connected to the computer.
- Parameters:
bForceRefresh- force the reconnection to the lower layer to see if reader list have changed- Throws:
PTEID_Exception
-
readerCount
Return the number of card readers connected to the computer.
- Throws:
PTEID_Exception
-
getReaderName
Get the name of the reader by its Index.
Throw PTEID_ExParamRange exception if the index is out of range.- Throws:
PTEID_Exception
-
getReaderByNum
Get the reader by its Index.
Throw PTEID_ExParamRange exception if the index is out of range.- Throws:
PTEID_Exception
-
getReaderByCardSerialNumber
public PTEID_ReaderContext getReaderByCardSerialNumber(String cardSerialNumber) throws PTEID_Exception Return the reader containing the card with this SN.
If no card with this SN is found, throw an exception PTEID_ExParamRange.- Throws:
PTEID_Exception
-
flushCache
Flush the cache- Throws:
PTEID_Exception
-