opencard.opt.database
Class BasicDatabaseFactory
java.lang.Object
opencard.core.service.CardServiceFactory
opencard.opt.database.BasicDatabaseFactory
public class BasicDatabaseFactory
- extends CardServiceFactory
This class is the implementation of a CardServiceFactory that
provides access to a BasicDatabase CardService for a smartcard
that is compliant with ISO7816-7.
- Since:
- OCF1.2
- Version:
- $Id: BasicDatabaseFactory.java,v 1.1 1999/12/06 15:46:05 damke Exp $
Changes:, $Id: BasicDatabaseFactory.java,v 1.1 1999/12/06 15:46:05 damke Exp $
- Author:
- Christophe.Muller@research.gemplus.com
- It supports the new style (1.1.1) card recognition (getCardType)
- It uses a naming pattern where each CardService that could be
instanciated provides its own knows method that does
the card recognition.
- It can detect theoritically any smartcard that is ISO7816-7
compliant. To do that it uses a temporary SlotChannel (see
CardServiceFactory class) and it:
- sends a 'PRESENT USER ("PUBLIC")' command w/o password, and
- expects a 9000 response.
See the knows method for more details.
Note: For proprietary implementations, i.e., classes inheriting from
Basicdatabase, it is still possible to redefine an other
knows method that would be simpler (e.g., that would analyze
the card ATR in order to check that the card if of the right type). But
in this case, it is also necessary to redefine a factory because the
knows method is static and so the class exact name must be
known and specified by the factory., HAMEL Arnaud, DANGREMONT Cedric, Christophe.Muller@research.gemplus.com
- See Also:
BasicDatabase.knows(opencard.core.terminal.CardID, opencard.core.service.CardServiceScheduler)
Method Summary |
protected CardType |
getCardType(CardID cid,
CardServiceScheduler sched)
Indicate whether this CardServiceFactory "knows" the smart card OS
and/or installed card applications
and might be able to instantiate CardServices for it. |
protected java.util.Enumeration |
getClasses(CardType type)
Return an enumeration of known CardService classes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DATABASE_CARDTYPE
public static final int DATABASE_CARDTYPE
- See Also:
- Constant Field Values
BasicDatabaseFactory
public BasicDatabaseFactory()
getCardType
protected CardType getCardType(CardID cid,
CardServiceScheduler sched)
- Description copied from class:
CardServiceFactory
- Indicate whether this CardServiceFactory "knows" the smart card OS
and/or installed card applications
and might be able to instantiate CardServices for it.
This method replaces the former knows() method.
Note: OCF 1.1 style card service factories should instead derive from
opencard.opt.service.OCF11CardServiceFactory which still
offers the knows() and cardServiceClasses() methods.
Should return a CardType that contains enough information to answer
the getClassFor() method.
The factory can inspect the card (communicate with the card) using
the provided CardServiceScheduler if the CardID information is insufficient
to classify the card.
- Specified by:
getCardType
in class CardServiceFactory
- Parameters:
cid
- A CardID received from a Slot.sched
- A CardServiceScheduler that can be used to communicate with
the card to determine its type.
- Returns:
- A valid CardType if the factory can instantiate services for this
card.
CardType.UNSUPPORTED if the factory does not know the card.
getClasses
protected java.util.Enumeration getClasses(CardType type)
- Description copied from class:
CardServiceFactory
- Return an enumeration of known CardService classes.
Replaces the former cardServiceClasses() method.
Note: OCF 1.1 style card service factories should instead derive from
opencard.opt.service.OCF11CardServiceFactory which still
offers the knows() and cardServiceClasses() methods.
- Specified by:
getClasses
in class CardServiceFactory
- Parameters:
type
- The CardType of the smart card for which
the enumeration is requested.
- Returns:
- An Enumeration of class objects.