Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

HBCI::MediumPlugin Class Reference

This is the abstract base class for a medium plugin. More...

#include <mediumplugin.h>

Inheritance diagram for HBCI::MediumPlugin:

Inheritance graph
[legend]
List of all members.

Public Methods

 MediumPlugin ()
virtual ~MediumPlugin ()
virtual PluginType pluginType () const
virtual string mediumTypeName () const=0
virtual MediumType mediumType () const=0
virtual Pointer< MediummediumFactory (const string &name)=0
virtual Error mediumCheck (string &name) const
virtual Pointer< MediumcreateNewMedium (bool readonly, int country, const string &bankId, const string &userid, const string &name)=0
virtual Pointer< MediummediumFromConfig (SimpleConfig &cfg, cfgPtr group)=0
virtual Error mediumToConfig (Pointer< Medium > m, SimpleConfig &cfg, cfgPtr group)=0

Detailed Description

This is the abstract base class for a medium plugin.

Note: If you are writing a new medium plugin, then the *first* class your new medium class has to inherit is "HBCI::Medium" (not the other way round)! It took me several hours to figure out why MediumDDV did not work.

Author:
Martin Preuss<martin@libchipcard.de>
See also:
How to add a Medium Plugin


Constructor & Destructor Documentation

HBCI::MediumPlugin::MediumPlugin  
 

Default Constructor

virtual HBCI::MediumPlugin::~MediumPlugin   [virtual]
 

Default Destructor


Member Function Documentation

virtual Pointer<Medium> HBCI::MediumPlugin::createNewMedium bool    readonly,
int    country,
const string &    bankId,
const string &    userid,
const string &    name
[pure virtual]
 

Create a new medium using the data given. A keyfile medium will create a new file, a card medium will most likely do nothing.

virtual Error HBCI::MediumPlugin::mediumCheck string &    name const [virtual]
 

This method checks whether the given name resolves to a medium of this type. A file medium might check whether the file has the correct format, a card plugin might check whether the inserted card is the correct type. If the returned error code indicates success, then the medium is a valid medium with regard to this plugin. If the returned error code is HBCI_ERROR_CODE_BAD_MEDIUM then it is suggested that this medium is not supported by the plugin. All other error codes indicate an error, but only HBCI_ERROR_CODE_BAD_MEDIUM will be treated as a definitive NACK. This means any other error code should not lead to the conclusion that the medium is not supported. In such a case it would be best for the application to retry (if the error advise() suggests so). If this medium plugin supports card media, then the following rules additionally apply:

  • If the parameter "name" is empty, then on success this method may set the name of this medium (in most cases this is the serial number of the card
  • If the parameter "name" is NOT empty, then the plugin MUST check whether the name is correct (i.e. if the serial number matches the given card). If the name does not match this method MUST return HBCI_ERROR_CODE_WRONG_MEDIUM.
However, if the plugin does not support this method at all it MUST return HBCI_ERROR_CODE_UNSUPPORTED.

Returns :
Error code
Parameters:
name  Name which identifies the medium (similar to HBCI::Medium::mediumName(). For a file plugin this parameter MUST be the filename of the medium and MUST NOT be empty. For a card medium this parameter may be empty, and on success the found card medium's name will be returned in this string.

virtual Pointer<Medium> HBCI::MediumPlugin::mediumFactory const string &    name [pure virtual]
 

This method should only be used if there is no configuration file. It creates a medium with default settings. This method MUST only be used for media that already exist (like cards, already existing files etc).

virtual Pointer<Medium> HBCI::MediumPlugin::mediumFromConfig SimpleConfig &    cfg,
cfgPtr    group
[pure virtual]
 

This method is used to create a medium object using the data given in a configuration file. There are some mandatory variables in this group:

  • mediumtype: This is used to lookup the medium plugin that is responsible for this medium
  • mediumname: This is used to identify a medium. Each medium MUST have a unique name. RDHFiles use the path and name of the keyfile here, while chipcard media use the card's serial number.
The plugin may additionally use whichever variables it finds necessary.

virtual Error HBCI::MediumPlugin::mediumToConfig Pointer< Medium   m,
SimpleConfig &    cfg,
cfgPtr    group
[pure virtual]
 

This method is used to store information from a medium to a configuration file (in order to be restorable by mediumFromConfig). See mediumFromConfig for details about the config group.

virtual MediumType HBCI::MediumPlugin::mediumType   const [pure virtual]
 

Returns the generalized medium type (either file of card).

virtual string HBCI::MediumPlugin::mediumTypeName   const [pure virtual]
 

Returns the name of the MediumType (such as "RSACard", "DDVCard").

virtual PluginType HBCI::MediumPlugin::pluginType   const [inline, virtual]
 

Returns the type of this plugin.

Implements HBCI::Plugin.


The documentation for this class was generated from the following file:
Generated on Mon Jun 23 13:41:11 2003 for openhbci by doxygen1.2.17