OpenCard  
 
OCF, the OpenCard Framework is a standard Java framework for working with Smart Cards.  
 

com.ibm.opencard.service
Class MFCGenericFactory

java.lang.Object
  |
  +--com.ibm.opencard.service.MFCGenericFactory

public final class MFCGenericFactory
extends java.lang.Object

A factory class for MFC generic service objects. Here, the term factory refers to the design technique, not to OCF card service factories. The generic service, that is the base class of all MFC services, is responsible for the SELECT command. This factory class allows to create appropriate implementations of the generic card service, along with some other helpers used.

Version:
$Id: MFCGenericFactory.java,v 1.1 1999/12/02 16:06:08 damke Exp $

Method Summary
static void customizeScheduler(CardServiceScheduler scheduler)
          Customizes a scheduler to manage a MFCCardChannel.
static MFCCodes get35Codes()
          Returns command codes for MFC 3.5 and 4.0 smartcards.
static MFCCardServiceImpl get35CSImpl()
          Returns generic card service implementation for MFC 4.0 and below cards.
static MFCCodes get41Codes()
          Returns command codes for MFC 4.1 and above smartcards.
static MFCCardServiceImpl get41CSImpl()
          Returns generic card service implementation for MFC 4.1 and above cards.
static MFCCodes getCodes(int cos)
          Returns command codes for the given card OS.
static MFCCardServiceImpl getCSImpl(int cos)
          Returns a generic card service implementation for the given CardOS.
static MFCSelectResponseParser getSRParser(int cos)
          Returns a generic select response parser for the given CardOS.
static void initParameter(MFCCardServiceParameter param, int cos)
          Initializes a MFCCardServiceParameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCodes

public static MFCCodes getCodes(int cos)
Returns command codes for the given card OS.
Parameters:
cos - the CardOS indicator, see IBMMFCConstants
Returns:
command codes suitable for the CardOS
See Also:
IBMMFCConstants

get35Codes

public static MFCCodes get35Codes()
Returns command codes for MFC 3.5 and 4.0 smartcards. The codes are created on the first invocation and re-used later.
Returns:
command codes for MFC 4.0 and below

get41Codes

public static MFCCodes get41Codes()
Returns command codes for MFC 4.1 and above smartcards. The codes are created on the first invocation and re-used later.
Returns:
command codes for MFC 4.1 and 4.21

getCSImpl

public static MFCCardServiceImpl getCSImpl(int cos)
Returns a generic card service implementation for the given CardOS.
Parameters:
cos - the CardOS indicator, see IBMMFCConstants
Returns:
a card service implementation suitable for the CardOS
See Also:
IBMMFCConstants

get35CSImpl

public static MFCCardServiceImpl get35CSImpl()
Returns generic card service implementation for MFC 4.0 and below cards. The implementation is created on the first invocation and re-used later.
Returns:
implementation of generic card service for MFC 4.0 and 3.5

get41CSImpl

public static MFCCardServiceImpl get41CSImpl()
Returns generic card service implementation for MFC 4.1 and above cards. The implementation is created on the first invocation and re-used later.
Returns:
implementation of generic card service for MFC 4.1 and 4.21

getSRParser

public static MFCSelectResponseParser getSRParser(int cos)
Returns a generic select response parser for the given CardOS. Currently, there is only one select response parser for all MFC cards. The argument is therefore ignored. The parser is created on the first invocation and re-used later. This method is typically not invoked, since more specific select response parsers are required for most services.
Parameters:
cos - the CardOS indicator, see IBMMFCConstants
Returns:
a generic select response parser for the CardOS
See Also:
IBMMFCConstants

initParameter

public static void initParameter(MFCCardServiceParameter param,
                                 int cos)
Initializes a MFCCardServiceParameter. The parameter gets initialized with a card accessor and a generic card service implementation. The select response parser is not initialized, since it would be replaced by a more specific one in most cases.
The scheduler stored in the parameter is checked. If it is not yet customized, it will be customized to manage a MFCCardChannel. If the scheduler has already been customized to manage another kind of channel, the services created from the parameter will not be usable.
Parameters:
param - the parameter to initialize
cos - the card OS identifier, see IBMMFCConstants
See Also:
IBMMFCConstants

customizeScheduler

public static void customizeScheduler(CardServiceScheduler scheduler)
Customizes a scheduler to manage a MFCCardChannel. Customization is performed only if the scheduler is not yet customized.
Parameters:
scheduler - the scheduler to customize
See Also:
CardServiceScheduler