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

HBCI::OutboxJob Class Reference

Abstract base class for all jobs to be used with HBCIAPI. More...

#include <outboxjob.h>

Inheritance diagram for HBCI::OutboxJob:

Inheritance graph
[legend]
List of all members.

Public Methods

 OutboxJob (Pointer< Customer > c)
virtual ~OutboxJob ()
Manage Customer
Pointer< Customercustomer () const
void addSigner (Pointer< Customer > c)
Status Information
OutboxJob_Status status () const
OutboxJob_Result result () const
int id () const
virtual string description () const=0
virtual list< int > resultCodes () const=0
const MessageReferencemessageReference () const
virtual int segmentForStatusReport () const
virtual JobProgressType type () const=0

Protected Methods

void addSignersToQueue (Pointer< MessageQueue > q) const
virtual int messages () const
Manipulation from HBCIAPI
void setId (int i)
void setMessageReference (const MessageReference &ref)
void setStatus (OutboxJob_Status s)
virtual bool createHBCIJobs (Pointer< MessageQueue > mbox, int n=0)=0
virtual bool evaluate ()=0
virtual bool commit (int msgNumber=HBCI_COMMIT_WHOLE_JOB)=0
Information for HBCIAPI
virtual bool isDialogJob () const
virtual bool stillMessagesToSend (int nextMsg) const

Static Protected Methods

list< int > resultCodesFromJob (const Job &job)

Protected Attributes

Pointer< Customer_cust
Pointer< Bank_bank
OutboxJob_Result _result

Friends

class API
class Outbox
class customerQueue

Detailed Description

Abstract base class for all jobs to be used with HBCIAPI.

This is an abstract base class for the jobs of the OpenHBCI-Wrapper API. Every job to be used in the Outbox is derived from this.

If you plan to add a new job, just code your own derivation. But note that in order to provide the ProgressMonitor with the information that *this* job is being started, you would need to add an appropriate enum value to JobProgressType in progressmonitor.h . Apart from that, you don't need to take care of anything else except to derive from OutboxJob.

Author:
Martin Preuss<martin@libchipcard.de>


Constructor & Destructor Documentation

HBCI::OutboxJob::OutboxJob Pointer< Customer   c
 

Default Constructor.

virtual HBCI::OutboxJob::~OutboxJob   [virtual]
 

Default Destructor.


Member Function Documentation

void HBCI::OutboxJob::addSigner Pointer< Customer   c
 

Adds a signer.

Here you can add a signer. In most cases you don't need this method, since the first signer is already given in the constructor. But you need this method if this job needs multiple signers for your bank.

Author:
Martin Preuss<martin@libchipcard.de>

void HBCI::OutboxJob::addSignersToQueue Pointer< MessageQueue >    q const [protected]
 

Helper function to copy the stored signers to the given message queue.

virtual bool HBCI::OutboxJob::commit int    msgNumber = HBCI_COMMIT_WHOLE_JOB [protected, pure virtual]
 

Call this method to commit changes to the system.

Since Jobs do not change the system you may call this method to commit the changes. A job for getting the balance for example may decide to store the retrieved balance in the corresponding account.

Parameters:
msgNumber  Number of the message for which the response should be committed. As a job may consist of more than one message, it might be necessary to commit recieved changes before the rest of the job is sent. This method is called for each message and finally for the whole job (if called for the whol job, msgNumber is set to HBCI_COMMIT_WHOLE_JOB)
Author:
Martin Preuss<martin@libchipcard.de>
Returns :
true on success, false otherwise

Implemented in HBCI::OutboxJobGetBalance, HBCI::OutboxJobGetTransactions, HBCI::OutboxJobTransfer, HBCI::OutboxJobDebitNote, HBCI::OutboxJobKeys, HBCI::OutboxJobDisableKeys, HBCI::OutboxJobChangeKeys, HBCI::OutboxJobGetAccounts, HBCI::OutboxJobSynchronize, HBCI::OutboxJobGetStatusReports, HBCI::OutboxJobGetStandingOrders, HBCI::OutboxJobNewStandingOrder, and HBCI::OutboxJobDeleteStandingOrder.

virtual bool HBCI::OutboxJob::createHBCIJobs Pointer< MessageQueue >    mbox,
int    n = 0
[protected, pure virtual]
 

Let the job create the "real" jobs and add them to the message queue given.

Author:
Martin Preuss<martin@libchipcard.de>
Returns :
true on success, false otherwise
Parameters:
mbox  pointer to the messagebox to add the jobs to
n  the number of the message to create. In most cases this is zero.

