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

com.ibm.opencard.isofs
Class MFCFileFactory

java.lang.Object
  |
  +--com.ibm.opencard.isofs.MFCFileFactory

public final class MFCFileFactory
extends java.lang.Object

A factory class for MFC file service objects. Here, the term factory refers to the design technique, not to OCF card service factories. The file services implement the interfaces FileAccessCardService and FileSystemCardService. This factory class allows to create appropriate implementations of these services, along with some other helpers used.

Version:
$Id: MFCFileFactory.java,v 1.1 1999/12/02 16:06:04 damke Exp $
See Also:
FileAccessCardService, FileSystemCardService

Method Summary
static MFCFileAccessImpl get35FAImpl()
          Returns a file access service implementation for MFC 4.0 and below.
static MFCFileSystemImpl get35FSImpl()
          Returns a file system service implementation for MFC 4.0 and below.
static MFCFileAccessImpl get41FAImpl()
          Returns a file access service implementation for MFC 4.1 and above.
static MFCFileSystemImpl get41FSImpl()
          Returns a file system service implementation for MFC 4.1 and above.
static MFCFileAccessImpl getFAImpl(int cos)
          Returns a file access service implementation for the given CardOS.
static MFCFileSystemImpl getFSImpl(int cos)
          Returns a file system service implementation for the given CardOS.
static MFCSelectResponseParser getSRParser(int cos)
          Returns a file select response parser for the given CardOS.
static void initFileParam(MFCFileParameter param, int cos)
          Initializes a MFCFileParameter.
static void initFileSysParam(MFCFileSysParameter param, int cos)
          Initializes a MFCFileSysParameter.
static MFCFileParameter newFileParam(CardServiceScheduler scheduler, SmartCard smartcard, boolean blocking, int cos)
          Returns a new, initialized parameter for creating a file access service.
static MFCFileSysParameter newFileSysParam(CardServiceScheduler scheduler, SmartCard smartcard, boolean blocking, int cos)
          Returns a new, initialized parameter for creating a file system service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFAImpl

public static MFCFileAccessImpl getFAImpl(int cos)
Returns a file access service implementation for the given CardOS.
Parameters:
cos - the CardOS indicator, see IBMMFCConstants
Returns:
a file access service implementation suitable for the CardOS
See Also:
IBMMFCConstants

get35FAImpl

public static MFCFileAccessImpl get35FAImpl()
Returns a file access service implementation for MFC 4.0 and below. The implementation is created on the first invocation and re-used later.
Returns:
a file access service implementation for MFC 3.5 and 4.0

get41FAImpl

public static MFCFileAccessImpl get41FAImpl()
Returns a file access service implementation for MFC 4.1 and above. The implementation is created on the first invocation and re-used later.
Returns:
a file access service implementation for MFC 4.1 and 4.21

getFSImpl

public static MFCFileSystemImpl getFSImpl(int cos)
Returns a file system service implementation for the given CardOS.
Parameters:
cos - the CardOS indicator, see IBMMFCConstants
Returns:
a file system service implementation suitable for the CardOS
See Also:
IBMMFCConstants

get35FSImpl

public static MFCFileSystemImpl get35FSImpl()
Returns a file system service implementation for MFC 4.0 and below. The implementation is created on the first invocation and re-used later.
Returns:
a file system service implementation for MFC 3.5 and 4.0

get41FSImpl

public static MFCFileSystemImpl get41FSImpl()
Returns a file system service implementation for MFC 4.1 and above. The implementation is created on the first invocation and re-used later. Although the commands of the file system implementation are non-ISO, the implementation returned by get35FSImpl can not be used here. The default class byte used for MFC 4.0 and below specifies proprietary secure messaging, while the MFC 4.1 and above services use an ISO secure messenger.
Returns:
a file system service implementation for MFC 4.1 and 4.21
See Also:
get35FSImpl()

getSRParser

public static MFCSelectResponseParser getSRParser(int cos)
Returns a file 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.
Parameters:
cos - the CardOS indicator, see IBMMFCConstants
Returns:
a file select response parser for the CardOS
See Also:
IBMMFCConstants

initFileParam

public static void initFileParam(MFCFileParameter param,
                                 int cos)
Initializes a MFCFileParameter. The parameter gets initialized with a file select response parser and a file access service implementation. The generic parts are also initialized by invoking MFCGenericFactory.initParameter.
Parameters:
param - the parameter to initialize
cos - the card OS identifier, see IBMMFCConstants
See Also:
MFCGenericFactory.initParameter(com.ibm.opencard.service.MFCCardServiceParameter, int), IBMMFCConstants

initFileSysParam

public static void initFileSysParam(MFCFileSysParameter param,
                                    int cos)
Initializes a MFCFileSysParameter. The parameter gets initialized with a file system service implementation. The other parts are also initialized by invoking initFileParam.
Parameters:
param - the parameter to initialize
cos - the card OS identifier, see IBMMFCConstants
See Also:
initFileParam(com.ibm.opencard.isofs.MFCFileParameter, int), IBMMFCConstants

newFileParam

public static MFCFileParameter newFileParam(CardServiceScheduler scheduler,
                                            SmartCard smartcard,
                                            boolean blocking,
                                            int cos)
Returns a new, initialized parameter for creating a file access service. The parameter is initialized by invoking initFileParam.
Parameters:
scheduler - where to allocate channels, gets stored in the parameter
smartcard - the smartcard to support, gets stored in the parameter
blocking - whether to operate blocking, gets stored in the parameter
cos - card os
Returns:
a parameter for instantiating MFCFileAccess
See Also:
initFileParam(com.ibm.opencard.isofs.MFCFileParameter, int), MFCFileAccess#MFCFileAccess(com.ibm.opencard.isofs.MFCFileParameter)

newFileSysParam

public static MFCFileSysParameter newFileSysParam(CardServiceScheduler scheduler,
                                                  SmartCard smartcard,
                                                  boolean blocking,
                                                  int cos)
Returns a new, initialized parameter for creating a file system service. The parameter is initialized by invoking initFileSysParam.
Parameters:
scheduler - where to allocate channels, gets stored in the parameter
smartcard - the smartcard to support, gets stored in the parameter
blocking - whether to operate blocking, gets stored in the parameter
cos - card os
Returns:
a parameter for instantiating MFCFileSystem
See Also:
initFileSysParam(com.ibm.opencard.isofs.MFCFileSysParameter, int), MFCFileSystem#MFCFileSystem(com.ibm.opencard.isofs.MFCFileSysParameter)