(Provider is simply another word for backend.)
Functions in this group MUST NEVER be used by applications or depending libraries ! They may only be called by AqBanking or a provider on its own.
Writing an online banking provider for AqBanking is easy. There are only a few callback functions which must be set by the provider (marked as Virtual Functions below).
The work of a provider is based on jobs (see AB_JOB). AqBanking also works based on jobs. If the application wants to create a job AqBanking calls the function AB_Provider_UpdateJob. This function lets the provider prepare some parameters for the job given (e.g. the maximum number of purpose lines for transfer jobs etc). These limits are used by applications when preparing a job.
If the application is finished preparing the job it calls AB_Banking_EnqueueJob. After the application has enqueued all jobs it calls AB_Banking_ExecuteQueue. This function now sends all jobs to their respective providers using AB_Provider_AddJob. When all jobs for a given provider are added AqBanking calls AB_Provider_Execute on this provider. This functions really sends the jobs to the bank server or creates DTAUS discs or whatever the provider is supposed to do. After that AqBanking calls AB_Provider_ResetQueue to make sure no job is left in the providers queue after execution.
Another base class used between AqBanking and providers is AB_ACCOUNT. An account stores a reference to its associated provider. When executing AB_Banking_Init AqBanking calls the provider function AB_Provider_ExtendAccount on every account to let the backend initialize the account.
It is the same with AB_USER.
typedef AB_PROVIDER*(* AB_PLUGIN_PROVIDER_FACTORY_FN)(GWEN_PLUGIN *pl, AB_BANKING *ab) |
Definition at line 295 of file provider_be.h.
typedef int(* AB_PROVIDER_ADDJOB_FN)(AB_PROVIDER *pro, AB_JOB *j, uint32_t guiid) |
See AB_Provider_AddJob.
Definition at line 88 of file provider_be.h.
typedef int(* AB_PROVIDER_EXECUTE_FN)(AB_PROVIDER *pro, AB_IMEXPORTER_CONTEXT *ctx, uint32_t guiid) |
Definition at line 94 of file provider_be.h.
typedef int(* AB_PROVIDER_EXTEND_ACCOUNT_FN)(AB_PROVIDER *pro, AB_ACCOUNT *a, AB_PROVIDER_EXTEND_MODE um) |
See AB_Provider_ExtendAccount.
Definition at line 115 of file provider_be.h.
typedef int(* AB_PROVIDER_EXTEND_USER_FN)(AB_PROVIDER *pro, AB_USER *u, AB_PROVIDER_EXTEND_MODE um) |
Definition at line 108 of file provider_be.h.
typedef int(* AB_PROVIDER_FINI_FN)(AB_PROVIDER *pro, GWEN_DB_NODE *dbData) |
See AB_Provider_Fini.
Definition at line 77 of file provider_be.h.
typedef int(* AB_PROVIDER_INIT_FN)(AB_PROVIDER *pro, GWEN_DB_NODE *dbData) |
See AB_Provider_Init.
Definition at line 72 of file provider_be.h.
typedef int(* AB_PROVIDER_RESETQUEUE_FN)(AB_PROVIDER *pro) |
Definition at line 102 of file provider_be.h.
typedef int(* AB_PROVIDER_UPDATE_FN)(AB_PROVIDER *pro, uint32_t lastVersion, uint32_t currentVersion) |
Definition at line 119 of file provider_be.h.
typedef int(* AB_PROVIDER_UPDATEJOB_FN)(AB_PROVIDER *pro, AB_JOB *j, uint32_t guiid) |
Definition at line 82 of file provider_be.h.
This type is used with AB_Provider_ExtendAccount and AB_Provider_ExtendUser.
AB_ProviderExtendMode_Create | Object to be extended has just been created. For some backends this means that some settings are allowed to be missing at this point. |
AB_ProviderExtendMode_Extend | Object to be extended has been read from the configuration file |
AB_ProviderExtendMode_Add | Object to be extended has just been added to internal lists. For the backend this might mean that the object should be completely setup at this point. |
AB_ProviderExtendMode_Remove | Object to be extended is just about to be removed from the internal list. |
AB_ProviderExtendMode_Save | This extend mode just lets the backend store data which has not yet been stored into the users/accounts DB. Please note that in this mode the backend might no longer be initialized, so you should not call any other provider function (or call AB_Provider_IsInit to see whether the backend still is initialized). |
Definition at line 42 of file provider_be.h.
AB_PROVIDER* AB_Plugin_Provider_Factory | ( | GWEN_PLUGIN * | pl, | |
AB_BANKING * | ab | |||
) |
GWEN_PLUGIN* AB_Plugin_Provider_new | ( | GWEN_PLUGIN_MANAGER * | pm, | |
const char * | name, | |||
const char * | fileName | |||
) |
void AB_Plugin_Provider_SetFactoryFn | ( | GWEN_PLUGIN * | pl, | |
AB_PLUGIN_PROVIDER_FACTORY_FN | fn | |||
) |
int AB_Provider_AddJob | ( | AB_PROVIDER * | pro, | |
AB_JOB * | j, | |||
uint32_t | guiid | |||
) |
Add the given job to the backend's internal queue. This is an immediate queue, it is not persistent. The queue is flushed by AB_PROVIDER_EXECUTE_FN. The added job is removed in any case after AB_PROVIDER_EXECUTE_FN has been called.
This function should first check the job arguments (sanity checks etc). If this function returns an error the job MUST NOT be enqueued in the providers own queue. In this case the job will be marked "errornous".
However, if the backend prepares the job well enough (via AB_PROVIDER_UPDATEJOB_FN) then the application should have made sure that the job complies to the rules laid out by the backend. So rejecting a job here should be a rare case with well-designed applications and backends.
pro | backend object |
int AB_Provider_Execute | ( | AB_PROVIDER * | pro, | |
AB_IMEXPORTER_CONTEXT * | ctx, | |||
uint32_t | guiid | |||
) |
Executes all jobs in the queue which have just been added via AB_PROVIDER_ADDJOB_FN. After calling this function all jobs are removed from the backend's queue in any case.
pro | backend object | |
ctx | im-/exporter context to receive responses |
int AB_Provider_ExtendAccount | ( | AB_PROVIDER * | pro, | |
AB_ACCOUNT * | a, | |||
AB_PROVIDER_EXTEND_MODE | em | |||
) |
Allows the backend to extend the given account (e.g. load backend-specific data for the given account).
int AB_Provider_ExtendUser | ( | AB_PROVIDER * | pro, | |
AB_USER * | u, | |||
AB_PROVIDER_EXTEND_MODE | em | |||
) |
Allows the backend to extend the given user (e.g. load backend-specific data for the given user).
int AB_Provider_Fini | ( | AB_PROVIDER * | pro | ) |
Allow the backend to deinitialize itself.
pro | backend object | |
dbData | GWEN_DB group for the data of the backend (as returned by AB_Provider_GetData). This group MUST NOT be freed or unlinked, it is a group inside AqBankings config database. |
AB_BANKING* AB_Provider_GetBanking | ( | const AB_PROVIDER * | pro | ) |
Returns the Banking object that this Provider belongs to.
GWEN_DB_NODE* AB_Provider_GetData | ( | AB_PROVIDER * | pro | ) |
Store backend specific data with AqBanking. This data is not specific to an application, it will rather be used with every application (since it doesn't depend on the application but on the backend).
pro | pointer to the backend for which the data is to be returned |
const char* AB_Provider_GetEscapedName | ( | const AB_PROVIDER * | pro | ) |
Returns the escaped name of the backend. This is needed when using the name of the backend to form a file path.
uint32_t AB_Provider_GetFlags | ( | const AB_PROVIDER * | pro | ) |
const char* AB_Provider_GetName | ( | const AB_PROVIDER * | pro | ) |
Returns the name of the backend (e.g. "aqhbci").
int AB_Provider_GetUserDataDir | ( | const AB_PROVIDER * | pro, | |
GWEN_BUFFER * | buf | |||
) |
This copies the name of the folder for AqBanking's backend data into the given GWEN_Buffer. This folder is reserved for this backend. Please note that this folder does not necessarily exist, but the backend is free to create it.
pro | pointer to the provider object | |
buf | buffer to append the path name to |
int AB_Provider_Init | ( | AB_PROVIDER * | pro | ) |
Allow the backend to initialize itself.
pro | backend object | |
dbData | GWEN_DB group for the data of the backend (as returned by AB_Provider_GetData). This group MUST NOT be freed or unlinked, it is a group inside AqBankings config database. |
int AB_Provider_IsInit | ( | const AB_PROVIDER * | pro | ) |
AB_PROVIDER* AB_Provider_new | ( | AB_BANKING * | ab, | |
const char * | name | |||
) |
int AB_Provider_ResetQueue | ( | AB_PROVIDER * | pro | ) |
Resets the queue of the backend. After calling this function all jobs are removed from the backend's queue in any case.
pro | backend object |
void AB_Provider_SetAddJobFn | ( | AB_PROVIDER * | pro, | |
AB_PROVIDER_ADDJOB_FN | f | |||
) |
void AB_Provider_SetExecuteFn | ( | AB_PROVIDER * | pro, | |
AB_PROVIDER_EXECUTE_FN | f | |||
) |
void AB_Provider_SetExtendAccountFn | ( | AB_PROVIDER * | pro, | |
AB_PROVIDER_EXTEND_ACCOUNT_FN | f | |||
) |
void AB_Provider_SetExtendUserFn | ( | AB_PROVIDER * | pro, | |
AB_PROVIDER_EXTEND_USER_FN | f | |||
) |
void AB_Provider_SetFiniFn | ( | AB_PROVIDER * | pro, | |
AB_PROVIDER_FINI_FN | f | |||
) |
void AB_Provider_SetInitFn | ( | AB_PROVIDER * | pro, | |
AB_PROVIDER_INIT_FN | f | |||
) |
void AB_Provider_SetResetQueueFn | ( | AB_PROVIDER * | pro, | |
AB_PROVIDER_RESETQUEUE_FN | f | |||
) |
void AB_Provider_SetUpdateFn | ( | AB_PROVIDER * | pro, | |
AB_PROVIDER_UPDATE_FN | f | |||
) |
void AB_Provider_SetUpdateJobFn | ( | AB_PROVIDER * | pro, | |
AB_PROVIDER_UPDATEJOB_FN | f | |||
) |
int AB_Provider_Update | ( | AB_PROVIDER * | pro, | |
uint32_t | lastVersion, | |||
uint32_t | currentVersion | |||
) |
Allows the backend to update AqBanking data. This function is called for each active provider after all backends, users and accounts have been loaded and initialised but before loading the outbox jobs.
int AB_Provider_UpdateJob | ( | AB_PROVIDER * | pro, | |
AB_JOB * | j, | |||
uint32_t | guiid | |||
) |
This function should check for the availability of the given job and prepare it for the next call to AB_PROVIDER_ADDJOB_FN. If the job is available with this backend it should also set the job parameters (such as the maximum number of purpose lines for transfer jobs etc). This function is called from the constructor AB_Job_new() in AqBanking. The value returned here is stored within the job in question and becomes available via AB_Job_CheckAvailability.
pro | backend object | |
j | job to update |