Implemented in HBCI::OutboxJobGetBalance, HBCI::OutboxJobGetTransactions, HBCI::OutboxJobTransfer, HBCI::OutboxJobDebitNote, HBCI::OutboxJobKeys, HBCI::OutboxJobDisableKeys, HBCI::OutboxJobDisableLostKeys, HBCI::OutboxJobChangeKeys, HBCI::OutboxJobGetAccounts, HBCI::OutboxJobSynchronize, HBCI::OutboxJobGetStatusReports, HBCI::OutboxJobGetStandingOrders, HBCI::OutboxJobNewStandingOrder, and HBCI::OutboxJobDeleteStandingOrder.

Pointer<Customer> HBCI::OutboxJob::customer   const [inline]
 

Returns a pointer to the Customer owning this job.

Author:
Martin Preuss<martin@libchipcard.de>

virtual string HBCI::OutboxJob::description   const [pure virtual]
 

Return a short description of what the job is supposed to do.

Author:
Martin Preuss<martin@libchipcard.de>

Implemented in HBCI::OutboxJobGetBalance, HBCI::OutboxJobGetTransactions, HBCI::OutboxJobTransfer, HBCI::OutboxJobDebitNote, HBCI::OutboxJobKeys, HBCI::OutboxJobGetKeys, HBCI::OutboxJobSendKeys, HBCI::OutboxJobDisableKeys, HBCI::OutboxJobChangeKeys, HBCI::OutboxJobGetAccounts, HBCI::OutboxJobSynchronize, HBCI::OutboxJobGetSystemId, HBCI::OutboxJobGetStatusReports, HBCI::OutboxJobGetStandingOrders, HBCI::OutboxJobNewStandingOrder, and HBCI::OutboxJobDeleteStandingOrder.

virtual bool HBCI::OutboxJob::evaluate   [protected, pure virtual]
 

Let the job check the result and set the flags.

Let the job check the result. This means checking the results of all Jobs involved (which otherwise is not done automatically). This method sets its status and result accordingly -- otherwise the status and result flags might not be up-to-date.

Author:
Martin Preuss<martin@libchipcard.de>
Returns :
true if job was successfull, false otherwise

Implemented in HBCI::OutboxJobGetBalance, HBCI::OutboxJobGetTransactions, HBCI::OutboxJobTransfer, HBCI::OutboxJobDebitNote, HBCI::OutboxJobKeys, HBCI::OutboxJobGetAccounts, HBCI::OutboxJobSynchronize, HBCI::OutboxJobGetStatusReports, HBCI::OutboxJobGetStandingOrders, HBCI::OutboxJobNewStandingOrder, and HBCI::OutboxJobDeleteStandingOrder.

int HBCI::OutboxJob::id   const [inline]
 

Return the id of this job.

Return the id of this job. Each enqueued job has a unique id. This can be used from an application to identify specific jobs after they have been added to the outbox queue.

Author:
Martin Preuss<martin@libchipcard.de>

virtual bool HBCI::OutboxJob::isDialogJob   const [inline, protected, virtual]
 

Return true if this OutboxJob is a dialog job.

A dialog job is one that handles the opening and closing of a dialog itself. Such are OutboxJobGetKeys, OutboxJobSendKeys etc.

Author:
Martin Preuss<martin@libchipcard.de>

Reimplemented in HBCI::OutboxJobKeys, and HBCI::OutboxJobSynchronize.

const MessageReference& HBCI::OutboxJob::messageReference   const [inline]
 

Returns the message reference of this job. This is later used for status reports, StatusReport::messageReference(). FIXME: This is not set in the beginning, but it is only set after that job has been executed, or did I get something wrong?

virtual int HBCI::OutboxJob::messages   const [inline, protected, virtual]
 

Returns the number of messages this job needs.

This method is used to calculate the return value of OutboxJob::stillMessagesToSend, and it is used by API::_handleJobQueue to determine the number of actions that are going to be started.

If this is a dialog job, then it consists of at least two messages:

  • dialog init message
  • dialog closing message
Since not all jobs may be mixed in ONE message this method returns the number of messages it needs.

Author:
Martin Preuss<martin@libchipcard.de>

Reimplemented in HBCI::OutboxJobKeys, HBCI::OutboxJobDisableKeys, HBCI::OutboxJobDisableLostKeys, HBCI::OutboxJobChangeKeys, and HBCI::OutboxJobSynchronize.

OutboxJob_Result HBCI::OutboxJob::result   const [inline]
 

Return the result code of the job.

Return the result code of the job. This of course is only usefull AFTER the job has been performed ;-) The result can be one of these:

