FileDocCategorySizeDatePackage
TransactionStore.javaAPI DocphoneME MR2 API (J2ME)6441Wed May 02 18:00:44 BST 2007com.sun.j2me.payment

TransactionStore

public interface TransactionStore
This interface defines method, which a class needs to implement to act as a transaction store. An implementation of this class must be thread safe.
version
1.3
see
PaymentModule#getTransactionStore

Fields Summary
Constructors Summary
Methods Summary
public javax.microedition.payment.TransactionRecordaddTransaction(Transaction transaction)
Adds the given transaction to the store. It returns a new transaction record for the transaction. This transaction record must have its wasMissed flag cleared.

param
transaction the transaction
return
the new transaction record
throws
IOException indicates a storage failure

public voidcleanUp()
Removes all transaction records from the store. This is a helper method which is used in test suites to get clean state before test execution.

throws
IOException indicates a storage failure

public javax.microedition.payment.TransactionRecord[]getMissedTransactions(int applicationID)
Returns an array of the missed transaction records for the given application ID. The transaction records are returned in the order in which they have been added to the store. Each transaction record must have its wasMissed flag set.

param
applicationID the application ID
return
the array of the missed transaction records
throws
IOException indicates a storage failure

public intgetNextApplicationID()
Returns an identification number, which can be used as applicationID in the other methods. During installation each payment supporting MIDletSuite should get such number and have it stored. From that point this number will identify that MIDletSuite to the transaction store.

return
the payment application id
throws
IOException indicates a storage failure

public javax.microedition.payment.TransactionRecord[]getPassedTransactions(int applicationID)
Returns an array of the past transaction records for the given application ID. The transaction record are returned in the reverse order as they have been added to the store (most recent first). Each transaction record must have its wasMissed flag cleared.

param
applicationID the application ID
return
the array of the missed transaction records
throws
IOException indicates a storage failure

public intgetSizeUsedByApplication(int applicationID)
Returns the size which is used in the store by the application of the given application ID. This size doesn't include the size of the passed transactions (it includes only the part of the store which is removed/uninstalled by the removeApplicationRecords method).

param
applicationID the application ID
return
the size used by the application
throws
IOException indicates a storage failure

public voidremoveApplicationRecords(int applicationID)
Removes the missed records used by the application of the given application ID. This is to be used, when the MIDlet suite is uninstalled.

param
applicationID the application ID
throws
IOException indicates a storage failure

public intreserve(int applicationID, Transaction transaction)
Reserves space for the given transaction in the store. It should be called before any call to the addTransaction method to ensure that the addTransaction method won't fail later (when it is inappropriate) due to full store. This method can apply some store policies, like enforcing a maximum number of missed transactions per MIDletSuite.

param
applicationID the application id
param
transaction the transaction
return
an unique ID created for the transaction
throws
IOException indicates that the store is full or won't accept any further transaction records from that application

public voidsetDelivered(int transactionID)
This method is called after the application is successfully notified about the transaction with the given transaction ID.

param
transactionID the transaction ID
throws
IOException indicates a storage failure

public booleanwasDelivered(int transactionID)
It returns true if the setDelivered method was called for the given transaction ID.

param
transactionID the transaction ID
return
true if the setDelivered method was called for the given transaction ID
throws
IOException indicates a storage failure