GridBank Implementation Details
For design (overview) please refer to the article.
GridBank I/O (Security) Module (gridbank/gb_io directory)
gb_errors.h defines all GridBank errors that are used by other modules for fault-tolerance.
opresult.h and .cc define OperationResult class. This class represents a result of performing GridBank operations such as money transfers, GB statements, etc. It is used by most functions as a standard way to pass error code and error string (explanation).
gb_io_client.h and .cc define a class used for communication on the client side.
gb_io_server.h and .cc define a class used for communication on the server side.
Both classes use globus_io module for establishing secure communication channels using GSS-API and GSI (Globus Security Infrastructure with Public Key cryptography using X509v3 digital certificates). Please refer to Globus documentation for further details.
gb_soap_client.cc and gb_soap_server.cc define custom SOAP communication functions for use on the client and server side respectively. They are custom functions that override default SOAP library functions and are used by GridBank protocols. These files are #include 'ed (e.g. #include "gb_soap_client.cc") in protocol .cc files so that programmers don't have to write same code over and over again.
GridBank Server
rur_converter directory contains classes for processing Resource Usage Records (RUR). At the moment, only rurconverter.h and .cc are compiled. rurconverter.cc parses RUR XML document and constructs a Document Object Model (DOM). It then calls methods defined in gridbank/server/accounting/admin.h to convert RUR items into internal format.
accounting directory contains classes that interface with GridBank MySQL database.
admin.h and .cc define a class for administrative operations. rurconverter.cc calls methods of this class to enter RUR into database.
accounts.h and .cc define a class for client operations such as money transfers, statements, as well as operations used by payment protocols.
createdb.cc contains code for the executable that creates a GridBank database.
protocols directory and subdirectories contains files that implement GridBank protocols.
All files beginning with "soap" are automatically generated by the soap compiler from gbserverapi.h. They contain C language stubs and skeletons for SOAP calls.
ServerMain.cc is compiled into 'gbserver' executable. It contains implementation of GB Server Interface, and calls methods of corresponding protocol classes.
gb.wsdl provides web service definition of GB Server Interface. This can be used by GB *Clients* (GB Payment Module and GB Charging Module) to generate SOAP stubs and skeletons.
gb.xsd defines complex types used by GB SOAP methods.
directpayment directory contains the "pre-pay" payment protocol. The server performs money transfer from client account to resource account, and then notifies the resource telling how much money the client has just given to the resource.
GridBank Charging Module (Resource Monitoring)
template_accounts directory contains template_accounts.h and .cc defining a class that allocates and deallocates local system (template) accounts. It assumes that there exists a file /etc/grid-security/template-accounts. When a client requests arrives, this class is responsible for choosing a free account (from /etc/grid-security/template-accounts file) and then making an entry in /etc/grid-security/grid-mapfile by mapping client's certificate name to the local account. This constitutes GB resource access authorization procedure.
gridmeter directory contains GridMeter.h and .cc defining a class responsible for processing Operating System-specific information generated by the modification of Globus Toolkit jobmanager. It reads accounting data stored by the jobmanager in /tmp, converts it into standard Grid Resource Usage Record (as an XML document), and then gives the internal representation (as DOM - Document Object Model) to the ChargeCalculator.
charging directory contains ChargeCalculator.h and .cc defining a class responsible for generating a bill based on RUR passed by GridMeter and resource usage rates set by the resource owner. These rates are also published in Grid Market Directory (GMD).
secureapi directory contains protocol files.
Again, files starting with "soap" define SOAP stubs and skeletons.
protocol.h and .cc define communication methods used by gridmeter and charging classes to transfer Resource Usage Record and Charge to GB Server.
GBCMMain.cc is compiled into 'gbcm' executable. It implements GB Charging Module secure API.
gb.wsdl and gb.xsd have similar purpose as those defined in GB Server.
GridBank Payment Module (GB Client GUI)
gbpm-api directory contains classes that provide interface to GB Server. The interface is used by Java GUI through Java Native Interface (JNI). clientgbapi.h and .cc use gb_io to securely commincate with the server.
gbpm-api/protocols contains files that implement client side "pre-pay" payment protocol. DirectPayment.cc is compiled into 'gb-job-run' that behaves like $GLOBUS_LOCATION/bin/globus-job-run but with added functionality to pre-pay for resource usage before submitting a job. This command assumes that the client is not permanently authorized to use the resource. GB Server after transferring money into resource account contacts the resource and notifies of the sum transfered. GB Charging Module then sets up a template account (as described above), which then allowes the client to proceed with job submission.
The top directory (gridbank/gbpm) contains C and JAVA files implementing Graphical User Interface (GUI). Java language was chosen because of greater portability to different platforms (and in the future to be integrated with Globus Toolkit version 3, which is being implemented in Java).