All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.payment.PaymentManager

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

public class PaymentManager
extends Object
Payment manager. This class implements the functionality of the main controller of the payment block. It cannot be instantiated; it contains entirely of static methods and attributes. The init() method of this class must be invoked before the payment block can be used. The init() method is typically invoked during the bootstrapping process of SEMPER.

Version:
$Revision: 1.70 $ $Date: 1998/08/18 08:23:19 $
Author:
N. Asokan ([email protected])
See Also:
Library

Variable Index

 o PURSE_LIST_AS_PAYMENT_SYSTEM_NAMES
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of payment system names (String) must be returned.
 o PURSE_LIST_AS_PURSE_NAMES
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of purse names (String) must be returned.
 o PURSE_LIST_AS_PURSE_REFS
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of PurseReference objects must be returned.
 o SELECT_BY_PAYMENT_SYSTEM_NAME
Selector constant used in getListOfPurses(selector, name) to indicate that the second argument indicates a payment system name.
 o SELECT_BY_USER_NAME
Selector constant used in getListOfPurses(selector, name) to indicate that the second argument indicates a user name.

Method Index

 o createPurse(String, String)
Create a new purse and register with the payment manager.
 o deletePurse(String)
The reverse of createPurse: remove it from the payment manager's list as well as from the archive.
 o getListOfAllPurses(int)
Return the list (in the form specified by the input parameter) of all purses registered with the manager.
 o getListOfAllPurses(int, String)
Get the list of all purses registered with the manager which match the specified criteria.
 o getListOfEnabledPurseClasses()
Extract the names of purse classes that are available for use.
 o getListOfKnownPurseClasses()
Extract the names of purse classes that the payment manager knows about.
 o getListOfPurses(int)
Return the list of all active purses registered with the manager.
 o getListOfPurses(int, String)
Get the list of all active purses registered with the manager which match the specified criteria.
 o getListOfPurses(int, String, Vector)
Get the list of purses (from the input list) matching the specified criteria.
 o getListOfPurses(int, Vector)
This method takes a Vector of PurseReference objects as input along a return type indicator.
 o getPR()
Get a handle to the payment resources object
 o getPurseReference(String)
Get the reference to the named purse.
 o getPurseReference(String, Vector)
Get the reference to the named purse from the specified list of purses.
 o init()
Initialise the static payment manager.
 o isInitialised()
Check the initialisation status
 o registerPurseClassName(String, String)
Tell the payment manager about a new payment module.

Variables

 o PURSE_LIST_AS_PURSE_REFS
 public static final int PURSE_LIST_AS_PURSE_REFS
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of PurseReference objects must be returned.

See Also:
getListOfPurses
 o PURSE_LIST_AS_PURSE_NAMES
 public static final int PURSE_LIST_AS_PURSE_NAMES
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of purse names (String) must be returned.

See Also:
getListOfPurses
 o PURSE_LIST_AS_PAYMENT_SYSTEM_NAMES
 public static final int PURSE_LIST_AS_PAYMENT_SYSTEM_NAMES
Return type indicator constant used in getListOfPurses(return_type_indicator) to indicate that a list of payment system names (String) must be returned.

See Also:
getListOfPurses
 o SELECT_BY_USER_NAME
 public static final int SELECT_BY_USER_NAME
Selector constant used in getListOfPurses(selector, name) to indicate that the second argument indicates a user name.

See Also:
getListOfPurses
 o SELECT_BY_PAYMENT_SYSTEM_NAME
 public static final int SELECT_BY_PAYMENT_SYSTEM_NAME
Selector constant used in getListOfPurses(selector, name) to indicate that the second argument indicates a payment system name.

See Also:
getListOfPurses

Methods

 o init
 public static void init() throws PaymentServiceException
Initialise the static payment manager. The payment manager is a static entity -- i.e. it is never instantiated. The initialise() method is invoked during startup. Currently, the following actions are taken:

Returns:
nothing
Throws: PaymentServiceException
if initialisation failed
 o isInitialised
 public static boolean isInitialised()
Check the initialisation status

Returns:
false if completely uninitialised; true otherwise
 o getPR
 public static PaymentResources getPR()
Get a handle to the payment resources object

Returns:
a PayementResources object
 o getListOfAllPurses
 public static Vector getListOfAllPurses(int return_type_indicator) throws PaymentServiceException
Return the list (in the form specified by the input parameter) of all purses registered with the manager.

Parameters:
return_type_indicator - flag indicating the type of items to be returned can be one of:
  • PurseReference (PURSE_LIST_AS_PURSE_REFS)),
  • purse name, (PURSE_LIST_AS_PURSE_NAMES), or
  • payment system name(PURSE_LIST_AS_PAYMENT_SYSTEM_NAME)
Returns:
Vector representing list of purses (type of elements in the vector depends on the return_type_indicator)
Throws: PaymentServiceException
for misc. errors
See Also:
PurseReference, Purse, getListOfAllPurses, getListOfPurses
 o getListOfPurses
 public static Vector getListOfPurses(int return_type_indicator) throws PaymentServiceException
Return the list of all active purses registered with the manager. Active purses are those that have been successfully initialised already.

