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 ([email protected])
- See Also:
- PaymentTransaction
-
_handle
- A unique archive handle for this object.
-
_listOfPurses
- A list of PurseReference objects representing the purses
associated with this Transaction.
-
_startTime
- Timestamp indicating the start of Transaction.
-
PaymentTransactionRecord()
- Constructor with no arguments; this should be used only by the
internalizer
-
PaymentTransactionRecord(AccessName)
- Create an transaction record with a given archive handle.
-
PaymentTransactionRecord(AccessName, Vector)
- Create an transaction record with a given archive handle and list
of purses.
-
endTransaction()
- Indicate end of transaction; updates various fields and writes
the transaction record to stable storage.
-
getAmount()
- Retrieve the amount involved in this transaction
-
getEndTime()
- Get the end time of the Transaction (or the last update)
-
getFirstPurseRef()
- Get the first purse from our list of purses.
-
getListOfPurses()
- Get the list of purses involved in this transaction.
-
getPeer()
- Retrieve the identity of the peer in this transaction
-
getStartTime()
- Get the start time of the Transaction.
-
getState()
- Get the current state of the transaction.
-
getType()
- Retrieve the type of the service involved in this transaction
-
isActive()
- Check if there is a transaction associated with this transaction
record
-
myStreamSize()
- implementing the Streamable interface
-
readObject(StreamInputInterface)
- Implementing the Streamable interface
-
resumeTransaction()
- Resume the transaction
-
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)
-
setListOfPurses(Vector)
- Set the list of purses corresponding to this transaction.
-
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)
-
setPurseName(String)
- Set the purse name corresponding to this transaction.
-
setState(PaymentTransactionState)
- Set the state of the transaction.
-
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?
-
store()
- Store the status of the transaction record
-
suspendTransaction()
- Suspend the transaction.
-
toString()
- Redefine toString() for pretty printing
-
writeObject(StreamOutputInterface)
- Implementing the Streamable interface
_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
_handle
protected AccessName _handle
- A unique archive handle for this object. Uniqueness is guaranteed
by the creator (a Purse object).
_startTime
protected Date _startTime
- Timestamp indicating the start of Transaction.
- See Also:
- Date
PaymentTransactionRecord
public PaymentTransactionRecord()
- Constructor with no arguments; this should be used only by the
internalizer
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
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:
-
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
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.
getStartTime
public Date getStartTime()
- Get the start time of the Transaction.
- Returns:
- start time of the transaction
- See Also:
- Date
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
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
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
getPeer
public PaymentEntity getPeer()
- Retrieve the identity of the peer in this transaction
- Returns:
- PaymentEntity object representing peer
getAmount
public Amount getAmount()
- Retrieve the amount involved in this transaction
- Returns:
- Amount object
getType
public ServiceType getType()
- Retrieve the type of the service involved in this transaction
- Returns:
- ServiceType object
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
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.
suspendTransaction
public synchronized void suspendTransaction() throws PaymentServiceException
- Suspend the transaction.
- Throws: PaymentServiceException
- if the transaction record
cannot be saved to archive.
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
getEndTime
public Date getEndTime()
- Get the end time of the Transaction (or the last update)
- Returns:
- end time of the transaction
setState
protected synchronized void setState(PaymentTransactionState state)
- Set the state of the transaction.
- Parameters:
- state - new state value
- Returns:
- none
getState
public PaymentTransactionState getState()
- Get the current state of the transaction.
- Returns:
- state value
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.
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.
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
toString
public String toString()
- Redefine toString() for pretty printing
- Returns:
- String describing this record
- Overrides:
- toString in class Object
writeObject
public void writeObject(StreamOutputInterface s) throws StreamIOException
- Implementing the Streamable interface
- Throws: StreamIOException
- as usual
readObject
public void readObject(StreamInputInterface s) throws StreamIOException
- Implementing the Streamable interface
- Throws: StreamIOException
- as usual
myStreamSize
public int myStreamSize() throws StreamIOException
- implementing the Streamable interface
All Packages Class Hierarchy This Package Previous Next Index