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 Serializable
This class is nothing more than a specialised cover for the archive AccessName object. It provides a unified way to refer to a purse, regardless of whether it exists or not. If this class were not available, various entities in the payment block that need to refer to purses must use the AccessName of the purse directly. A cleaner solution would have been as follows:

Version:
$Revision: 1.21 $ $Date: 1998/08/03 07:41:30 $
Author:
N. Asokan (aso@zurich.ibm.com)
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 isDisabled()
Check if the purse has been disabled by the user.
 o toString()
rewrite toString() to suit our needs

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. If we don't already have the purse, we first check with the payment manager to see if it had already instantiated a purse. If so, we borrow the reference from the payment manager. This way, we'll guarantee that a purse is not instantiated multiple times (we assume that the payment manager is the first to instantiate a purse)

Returns:
purse object (or null, if the purse no longer exists)
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 isDisabled
 public boolean isDisabled()
Check if the purse has been disabled by the user.

Returns:
true if the purse has been disabled by the user
See Also:
init

All Packages  Class Hierarchy  This Package  Previous  Next  Index