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
-
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.
-
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.
-
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.
-
SELECT_BY_PAYMENT_SYSTEM_NAME
- Selector constant used in getListOfPurses(selector, name) to indicate
that the second argument indicates a payment system name.
-
SELECT_BY_USER_NAME
- Selector constant used in getListOfPurses(selector, name) to indicate
that the second argument indicates a user name.
-
createPurse(String, String)
- Create a new purse and register with the payment manager.
-
deletePurse(String)
- The reverse of createPurse: remove it from the payment manager's list
as well as from the archive.
-
getListOfAllPurses(int)
- Return the list (in the form specified by the input parameter) of
all purses registered with the manager.
-
getListOfAllPurses(int, String)
- Get the list of all purses registered with the manager which match
the specified criteria.
-
getListOfEnabledPurseClasses()
- Extract the names of purse classes that are available for use.
-
getListOfKnownPurseClasses()
- Extract the names of purse classes that the payment manager
knows about.
-
getListOfPurses(int)
- Return the list of all active purses registered with the manager.
-
getListOfPurses(int, String)
- Get the list of all active purses registered with the manager which
match the specified criteria.
-
getListOfPurses(int, String, Vector)
- Get the list of purses (from the input list) matching the specified
criteria.
-
getListOfPurses(int, Vector)
- This method takes a Vector of PurseReference objects as input along
a return type indicator.
-
getPR()
- Get a handle to the payment resources object
-
getPurseReference(String)
- Get the reference to the named purse.
-
getPurseReference(String, Vector)
- Get the reference to the named purse from the specified list of purses.
-
init()
- Initialise the static payment manager.
-
isInitialised()
- Check the initialisation status
-
registerPurseClassName(String, String)
- Tell the payment manager about a new payment module.
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
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
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
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
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
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:
- If the configuration parameter
semper.payment.noListeners
or
semper.noListeners
is not set, then
- register an address with the comm. manager to listen for
incoming negotiation requests
- Create a PaymentResources object depending on the value of
the configuration parameter
semper.configuration.language
and include it in
the payment manager state (this is used for local language support -
currently in testing phase)
- Initialise user preferences
- Register launchabel applications with ApplicationsMenu
- Read in status from the archive
- Initialise all purses
- Pre-conditions:
- SEMPER blocks log, configuration, archive, preferences, and
tinguin must be already initialised
- Post-conditions:
- Payment block is ready for use
- Used-by: typically only the SEMPER bootstrap process needs to
use this.
- Returns:
- nothing
- Throws: PaymentServiceException
- if initialisation failed
isInitialised
public static boolean isInitialised()
- Check the initialisation status
- Returns:
- false if completely uninitialised; true otherwise
getPR
public static PaymentResources getPR()
- Get a handle to the payment resources object
- Returns:
- a PayementResources object
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
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.
- Pre-conditions: Payment manager should be initialised
- 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
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
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:
- Payment System name (SELECT_BY_PAYMENT_SYSTEM_NAME)
- User name (not supported yet) (SELECT_BY_USER_NAME)
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
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:
- Payment System name (SELECT_BY_PAYMENT_SYSTEM_NAME)
- User name (not supported yet) (SELECT_BY_USER_NAME)
- 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
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:
- Payment System name (SELECT_BY_PAYMENT_SYSTEM_NAME)
- User name (not supported yet) (SELECT_BY_USER_NAME)
- 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
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
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
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.
- Used-by: Payment module/adapter installation program(s)
- 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
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
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
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:
- Create a new Purse object of the specified Purse subclass (the
Purse subclass should provide a constructor with no arguments
for this purpose)
- Generate an archive handle with a standard structure and store
the purse in the archive with that handle
- Add the purse to the payment manager's list of purses
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
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