|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.etill.framework.payapi.Batch
Batch objects contain all of the generic information that the Framework needs to represent a batch through which a group of transactions are processed. The combination of this object and the CassetteBatch object for the same batch constitutes the complete representation of a given batch.
A batch is uniquely identified by the combination of the merchant number and batch number. Therefore, all batch numbers for a given merchant must be unique.
Among the data maintained in Batch objects are:
BatchTotalsItem
object which contains the deposit and
credit total for a unique currency/amountExp10 combination.
com.ibm.etill.framework.payapi.PaymentAPIConstants
)
are:
com.ibm.etill.framework.payapi.PaymentAPIConstants
)
are:
Supervisor.createBatch
method.
For more information on Batch creation, please see Cassette Kit Programmer's
Guide Chapter 2 -Framework Object Model -Financial Objects and their states -Batches
This class implements methods to log the generic information about a batch into the ETBATCH database table and to retrieve that same information later on.
BatchTotalsItem
,
Supervisor.createBatch(java.lang.String, java.lang.String, java.lang.String)
Constructor Summary | |
---|---|
Batch()
Cassettes should never call this constructor. |
Method Summary | |
---|---|
void |
addCredit(Credit credit)
Adds the specified credit to this batch. |
void |
addPayment(Payment payment)
Adds the specified payment to this batch. |
Cassette |
cassette()
Returns the Cassette object for the cassette through which this Batch is processed. |
void |
createRecord(Connection conn)
This method should never be called directly from cassettes. |
void |
deleteRecord(Connection conn)
This method should never be called directly from cassettes. |
AccountAdmin |
getAccount()
Returns the generic account object with which this Batch is associated. |
String |
getAccountNumber()
Returns the account number with which this Batch is associated. |
BatchKey |
getBatchKey()
Returns an object suitable for use as a Hashtable key to represent this Batch object. |
String |
getBatchNumber()
Returns this Batch's order number. |
short |
getBatchStatus()
Returns the current balance status of this Batch object. |
CassetteBatch |
getCassetteBatch()
Returns the CassetteBatch object associated with this generic Batch object. |
boolean |
getCloseAllowed()
Indicates whether or not the merchant software may issue a BATCHCLOSE for this Batch. |
Enumeration |
getCreditList()
Returns an Enumeration of keys that identify each Credit
object associated with this Batch object. |
int |
getCurrentState()
Returns the current state of this Batch object. |
boolean |
getForceAllowed()
Indicates whether or not the merchant software may issue a BATCHCLOSE command with FORCE set to true for this Batch. |
String |
getMerchantName()
Returns the merchant number of the merchant to which this Batch belongs. |
String |
getMerchantNumber()
Returns the merchant number of the merchant to which this Batch belongs. |
Enumeration |
getPaymentList()
Returns an Enumeration of keys that identify each Payment
object associated with this Batch object. |
String |
getPaymentSystemName()
Returns the name of the cassette that is associated with this Batch. |
boolean |
getPurgeAllowed()
Indicates whether or not the merchant software may issue a BATCHPURGE for this Batch. |
ReaderWriterMonitor |
getReaderWriterMonitor()
Cassettes should not call this method. |
Enumeration |
getRelatedOrders()
Returns an Enumeration of keys that identify each Order
object that owns a Payment or Credit in this Batch. |
Timestamp |
getTimeClosed()
Returns the time and date when this Batch object was closed. |
Timestamp |
getTimeCreated()
Returns the time and date when this Batch object was created. |
Timestamp |
getTimeModified()
Returns the time and date when this Batch object was last modified. |
Enumeration |
getTotals()
Returns an Enumeration of each BatchTotalsItem belonging to this
Batch object. |
BatchTotalsItem |
getTotals(short currency,
int amountExp10)
Returns this batch's totals for the specified currency and amountExp10. |
void |
markCreditDeleted(Credit credit)
|
void |
markPaymentDeleted(Payment payment)
|
void |
removeCredit(Credit credit)
Removes the specified credit from this batch. |
void |
removePayment(Payment payment)
Removes the specified payment from this batch. |
void |
resurrectCassetteBatch()
Cassettes should not call this method. |
void |
setBatchID(int batchID)
Deprecated. |
void |
setBatchStatus(short batchStatus)
Updates this Batch object's batch balancing status. |
void |
setCloseAllowed(boolean closeAllowed)
Sets an internal flag that indicates whether or not the merchant software is allowed to issue a BATCHCLOSE command for this Batch object. |
void |
setCurrentState(int state)
Updates the current state of this Batch object and generates a StateEvent. |
void |
setForceAllowed(boolean forceAllowed)
Sets an internal flag that indicates whether or not the merchant software is allowed to issue a BATCHCLOSE command for this Batch object with the FORCE flag set to true. |
void |
setPurgeAllowed(boolean purgeAllowed)
Sets an internal flag that indicates whether or not the merchant software is allowed to issue a BATCHPURGE command for this Batch object. |
void |
setTimeClosed(Timestamp timeClosed)
Marks the time that this Batch was closed. |
void |
setUniqueKey(String uniqueKey)
Deprecated. |
void |
updateRecord(Connection conn)
This method should never be called directly from cassettes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Batch()
Supervisor.createBatch
method.Supervisor.createBatch(java.lang.String, java.lang.String, java.lang.String)
Method Detail |
public void createRecord(Connection conn) throws ETillAbortOperation
Creates a new record representing this Batch object in the ETBATCH database table.
This method is part of Batch's implementation of the Archivable interface. The
CommitPoint
object calls this method calls during commit processing
when this Batch object is a member of the CommitPoint
create list.
createRecord
in interface Archivable
Connection
- The JDBC Connection object used to access the database.ETillAbortOperation
- Thrown if an SQLException is caught.CommitPoint
public void updateRecord(Connection conn) throws ETillAbortOperation
Udates the database record that represents this Batch object in the ETBATCH table.
This method is part of Batch's implementation of the Archivable interface. The
CommitPoint
object calls this method calls during commit processing
when this Batch object is a member of the CommitPoint
update list.
updateRecord
in interface Archivable
Connection
- The JDBC Connection object used to access the database.ETillAbortOperation
- Thrown if an SQLException is caught.CommitPoint
public void deleteRecord(Connection conn) throws ETillAbortOperation
Deletes the database record that represents this Batch object from the ETBATCH table.
This method is part of Batch's implementation of the Archivable interface. The
CommitPoint
object calls this method calls during commit processing
when this Batch object is a member of the CommitPoint
delete list.
deleteRecord
in interface Archivable
Connection
- The JDBC Connection object used to access the database.ETillAbortOperation
- Thrown if an SQLException is caught.CommitPoint
public void resurrectCassetteBatch() throws ETillAbortOperation
resurrectCassetteBatch
method which is responsible for recreating the cassette's batch object.ETillAbortOperation
- thrown by the cassette to report errors.public void addPayment(Payment payment)
payment
- the Payment object representing the payment to add
to the batch.public void removePayment(Payment payment)
payment
- the Payment object representing the payment to remove
from the batch.public void markPaymentDeleted(Payment payment)
public void addCredit(Credit credit)
credit
- the Credit object representing the payment to add
to the batch.ETillCassetteException
- thrown if the same Credit is added to this
batch twice. If this exception is thrown, the Framework
will stop the cassette.public void removeCredit(Credit credit)
credit
- the Credit object representing the credit to remove
from the batch.ETillCassetteException
- thrown if an attempt is made to remove a
credit that is not currently a member of this batch.
If this exception is thrown, the Framework will stop the
cassette.public void markCreditDeleted(Credit credit)
public Enumeration getPaymentList()
Payment
object associated with this Batch object.TransactionKey
objects. One
such key will exist for each Payment
object associated
with this Batch.Payment
public Enumeration getCreditList()
Credit
object associated with this Batch object.TransactionKey
objects. One
such key will exist for each Credit
object associated
with this Batch.Credit
public Enumeration getRelatedOrders()
Order
object that owns a Payment
or Credit
in this Batch.Order
objects.Order
public Enumeration getTotals()
BatchTotalsItem
belonging to this
Batch object. Each BatchTotalsItem
object contains the deposit and
credit total for a unique currency/amountExp10 combination.BatchTotalsItem
objects.BatchTotalsItem
public BatchTotalsItem getTotals(short currency, int amountExp10)
currency
- a short containing the requested ISO 4217 currency code.amountExp10
- an int containing the requested base10 exponent value.public void setCloseAllowed(boolean closeAllowed)
newCassetteBatch
method (during batch creation).
If this method is never called, BATCHCLOSE commands will not be allowed for this batch.
closeAllowed
- a boolean set to true
if merchants
are allowed to issue BATCHCLOSE commands for this
Batch or false
if not.getCloseAllowed()
public void setPurgeAllowed(boolean purgeAllowed)
If this method is never called, BATCHPURGE commands will not be allowed for this batch.
purgeAllowed
- a boolean set to true
if merchants
are allowed to issue BATCHPURGE commands for this
Batch or false
if not.getPurgeAllowed()
public void setForceAllowed(boolean forceAllowed)
If this method is never called, BATCHCLOSE commands with FORCE set to true will not be allowed for this batch.
forceAllowed
- a boolean set to true
if merchants
are allowed to issue BATCHCLOSE commands with
FORCE set to true for this Batch or
false
if not.getForceAllowed()
public void setTimeClosed(Timestamp timeClosed)
timeClosed
- a java.sql.Timestamp
object containing
the time that the batch close operation completed.public void setBatchStatus(short batchStatus)
com.ibm.etill.framework.payapi.PaymentAPIConstants
) are:
batchStatus
- a short containing a valid batch status value.public void setUniqueKey(String uniqueKey)
public void setBatchID(int batchID)
public void setCurrentState(int state)
Cassettes should call this method as necessary to keep this object's state synchronized with the cassette's corresponding CassetteBatch object. The cassette writer is responsible for defining how the CassetteBatch's states map to those of the generic Batch objects.
The Framework generates a StateEvent if the input state value is different from the
current state value. This event will be sent out to registered event listeners the
next time the commit
method of this thread's CommitPoint is called.
state
- an int containing the new state value. This must be one of
the following order state values as defined in
com.ibm.etill.framework.payapi.PaymentAPIConstants
:
CommitPoint.addToEventList(com.ibm.etill.framework.eventmgr.PSEvent)
public String getMerchantNumber()
public String getAccountNumber()
public String getBatchNumber()
public String getPaymentSystemName()
public boolean getCloseAllowed()
true
if the merchant is allowed to
issue BATCHCLOSE commands for this Batch or
false
if not.setCloseAllowed(boolean)
public boolean getPurgeAllowed()
true
if the merchant is allowed to
issue BATCHPURGE commands for this Batch or
false
if not.setPurgeAllowed(boolean)
public boolean getForceAllowed()
true
for this Batch.true
if the merchant is allowed to
issue BATCHCLOSE commands with FORCE set to true for
this Batch. Returns false
otherwise.setForceAllowed(boolean)
public Timestamp getTimeCreated()
public Timestamp getTimeClosed()
public Timestamp getTimeModified()
public int getCurrentState()
com.ibm.etill.framework.payapi.PaymentAPIConstants
)
are:
public short getBatchStatus()
com.ibm.etill.framework.payapi.PaymentAPIConstants
)
are:
public CassetteBatch getCassetteBatch()
public AccountAdmin getAccount()
public BatchKey getBatchKey()
public String getMerchantName()
public Cassette cassette()
public ReaderWriterMonitor getReaderWriterMonitor()
The Framework calls this method to access the Batch object's ReaderWriterMonitor, which is used to obtain the object lock.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |