Package opencard.opt.util
Class PassThruCardServiceFactory
- java.lang.Object
-
- opencard.core.service.CardServiceFactory
-
- opencard.opt.service.OCF11CardServiceFactory
-
- opencard.opt.util.PassThruCardServiceFactory
-
public final class PassThruCardServiceFactory extends OCF11CardServiceFactory
A factory for creating low level card services for any smartcard. The only service this factory can create is PassThruCardService, which is available for all smartcards. This class serves as an example for implementing a simple card service factories, and provides a "quick start" for people who want to become familiar with smartcards and the OpenCard Framework.
To use the service instantiated by this factory, add opencard.opt.util.PassThruCardServiceFactory to the attribute OpenCard.services in your opencard.properties file, preferrably as the last entry.- Version:
- $Id: PassThruCardServiceFactory.java,v 1.1.1.1 1999/10/05 15:08:48 damke Exp $
- Author:
- Thomas Schaeck (schaeck@de.ibm.com), Roland Weber (rolweber@de.ibm.com)
- See Also:
PassThruCardService
-
-
Constructor Summary
Constructors Constructor Description PassThruCardServiceFactory()
Instantiates a new factory for low level card services.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Enumeration
cardServiceClasses(CardID cardID)
Returns an enumeration of known card service classes.boolean
knows(CardID cardID)
Tests whether this factory supports a given smartcard.-
Methods inherited from class opencard.opt.service.OCF11CardServiceFactory
getCardType, getClasses
-
Methods inherited from class opencard.core.service.CardServiceFactory
getCardServiceInstance, getClassFor, newCardServiceInstance
-
-
-
-
Method Detail
-
knows
public final boolean knows(CardID cardID)
Tests whether this factory supports a given smartcard. The smartcard is identified by it's ATR (Answer To Reset), which is encapsulated in a CardID object. Since all smartcards can receive APDUs and send responses to them, this factory supports all cards. If a smartcard is supported, the card services this factory is able to instantiate can be obtained using cardServiceClasses.- Specified by:
knows
in classOCF11CardServiceFactory
- Parameters:
cardID
- the ATR of the smartcard to test for- Returns:
- true, since this factory supports all smartcards
- See Also:
cardServiceClasses(opencard.core.terminal.CardID)
-
cardServiceClasses
public final java.util.Enumeration cardServiceClasses(CardID cardID)
Returns an enumeration of known card service classes. Known classes are those that can be instantiated by this factory for the given smartcard. To check whether a factory is able to instantiate any service at all for that smartcard, knows can be invoked. Since this factory supports all smartcards, and can only instantiate one service, this method returns a constant value.- Specified by:
cardServiceClasses
in classOCF11CardServiceFactory
- Parameters:
cardID
- the ATR of the smartcard to test for- Returns:
- an enumeration holding PassThruCardService.class as it's only element
- See Also:
knows(opencard.core.terminal.CardID)
-
-