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

Class semper.payment.PurseReference

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

public class PurseReference
extends Object
implements Streamable
A unified reference to a purse object. Different entities in the payment block keep references to the same Purse object (e.g. PaymentManager, PaymentTransactionRecord objects etc.). Since these references must be persistent, they cannot be simple object references. One could keep the archive handle (AccessName) as the reference. But the Archive does not (yet) guarantee that each archive object will be instantiated exactly once. This class attempts to provide a persistent, unified way of referring to a Purse object.
Version:
$Revision: 1.15 $ $Date: 1997/01/27 12:15:27 $
Author:
N. Asokan ([email protected])
See Also:
Purse, AccessName

Constructor Index

 o PurseReference()
Constructor without args
 o PurseReference(String)
 o PurseReference(String, Purse, AccessName)

Method Index

 o getHandle()
Get the archive handle of this purse.
 o getName()
Get the purse name.
 o getPurse()
Get the object reference of this purse.
 o isActivated()
Check if the purse is active.
 o myStreamSize()
Implementing the Streamable interface
 o readObject(StreamInputInterface)
Implementing the Streamable interface
 o toString()
rewrite toString() to suit our needs
 o writeObject(StreamOutputInterface)
Implementing the Streamable interface

Constructors

 o PurseReference
  public PurseReference(String purse_name,
                        Purse purse_reference,
                        AccessName purse_handle)
Parameters:
purse_name - distinguished name of a purse
purse_reference - object reference to this purse
purse_handle - archive handle of this purse
 o PurseReference
  public PurseReference(String purse_name)
Parameters:
purse_name - distinguished name of a purse
 o PurseReference
  public PurseReference()
Constructor without args

Methods

 o toString
  public String toString()
rewrite toString() to suit our needs
Returns:
string describing this object
Overrides:
toString in class Object
 o getPurse
  public Purse getPurse() throws PaymentServiceException
Get the object reference of this purse. If the purse is still in the archive, it will be retrieved and instantiated. Otherwise, the reference to the already instantiated object will be returned.
Returns:
purse object
Throws: PaymentServiceException
if purse retrieval from archive failed.
See Also:
Purse
 o getName
  public String getName()
Get the purse name. (TODO: just get it from the purse)
Returns:
distinguished name of purse
 o getHandle
  public AccessName getHandle()
Get the archive handle of this purse.
Returns:
archive handle of purse
 o isActivated
  public boolean isActivated()
Check if the purse is active.
Returns:
true if the purse is active
See Also:
getListOfPurses
 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
 o myStreamSize
  public int myStreamSize() throws StreamIOException
Implementing the Streamable interface

All Packages  Class Hierarchy  This Package  Previous  Next  Index