#include <api.h>
Inheritance diagram for HBCI::API:
Public Methods | |
API (bool readonly=false, bool retrievalOnly=false) | |
~API () | |
File operations | |
Error | loadEnvironment (const string &filename, unsigned int fl=HBCILOADER_DEFAULT) |
Error | saveEnvironment (const string &filename, unsigned int fl=HBCILOADER_DEFAULT) const |
Object Retrieval | |
const list< Pointer< Bank > > & | bankList () const |
const list< Pointer< Bank > > & | banks () const |
Pointer< Bank > | findBank (int country, const string &instcode) const |
Pointer< Medium > | findMedium (const string &name) const |
list< Pointer< Account > > | getAccounts (int country=0, const string &bankId="*", const string &accountId="*") const |
list< Pointer< User > > | getUsers (int country=0, const string &instid="*", const string &userid="*") const |
list< Pointer< Customer > > | getCustomers (int country=0, const string &instid="*", const string &custid="*") const |
Convenience Object Retrieval | |
Pointer< Account > | findAccount (int country, const string &instcode, const string &accnr, const string &suffix="") const |
Pointer< User > | findUser (int country, const string &instcode, const string &user) const |
Pointer< Customer > | findCustomer (int country, const string &instcode, const string &cust) const |
int | totalAccounts () const |
int | totalUsers () const |
Manage Objects | |
void | addBank (Pointer< Bank > b) |
void | removeBank (Pointer< Bank > b) |
OutboxJob Management | |
Error | addJob (Pointer< OutboxJob > job) |
Error | executeQueue (bool chg=true) |
list< Pointer< OutboxJob > > | queuedJobs () const |
void | clearQueueByResult (OutboxJob_Result result=HBCI_JOB_RESULT_NONE) |
void | clearQueueByStatus (OutboxJob_Status status=HBCI_JOB_STATUS_NONE) |
void | removeQueuedJob (Pointer< OutboxJob > job) |
User Interaction | |
Pointer< ProgressMonitor > | monitor () const |
void | setMonitor (Pointer< ProgressMonitor > monitor) |
Factory Methods | |
Pointer< Bank > | bankFactory (int country=280, const string &bankCode="", const string &server="", int hbciVersion=HBCI_VERSION_201) const |
Pointer< Medium > | mediumFactory (const string &name, const string &mediumType) |
Pointer< Medium > | createNewMedium (const string &mtype, bool readonly, int country, const string &bankId, const string &userId, const string &name) |
Pointer< Medium > | mediumFromConfig (SimpleConfig &cfg, cfgPtr group) |
Error | mediumToConfig (Pointer< Medium > m, SimpleConfig &cfg, cfgPtr group) |
MediumType | mediumType (const string &mtype) |
string | pluginPath () const |
Pointer< MediumPluginList > | enumerateMediumPlugins () |
Medium Plugin Management | |
Error | registerMediumPlugin (Pointer< MediumPlugin > mp) |
Error | loadMediumPlugin (const string &path) |
Static Public Methods | |
Static Factory Methods | |
Pointer< User > | userFactory (Pointer< Bank > b, Pointer< Medium > m, const string &userid, int version=0, const string &userName="", bool knowsSupportedJobs=false) |
Pointer< Customer > | customerFactory (Pointer< User > u, const string &id, const string &role) |
Pointer< Account > | accountFactory (Pointer< Bank > b, const string &accountId="", const string &accountSubId="") |
Counter for transaction ids | |
unsigned | nextTransactionId () |
unsigned | lastTransactionId () |
void | setLastTransactionId (unsigned int i) |
Friends | |
class | OutboxJobKeys |
class | OutboxJobSynchronize |
class | OutboxJobDisableKeys |
class | OutboxJobChangeKeys |
Once you got an existing OpenHBCI configuration file and setup, you only need a few steps to use it:
loadEnvironment
: to load all known users, accounts, and banks from the configuration file OutboxJob
) addJob
) executeQueue
: to perform all those jobs saveEnvironment
: to finally save all data back to the configuration file bankFactory
, add it to the list with addBank
createNewMedium
userFactory
using the new medium, add it to the Bank
with Bank::addUser
customerFactory
, add it to the User
with User::addCustomer
saveEnvironment
. OutboxJobGetKeys
to get the bank server's keys (addJob
, executeQueue
) and compare it with their Ini-Letter. If it doesn't match, you better stop contacting that server. OutboxJobSendKeys
to send your newly created keys (from the medium) to the server (addJob
, executeQueue
), using your newly created Customer. MediumRDHBase
, e.g. MediumRDHBase::getUserIniLetterModulus
, print it out and send it to your bank. Then wait several days until the bank has received and processed the user's Ini-Letter. OutboxJobGetSystemId
to let the bank assign a synchronization id to your client system, using your newly created Customer. (FIXME: Is it correct that this can't be done before the ini-letter has been processed?) OutboxJobGetAccounts
, which also creates the necessary Account and Customer objects. saveEnvironment
and continue with other (real) OutboxJobs according to the bullet list above.
|
Constructor.
|
|
Default Destructor. |
|
Creates an account object. This will NOT be automatically added to internally stored lists.
|
|
Add a bank. Add a bank to the internally stored list. Throws an Error if this bank already exists.
|
|
Add a job to the internal outbox queue.
This method accepts a HBCI::Pointer to an OutboxJob, not one to a derived class OutboxJobSomething. Since the HBCI::Pointer doesn't do automatic (up)casting, you need to use the Pointer's Pointer::cast() method explicitly: Use Unlike in former versions you still have access to the jobs, since you only supply a pointer with this method. For now no error is returned (i.e. it will always indicate success), but maybe later this method will check if the given job fits into the current queue.
|
|
Creates a bank object. This will NOT be automatically added to internally stored lists.
|
|
Returns the list of known banks. List of known banks. May be used for browsing or saving them to disk. This method is deprecated, newer programs should use banks() instead.
|
|
Returns the list of known banks. List of known banks. May be used for browsing or saving them to disk.
|
|
Remove all jobs with the given result code.
|
|
Remove all jobs with the given status code.
|
|
Creates a new Medium object (and perhaps a new medium file). The newly created object will not be added to internally stored lists; also, no bank, user, or customer object is being created. In case of a DDV medium (chip card) there is not much to be done since all the information is on the DDV chipcard -- therefore simply the Medium object is created and returned. In case of a RDH medium (keyfile), this method will perform the following steps:
Please note that under no circumstances this method will overwrite a file. If the file already exists, then this method assumes that the file contains a valid medium. In that case no keys will be created. You can try to mount the medium after calling this method to check if the existing file really is a medium. But beware: when changing data in the medium prior to mounting it (e.g. by creating new keys) then the file may be overwritten by the medium class. (see also MediumRDHBase )
|
|
Creates a customer object. This will NOT be automatically added to the given user.
|
|
|
|
Execute jobs in queue. This method executes all jobs in the outbox queue. The jobs remain in the queue until you remove them either via clearQueueByStatus() or via clearQueueByResult(). Since the queue contains a list of (reference-counting) Pointers, the jobs will only be destroyed via clearQueueBy*() if you don't have any further Pointers stored on your own, otherwise your own Pointers will still be valid and will take care of deletion.
|
|
Searches for an account in the internally stored list. No joker or wildcard allowed.
|
|
Search for a bank. Searches for a bank in the internally stored list. No joker or wildcard allowed.
|
|
Searches for a customer in the internally stored lists. No joker or wildcard allowed.
|
|
Searches for a medium of the given name. It therefore checks the media of all already knowncustomers.
|
|
Searches for a user in the internally stored lists. No joker or wildcard allowed.
|
|
Get a list of matching accounts. Returns a list of all matching accounts known to the system. This method creates a new list and returns it. Please note that changes made to the accounts in the list returned WILL affect these accounts in any list. This is due to the usage of Pointer. This way it is much easier to modify accounts.
|
|
Get a list of matching customers. This method collects a list of customers that match the given criteria.
|
|
Get a list of matching users. This method collects a list of users that match the given criteria.
|
|
|
|
Load all banks, users and accounts. There is a flag to define which parts of the data are supposed to be loaded. Generally you wouldn't need to specify anything else than the default. If you are really sure that you need to specify something non-default, then please study the implementation of the data loading and saving process in the HBCI::Loader class.
|
|
This method loads and registers a medium plugin.
|
|
Creates an medium object. This will NOT be automatically added to internally stored lists. This method rather than HBCI::API::createNewMedium is to be used when the actual medium already exists (i.e. the RDH keyfile).
|
|
This method is used to create a medium object using the data given in a configuration file. The only mandatory variable is "typename", because its content is used to determine which plugin has to provide the medium. This method loads the appropriate plugin if needed. The plugin may then use whichever variables it finds necessary. If the corresponding plugin is not available an exception will be thrown |
|
This method is used to store information from a medium to a configuration file (in order to be restorable by mediumFromConfig). The only mandatory variable is "typename", because its content is used to determine which plugin has to provide the medium. The plugin may then use whichever variables it finds necessary. |
|
This method returns the enum MediumType of the named mediumtype. The responsible plugin is loaded if needed. If the corresponding plugin is not available an exception will be thrown
|
|
Returns a pointer to the current progress monitor. The default monitor dumps all messages to stderr. Set a new monitor if you want to use other means to show a progress.
|
|
|
|
Returns the folder which is used to load plugins from.
|
|
Returns a list of all queued jobs. Returns a list of all queued jobs, of all customers and banks.
|
|
Register a medium plugin. After successfull registration the new medium type is available to OpenHBCI. This method is called from within the PluginFile upon PluginFile::registerYourSelf().
|
|
Remove a bank. Removes the given bank from the internal list. The object itself is not destroyed (since Pointers have automatic reference-counting). After this method call, the object is in the same state as one returned by HBCI::API::bankFactory(). I.e. since it doesn't belong to any internal lists it is not allowed to be used in subsequent calls to OpenHBCI.
|
|
Removes a given job from the queue.
|
|
Save all banks, users, accounts. There is a flag to define which parts of the data are supposed to be saved. Generally you wouldn't need to specify anything else than the default. If you are really sure that you need to specify something non-default, then please study the implementation of the data loading and saving process in the HBCI::Loader class.
|
|
|
|
Set the current progress monitor. Set a new progress monitor to be used.
|
|
Returns the total number of accounts that exist within all banks of this API.
|
|
Returns the total number of users that exist within all banks of this API.
|
|
Creates a user object. This will NOT be automatically added to internally stored lists.
|
|
|
|
|
|
|
|
|