Class semper.payment.PaymentTransactionRecord
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.payment.PaymentTransactionRecord

java.lang.Object
   |
   +----semper.payment.PaymentTransactionRecord

public class PaymentTransactionRecord
extends Object
implements Streamable
Repository of information related to a PaymentTransaction A PaymentTransactionRecord is the record of a transaction. This class provides the minimum functionality for transaction records. Adapter writers can extend this class. For example, any evidence accumulated during the transaction should be stored in adapter-specific attribute in the extended subclass. Eventually, we will defined a dispute handling interface which purses and transaction records will be required to implement. These implementations will require access to evidence objects.

The various setter methods of this class should be used by the service implementations in the PaymentTransaction subclasses to keep the record up to date as a transaction progresses.

Version:
$Revision: 1.14 $ $Date: 1997/01/28 12:45:21 $
Author:
N. Asokan (aso@zurich.ibm.com)
See Also:
PaymentTransaction

Variable Index

 o _handle
A unique archive handle for this object.
 o _listOfPurses
A list of PurseReference objects representing the purses associated with this Transaction.
 o _startTime
Timestamp indicating the start of Transaction.

Constructor Index

 o PaymentTransactionRecord()
Constructor with no arguments; this should be used only by the internalizer
 o PaymentTransactionRecord(AccessName)
Create an transaction record with a given archive handle.
 o PaymentTransactionRecord(AccessName, Vector)
Create an transaction record with a given archive handle and list of purses.

Method Index

 o endTransaction()
Indicate end of transaction; updates various fields and writes the transaction record to stable storage.
 o getAmount()
Retrieve the amount involved in this transaction
 o getEndTime()
Get the end time of the Transaction (or the last update)
 o getFirstPurseRef()
Get the first purse from our list of purses.
 o getListOfPurses()
Get the list of purses involved in this transaction.
 o getPeer()
Retrieve the identity of the peer in this transaction
 o getStartTime()
Get the start time of the Transaction.
 o getState()
Get the current state of the transaction.
 o getType()
Retrieve the type of the service involved in this transaction
 o isActive()
Check if there is a transaction associated with this transaction record
 o myStreamSize()
implementing the Streamable interface
 o readObject(StreamInputInterface)
Implementing the Streamable interface
 o resumeTransaction()
Resume the transaction
 o setAmount(Amount)
Set the amount involved in this transaction TODO: This shouldn't be a public method; but how to arrange it so that Transaction subclasses in the adapters have access to this method? (TODO: check to see if we need to support multiple peers amounts)
 o setListOfPurses(Vector)
Set the list of purses corresponding to this transaction.
 o setPeer(PaymentEntity)
Set the identity of the peer entity in this transaction TODO: This shouldn't be a public method; but how to arrange it so that Transaction subclasses in the adapters have access to this method? (TODO: check to see if we need to support multiple peers)
 o setPurseName(String)
Set the purse name corresponding to this transaction.
 o setState(PaymentTransactionState)
Set the state of the transaction.
 o setType(ServiceType)
Set the service type TODO: This shouldn't be a public method; but how to arrange it so that Transaction subclasses in the adapters have access to this method?
 o store()
Store the status of the transaction record
 o suspendTransaction()
Suspend the transaction.
 o toString()
Redefine toString() for pretty printing
 o writeObject(StreamOutputInterface)
Implementing the Streamable interface

Variables

 o _listOfPurses
  protected Vector _listOfPurses
A list of PurseReference objects representing the purses associated with this Transaction. Typically there is exactly one purse: the purse whose startTransaction() method created this transaction record. It is possible that multiple purses can be associated with a transaction (even though the current implementation has no such scenarios): e.g. moving value from one purse to another, say as part of a currency exchange process. In any case, we leave this attribute as a list for the time being.
See Also:
PurseReference, Vector
 o _handle
  protected AccessName _handle
A unique archive handle for this object. Uniqueness is guaranteed by the creator (a Purse object).
 o _startTime
  protected Date _startTime
Timestamp indicating the start of Transaction.
See Also:
Date

Constructors

 o PaymentTransactionRecord
  public PaymentTransactionRecord()
Constructor with no arguments; this should be used only by the internalizer
 o PaymentTransactionRecord
  public PaymentTransactionRecord(AccessName handle)
Create an transaction record with a given archive handle.
Parameters:
handle - unique archive handle (generated by the purse)
See Also:
PurseReference
 o PaymentTransactionRecord
  public PaymentTransactionRecord(AccessName handle,
                                  Vector list_of_purses)
Create an transaction record with a given archive handle and list of purses.
Parameters:
handle - unique archive handle (generated by the purse)
list_of_purses - a vector of PurseReference Objects the list of purses involved (usually one).
See Also:

