com.ibm.etill.framework.cassette.query
Class CassetteQuery

java.lang.Object
  |
  +--com.ibm.etill.framework.cassette.query.CassetteQuery

public abstract class CassetteQuery
extends Object

CassetteQuery defines the framework's interface to each cassette under the PaymentServlet.

When the Payment Servlet starts, the Framework obtains the list of configured cassettes from the ETCASSETTECFG database table. For each cassette, the Framework creates a single instance of the cassettes' CassetteQuery subclass. Once the object is instantiated and initialized, the Framework later calls the object's methods to process or augment query API commands.

Cassettes should extend this class if they manage any of the following:

In most cases, at least one of these will apply to each new cassette.

Note 1: The names of the derived classes are built from cassette name and company name in the cassette configuration table, ETCASSETTECFG. Complete rules for cassette and cassette package names can be found in the Cassette Kit Programmer's Guide,.

Note 2: CassetteQuery objects are instantiated in the Payment Servlet JVM, while administrative and payment API processing are performed in the Payment Server Engine. In the Payment Servlet JVM, the com.ibm.etill.framework.cassette.query.Cassette class serves as the Framework's interface to the cassette.

See Also:
Cassette, QueryRequest

Field Summary
protected  String messageID
           
 
Constructor Summary
protected CassetteQuery(String cassetteName)
          Constructor
 
Method Summary
static boolean isCassetteLoaded(String cassetteName)
          Indicates whether or not a CassetteQuery object has been loaded into the PaymentServlet JVM for the specified cassette.
static void loadCassettes()
          Cassettes should never call this method.
abstract  void query(QueryRequest request, Vector objects)
          Provides cassette-specific data associated with a given set of generic objects for this cassette.
static void queryCassette(String cassetteName, QueryRequest request, Vector objects)
          Provides cassette-specific data associated with a given set of generic objects for the specified cassette.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messageID

protected String messageID
Constructor Detail

CassetteQuery

protected CassetteQuery(String cassetteName)
Constructor
Method Detail

loadCassettes

public static void loadCassettes()
Cassettes should never call this method. The Framework calls this method to load the query class for each cassette at Payment Servelet startup.

queryCassette

public static void queryCassette(String cassetteName,
                                 QueryRequest request,
                                 Vector objects)
                          throws com.ibm.etill.framework.payapi.ETillAbortOperation
Provides cassette-specific data associated with a given set of generic objects for the specified cassette. The data returned by this method will be combined with the generic data for the same set of objects to form the complete set of query data.

This method is never to be called directly by cassette developers. Instead the framework calls this method to discover cassette specific attributes and or state information to satisfy a query request.

Parameters:
cassetteName - a String that contains the configured name of the cassette
request - a QueryRequest object which fully describes the request to be processed by the cassette
objects - a Vector through whihch the cassette-specific objects are to be returned to the caller
Throws:
com.ibm.etill.framework.payapi.ETillAbortOperation - thrown if request processing fails. The primary and secondary return codes contained in the exception object will be returned to the original requestor in a response message by the Framework. The Framework will then continue processing of the next incoming request.

isCassetteLoaded

public static boolean isCassetteLoaded(String cassetteName)
                                throws com.ibm.etill.framework.payapi.ETillAbortOperation
Indicates whether or not a CassetteQuery object has been loaded into the PaymentServlet JVM for the specified cassette.
Returns:
boolean true if a CassetteQuery object has been loaded for the specified cassette, false if not
Throws:
com.ibm.etill.framework.payapi.ETillAbortOperation - declared but not thrown

query

public abstract void query(QueryRequest request,
                           Vector objects)
                    throws com.ibm.etill.framework.payapi.ETillAbortOperation
Provides cassette-specific data associated with a given set of generic objects for this cassette. Cassettes must extend this class to provide their own protocol-specific data.

The data returned by this method will be combined with the generic data for the same set of objects to form the complete set of query data.

Parameters:
request - a QueryRequest object which fully describes the request to be processed by the cassette.
objects - a Vector through whihch the cassette-specific objects are to be returned to the caller.
Throws:
com.ibm.etill.framework.payapi.ETillAbortOperation - thrown if request processing fails. The primary and secondary return codes contained in the exception object will be returned to the original requestor in a response message by the Framework. The Framework will then continue processing of the next incoming request.