Author:
Martin Preuss<martin@libchipcard.de>

virtual list<int> HBCI::OutboxJob::resultCodes   const [pure virtual]
 

Returns a list of result codes of this job.

This can be used to get more detailed information if the result of this job was HBCI_JOB_RESULT_FAILED. In that case, you can traverse this list, checking for resultcodes >= 9000. Each of those can be the source of the job failure, so you can react accordingly. HBCI spec suggests that the most important of them can be found at the front() already, but that depends on your bank.

Note: A resultcode >= 9000 does not automatically mean an error, see MessageQueue::getResult().

See also:
MessageQueue::getResult(), Job::errorcodeIsLibraryBug()

Implemented in HBCI::OutboxAccountJob, HBCI::OutboxJobGetBalance, HBCI::OutboxJobGetTransactions, HBCI::OutboxJobTransfer, HBCI::OutboxJobDebitNote, HBCI::OutboxJobKeys, HBCI::OutboxJobGetAccounts, HBCI::OutboxJobSynchronize, HBCI::OutboxJobGetStatusReports, HBCI::OutboxJobGetStandingOrders, HBCI::OutboxJobNewStandingOrder, and HBCI::OutboxJobDeleteStandingOrder.

list<int> HBCI::OutboxJob::resultCodesFromJob const Job &    job [static, protected]
 

Helper function to extract a list of result codes from a Job.

virtual int HBCI::OutboxJob::segmentForStatusReport   const [virtual]
 

Returns the number of the segment to be used for status reports, i.e. the number that shows up in StatusReport::segment() (FIXME: is this correct?)

FIXME: This is not set in the beginning, but it is only set after that job has been executed, or did I get something wrong?

By default this is "-1", meaning no segment number (NOTE: In this case the corresponding field in HKPRO will be left out). This can be overriden by a derived OutboxJob.

Reimplemented in HBCI::OutboxJobTransfer, and HBCI::OutboxJobDebitNote.

void HBCI::OutboxJob::setId int    i [inline, protected]
 

Set id.

This is called by the Outbox to assign a unique id to all enqueued jobs.

Author:
Martin Preuss<martin@libchipcard.de>

void HBCI::OutboxJob::setMessageReference const MessageReference   ref [protected]
 

Sets the reference of this message, used for status reports later.

Author:
Martin Preuss<martin@libchipcard.de>

void HBCI::OutboxJob::setStatus OutboxJob_Status    s [inline, protected]
 

Set status of this job.

OutboxJob_Status HBCI::OutboxJob::status   const [inline]
 

Returns the status of this job.

Returns the status of this job. It can be one of the following:

Author:
Martin Preuss<martin@libchipcard.de>

virtual bool HBCI::OutboxJob::stillMessagesToSend int    nextMsg const [inline, protected, virtual]
 

Returns true if there are still messages to be sent.

Checks if there are still messages to be sent. This is needed because some jobs don't know the number of messages they consist of, until they are executed.

Parameters:
nextMsg  The number (starting with 0) of the message that would be sent next
Returns :
true If there are unsent messages left
Author:
Fabian Kaiser<openhbci@derzach.de>

Reimplemented in HBCI::OutboxJobGetTransactions, HBCI::OutboxJobGetStatusReports, HBCI::OutboxJobGetStandingOrders, HBCI::OutboxJobNewStandingOrder, and HBCI::OutboxJobDeleteStandingOrder.

virtual JobProgressType HBCI::OutboxJob::type   const [pure virtual]
 

Return the JobProgressType of this job.

Author:
Christian Stimming <stimming@tuhh.de>

Implemented in HBCI::OutboxJobGetBalance, HBCI::OutboxJobGetTransactions, HBCI::OutboxJobTransfer, HBCI::OutboxJobDebitNote, HBCI::OutboxJobGetKeys, HBCI::OutboxJobSendKeys, HBCI::OutboxJobDisableKeys, HBCI::OutboxJobChangeKeys, HBCI::OutboxJobGetAccounts, HBCI::OutboxJobGetSystemId, HBCI::OutboxJobGetStatusReports, HBCI::OutboxJobGetStandingOrders, HBCI::OutboxJobNewStandingOrder, and HBCI::OutboxJobDeleteStandingOrder.


Friends And Related Function Documentation

friend class API [friend]
 

friend class customerQueue [friend]
 

friend class Outbox [friend]
 


Member Data Documentation

Pointer<Bank> HBCI::OutboxJob::_bank [protected]
 

Pointer<Customer> HBCI::OutboxJob::_cust [protected]
 

OutboxJob_Result HBCI::OutboxJob::_result [protected]
 


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