Methods

 o setPurseName
  public synchronized void setPurseName(String purse_name) throws PaymentServiceException
Set the purse name corresponding to this transaction.
Parameters:
purse_name - distinguished name of purse
Returns:
nothing
Throws: PaymentServiceException
if the list of purses was already set.
See Also:
Purse
 o setListOfPurses
  public synchronized void setListOfPurses(Vector list_of_purses) throws PaymentServiceException
Set the list of purses corresponding to this transaction.
Parameters:
list_of_purses - a Vector of PurseReference objects
Returns:
nothing
Throws: PaymentServiceException
if the list of purses was already set.
 o getStartTime
  public Date getStartTime()
Get the start time of the Transaction.
Returns:
start time of the transaction
See Also:
Date
 o setType
  protected synchronized void setType(ServiceType type)
Set the service type TODO: This shouldn't be a public method; but how to arrange it so that Transaction subclasses in the adapters have access to this method?
Parameters:
type - type of the service being offered in this transaction
Returns:
nothing
 o setPeer
  protected synchronized void setPeer(PaymentEntity peer)
Set the identity of the peer entity in this transaction TODO: This shouldn't be a public method; but how to arrange it so that Transaction subclasses in the adapters have access to this method? (TODO: check to see if we need to support multiple peers)
Parameters:
peer - PaymentEntity object representing peer
Returns:
nothing
 o setAmount
  protected synchronized void setAmount(Amount amount)
Set the amount involved in this transaction TODO: This shouldn't be a public method; but how to arrange it so that Transaction subclasses in the adapters have access to this method? (TODO: check to see if we need to support multiple peers amounts)
Parameters:
amount - Amount object representing the amount
Returns:
nothing
 o getPeer
  public PaymentEntity getPeer()
Retrieve the identity of the peer in this transaction
Returns:
PaymentEntity object representing peer
 o getAmount
  public Amount getAmount()
Retrieve the amount involved in this transaction
Returns:
Amount object
 o getType
  public ServiceType getType()
Retrieve the type of the service involved in this transaction
Returns:
ServiceType object
 o resumeTransaction
  public synchronized PaymentTransaction resumeTransaction() throws PaymentServiceException
Resume the transaction
Returns:
a PaymentTransaction object
Throws: PaymentServiceException
if the transaction cannot be resumed
See Also:
startTransaction
 o endTransaction
  public synchronized void endTransaction() throws PaymentServiceException
Indicate end of transaction; updates various fields and writes the transaction record to stable storage.
Throws: PaymentServiceException
when the transaction cannot be completed cleanly.
 o suspendTransaction
  public synchronized void suspendTransaction() throws PaymentServiceException
Suspend the transaction.
Throws: PaymentServiceException
if the transaction record cannot be saved to archive.
 o isActive
  public boolean isActive()
Check if there is a transaction associated with this transaction record
Returns:
boolean flag with value true if the transaction is active
 o getEndTime
  public Date getEndTime()
Get the end time of the Transaction (or the last update)
Returns:
end time of the transaction
 o setState
  protected synchronized void setState(PaymentTransactionState state)
Set the state of the transaction.
Parameters:
state - new state value
Returns:
none
 o getState
  public PaymentTransactionState getState()
Get the current state of the transaction.
Returns:
state value
 o getListOfPurses
  public Vector getListOfPurses()
Get the list of purses involved in this transaction.
Returns:
a vector of PurseReference objects corresponding to the list of purses.
 o store
  public final synchronized void store() throws PaymentServiceException, ArchiveManException
Store the status of the transaction record
Returns:
nothing
Throws: ArchiveManException
when writing to archive failes
Throws: PaymentServiceException
when archive handle attribute of this object has not been initialised yet.
 o getFirstPurseRef
  public PurseReference getFirstPurseRef() throws PaymentServiceException
Get the first purse from our list of purses.
Returns:
PurseReference object corresponding to the first purse
Throws: PaymentServiceException
on all errros
 o toString
  public String toString()
Redefine toString() for pretty printing
Returns:
String describing this record
Overrides:
toString in class Object
 o writeObject
  public void writeObject(StreamOutputInterface s) throws StreamIOException
Implementing the Streamable interface
Throws: StreamIOException
as usual
 o readObject
  public void readObject(StreamInputInterface s) throws StreamIOException
Implementing the Streamable interface
Throws: StreamIOException
as usual
 o myStreamSize
  public int myStreamSize() throws StreamIOException
implementing the Streamable interface

All Packages  Class Hierarchy  This Package  Previous  Next  Index