Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | 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

Direct Known Subclasses:
  BasicEMVAppletAccess

public abstract class AbstractAppletAccessor
extends opencard.core.service.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

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(opencard.core.terminal.SlotChannel channel)` 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.
`AppletInfo[]` | `list()` List the available card-resident applets as array.
`AppletInfo` | `selectApplet(opencard.core.service.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. Subclasses may need to redefine the way applet selection is performed.

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`

Constructor Detail

### AbstractAppletAccessor

    public AbstractAppletAccessor()
                           throws opencard.core.service.CardServiceException

  Instantiate a `AbstractAppletAccessor` object.

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(opencard.core.service.CardChannel channel,
                                   AppletID appletID)
                            throws opencard.core.service.CardServiceException,
                                   opencard.core.terminal.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.

### internalList

    protected abstract java.util.Vector internalList(opencard.core.terminal.SlotChannel channel)
                                              throws opencard.core.service.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:
    opencard.core.service.CardServiceException - Thrown when the list cannot be presented.

### list

    public AppletInfo[] list()
                      throws opencard.core.service.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:
    opencard.core.service.CardServiceException - Thrown when the list cannot be presented.

### getInfo

    public AppletInfo getInfo(AppletID aid)
                       throws opencard.core.service.CardServiceException

  Reads the `AppletInfo from the directory on the card.

  `
  Specified by:
    getInfo in interface AppletAccessCardService
  Parameters:
    `appletIdentifier` - 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:
    opencard.core.service.CardServiceException - Thrown when error occurs during execution of the operation.

### exists

    public boolean exists(AppletID appletIdentifier)
                   throws opencard.core.service.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`.

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