Parameters:
return_type_indicator - flag indicating the type of items to be returned can be one of:
  • PurseReference (PURSE_LIST_AS_PURSE_REFS)),
  • purse name, (PURSE_LIST_AS_PURSE_NAMES), or
  • payment system name(PURSE_LIST_AS_PAYMENT_SYSTEM_NAME)
Returns:
Vector representing list of purses (type of elements in the vector depends on the return_type_indicator)
Throws: PaymentServiceException
for misc. errors
See Also:
PurseReference, Purse, getListOfPurses, getListOfAllPurses
 o getListOfPurses
 public static Vector getListOfPurses(int return_type_indicator,
                                      Vector purserefs) throws PaymentServiceException
This method takes a Vector of PurseReference objects as input along a return type indicator. Depending on the latter, it returns a Vector of objects that describe the original list in different ways. The returned Vector is derived from a copy of the input Vector (i.e. changes to the returned Vector will have no effect on the original Vector)

Parameters:
return_type_indicator - flag indicating the type of items to be returned (can be one of: PurseReference, purse name, or payment system name.)
Returns:
Vector representing list of purses (type of elements in the vector depends on the return_type_indicator)
Throws: PaymentServiceException
for misc. errors
See Also:
PurseReference, Purse
 o getListOfPurses
 public static Vector getListOfPurses(int selector,
                                      String name) throws PaymentServiceException
Get the list of all active purses registered with the manager which match the specified criteria. The criteria can be one of: Active purses are those that have been successfully initialised already.

Parameters:
selector - flag describing the selector
name - value of the selector parameter
Returns:
a list of PurseReference objects
Throws: PaymentServiceException
on misc errors
See Also:
getListOfAllPurses, getListOfPurses
 o getListOfAllPurses
 public static Vector getListOfAllPurses(int selector,
                                         String name) throws PaymentServiceException
Get the list of all purses registered with the manager which match the specified criteria. The criteria can be one of:

Parameters:
selector - flag describing the selector
name - value of the selector parameter
Returns:
a list of PurseReference objects
Throws: PaymentServiceException
on misc errors
See Also:
getListOfPurses, getListOfAllPurses
 o getListOfPurses
 public static Vector getListOfPurses(int selector,
                                      String name,
                                      Vector purse_refs) throws PaymentServiceException
Get the list of purses (from the input list) matching the specified criteria. The criteria can be one of:

Parameters:
selector - flag describing the selector
name - value of the selector parameter
purse_refs - Vector of PurseReference objects
Returns:
a list of PurseReference objects
Throws: PaymentServiceException
on misc errors
See Also:
PurseReference, getListOfPurses
 o getPurseReference
 public static PurseReference getPurseReference(String purse_name)
Get the reference to the named purse.

Parameters:
purse_name - distinguished name of purse.
Returns:
a purse reference object pointing to the specified purse (or null, if the payment manager does not know any purse with name purse_name)
See Also:
getPurseReference
 o getPurseReference
 public static PurseReference getPurseReference(String purse_name,
                                                Vector purse_refs)
Get the reference to the named purse from the specified list of purses.

Parameters:
purse_name - distinguished name of purse.
purse_refs - Vector containing PurseReference objects.
Returns:
a purse reference object pointing to the specified purse (or null, if there is no purse in purse_refs with name purse_name)
See Also:
getPurseReference
 o registerPurseClassName
 public static synchronized void registerPurseClassName(String key,
                                                        String purse_class)
Tell the payment manager about a new payment module. Installation scripts of payment modules should use this method to register their name with the payment manager. The registered names will be used by the PurseManagement class to provide a user interface to create new purses. If the "isEnabled()" method of the indicated class returns "true", then the class is marked as available for creating purses.

Parameters:
key - short form string tag for the payment system (e.g. "generic");
purse_class - describing the purse class name (e.g. "semper.payment.generic.genericPurse")
Returns:
nothing
See Also:
isEnabled
 o getListOfKnownPurseClasses
 public static Hashtable getListOfKnownPurseClasses()
Extract the names of purse classes that the payment manager knows about.

Returns:
Hashtable containing a list of string pairs
 o getListOfEnabledPurseClasses
 public static Hashtable getListOfEnabledPurseClasses()
Extract the names of purse classes that are available for use. Enabled purse classes are those for which the isEnabled method has returned true.

Returns:
Hashtable containing a list of string pairs
See Also:
isEnabled
 o createPurse
 public static Purse createPurse(String purse_class_name,
                                 String purse_name) throws AdapterNotFound, PaymentServiceException
Create a new purse and register with the payment manager. This is the "official" was to create a new purse. The following actions are taken during the execution of this method: It is also ensure that the purse name is unique.

Parameters:
purse_class_name - name of the purse class (e.g. ikpPurse)
purse_name - name of the new purse
Returns:
reference to the created purse
Throws: PaymentServiceException
for misc errors
Throws: AdapterNotFound
if one attempts to create a purse from a non-existent payment module
Throws: IllegalArgumentException
when a purse by the specified name already exists.
See Also:
deletePurse
 o deletePurse
 public static void deletePurse(String purse_name) throws NotApplicable, PaymentServiceException
The reverse of createPurse: remove it from the payment manager's list as well as from the archive.

Parameters:
purse_name - distinguished name of purse to remove
Throws: NotApplicable
if there is no such purse
Throws: PaymentServiceException
on failure
See Also:
createPurse

All Packages  Class Hierarchy  This Package  Previous  Next  Index