Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## opencard.opt.applet.mgmt
Class AbstractAppletAccessor

    java.lang.Object
      opencard.core.service.CardService
          opencard.opt.applet.mgmt.AbstractAppletAccessor

All Implemented Interfaces:
  AppletSelector, AppletAccessCardService, CardServiceInterface

Direct Known Subclasses:
  BasicEMVAppletAccess

    public abstract class AbstractAppletAccessor

extends CardService
implements AppletSelector, AppletAccessCardService

The `AbstractAppletAccessor` is an abstract class providing card type independent base functionality for implementations of an `AppletAccessCardService`. It is however an adapter in the sense that it implements a part of the `AppletAccessCardService>` interface and provide the following implementations which can be useful for concrete implementations of the `AppletAccessCardService` interface:

- A `selectApplet` method that uses ISO-standardized APDU code. Note: this particular feature is accessed through a helper object that is by default an "`ISOAppletSelector`" but can be changed by subclasses with `setAppletSelector`.
- A method to "list" the available applets on the card. Note that although this method is implemented, it relies on the fact that an abstract "internalList" method must be implemented by subclasses and called before it, this is why the class is an "abstract" one.
- A method "getInfo" to get the related AppletInfo object of a specific applet specified by AID.
- A method "exists" to check if a specified applet (given its AID) is available on the card. It relies on internalList as well.

Since:
  OCF1.2
Version:
  $Id: AbstractAppletAccessor.java,v 1.3 1999/03/23 13:32:59 tstober Exp $
Author:
  Thomas Stober (tms@de.ibm.com), Christophe.Muller@research.gemplus.com

Constructor Summary
`AbstractAppletAccessor()` Instantiate a `AbstractAppletAccessor` object.

Method Summary
`boolean` | `exists(AppletID appletIdentifier)` Check whether the card-resident applets with the specified `AppletID` exists on the card.
`java.util.Vector` | `getApplets()`
`protected AppletSelector` | `getAppletSelector()` Get the applet selector.
`AppletInfo` | `getInfo(AppletID aid)` Reads the `AppletInfo from the directory on the card.`
`protected abstract java.util.Vector` | `internalList(SlotChannel channel)` List the applets info informations.
`AppletInfo[]` | `list()` List the available card-resident applets as array.
`AppletInfo` | `selectApplet(CardChannel channel, AppletID appletID)` Selects the card applet with the given application ID using the given channel for communication with the card.
`void` | `setApplets(java.util.Vector apps)`
`protected void` | `setAppletSelector(AppletSelector s)` Set the applet selector.

Methods inherited from class opencard.core.service.CardService
`allocateCardChannel, getCard, getCardChannel, getCHVDialog, initialize, releaseCardChannel, setCardChannel, setCHVDialog`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface opencard.opt.service.CardServiceInterface
`getCard, setCHVDialog`

Constructor Detail

### AbstractAppletAccessor

    public AbstractAppletAccessor()
                           throws CardServiceException

  Instantiate a `AbstractAppletAccessor` object.

  Throws:
    `CardServiceException`

Method Detail

### getApplets

    public java.util.Vector getApplets()

### setApplets

    public void setApplets(java.util.Vector apps)

### setAppletSelector

    protected void setAppletSelector(AppletSelector s)

  Set the applet selector.

  Subclasses may need to redefine the way applet selection is performed. They can do that by specifying a class implementing "AppletSelector" and call setAppletSelector with a new helper object that will be used in place of the default ISO implementation.

### getAppletSelector

    protected AppletSelector getAppletSelector()

  Get the applet selector.

  Returns:
    A helper object that implements the "AppletSelector" interface.

### selectApplet

    public AppletInfo selectApplet(CardChannel channel,
                                   AppletID appletID)
                            throws CardServiceException,
                                   CardTerminalException

  Selects the card applet with the given application ID using the given channel for communication with the card.

  Specified by:
    `selectApplet` in interface `AppletSelector`
  Parameters:
    `channel` - The `CardChannel` to be used for sending the select command to the card.
    `appletID` - The application identifier of the applet to be selected.
  Returns:
    The `AppletInfo` returned by the select command.
  Throws:
    `CardServiceException` - Thrown when error occurs during execution of the operation.
    `CardTerminalException` - Thrown when error occurs during the communication.

### internalList

    protected abstract java.util.Vector internalList(SlotChannel channel)
                                              throws CardServiceException

  List the applets info informations.

  This ABSTRACT method has to be implemented by card standard specific subclasses.

  Subclasses will need to call this method and then `setApplets` in order to initialize the `applets` attribute.

  Returns:
    A Vector of `AppletInfo` Object representing the card-resident applets.
  Throws:
    `CardServiceException` - Thrown when the list cannot be presented.

### list

    public AppletInfo[] list()
                      throws CardServiceException

  List the available card-resident applets as array.

  Specified by:
    `list` in interface `AppletAccessCardService`
  Returns:
    An array of `AppletInfo`s of the card-resident applets.
  Throws:
    `CardServiceException` - Thrown when the list cannot be presented.

### getInfo

    public AppletInfo getInfo(AppletID aid)
                       throws CardServiceException

  Reads the `AppletInfo from the directory on the card.

  `
  Specified by:
    `getInfo` in interface `AppletAccessCardService`
  Parameters:
    `aid` - The `AppletID` object referring to the applets whose Info we want to read.
  Returns:
    An `AppletInfo` of the applets. If no applets info was found for the given `AppletID` a `null` Throws:
    `CardServiceException` - Thrown when error occurs during execution of the operation.

### exists

    public boolean exists(AppletID appletIdentifier)
                   throws CardServiceException

  Check whether the card-resident applets with the specified `AppletID` exists on the card.

  Specified by:
    `exists` in interface `AppletAccessCardService`
  Parameters:
    `appletIdentifier` - The `AppletID` object referring to the applet whose existence we want to check.
  Returns:
    `true` if card-resident applet exists, otherwise return `false`.
  Throws:
    `CardServiceException` - Thrown when error occurs during execution of the operation.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD