All Packages Class Hierarchy This Package Previous Next Index
Class semper.payment.generic.genericPurse
java.lang.Object
|
+----semper.payment.Purse
|
+----semper.payment.AccountBasedPurse
|
+----semper.payment.generic.genericPurse
- public class genericPurse
- extends AccountBasedPurse
- implements Serializable
Generic Purse - part of the adapter for the "Generic" payment module
- Version:
- $Revision: 1.50 $ $Date: 1998/08/04 11:52:00 $
- Author:
- N. Asokan ([email protected]), Jose-Luis Abad-Peiro ([email protected])
- See Also:
- genericTransaction
-
DEF_BANK_HOST
- Default parameters for purse configuration: host name of the bank
-
DEF_BANK_PORT
- Default parameters for purse configuration: communication port of the
bank
-
DEF_PORT
- Default parameters for purse configuration: local communication port for
value transfer transactions
-
DEF_PROT
- Default parameters for purse configuration: communication protocol
-
genericPurse()
- Constructor
-
genericPurse(String, PaymentEntity, PaymentEntity)
- Constructor
-
disable()
- Disable an active purse by killing its listener service point
thread, if one exists
- Pre-conditions: The purse must have been already initiated
during PaymentManager.init
- Post-condition: The purse is disabled and can be safely
deleted if necessary
- Used-by: PurseReference#deactivate
-
getAccountNumber()
- Get the account number
-
getAmount()
- Get the current amount in the purse
Implemented from abstract method defined in Purse
-
getAmountFromBank()
- Get the amount (balance) in our bank account.
-
getPaymentSystemName()
- Get the Payment System Name which is represented by this purse
Access to the attribute _paymentSystemName.
-
getPrintableStatusInfo()
- Return a hash table containing "attribute-value" pairs describing
the status of the purse.
-
getPurseAddress()
- We override getPurseAddress() so that it always contains the current host
address.
-
getUnlockedAmount()
- Get the unlocked amount
Implemented from abstract method defined in Purse
-
init()
- Initialise.
-
isCurrencySupported(Currency)
- Check if a given currency is supported
Implemented from abstract method defined in Purse
-
isEnabled()
- This adapter is always available for use.
-
isRegistered()
- Has this purse been registered with its "bank"?
-
isSecurityServiceOffered(SecurityOption)
- Check if a specific security service is offered
Implemented from abstract method defined in Purse
-
offeredSecurityServices()
- Get the list of security services offered
Implemented from abstract method defined in Purse
-
registerWithBank()
- Register or re-register a purse _with_the_bank_.
-
setUnlockedAmount(Amount)
- Set the unlocked amount
Implemented from abstract method defined in Purse
-
setup(TinguinSession)
- Setup the purse.
-
setupChoices()
- set up choices vector
-
startTransaction()
- Starts a new Transaction.
-
startTransaction(PaymentTransactionRecord)
- Resume an existing transaction
-
supportedCurrency()
- Return the list of supported currencies
Implemented from abstract method defined in Purse
DEF_PROT
protected static final String DEF_PROT
- Default parameters for purse configuration: communication protocol
DEF_PORT
protected static final String DEF_PORT
- Default parameters for purse configuration: local communication port for
value transfer transactions
DEF_BANK_PORT
protected static final String DEF_BANK_PORT
- Default parameters for purse configuration: communication port of the
bank
DEF_BANK_HOST
protected static final String DEF_BANK_HOST
- Default parameters for purse configuration: host name of the bank
genericPurse
public genericPurse()
- Constructor
genericPurse
public genericPurse(String purse_name,
PaymentEntity bank,
PaymentEntity address)
- Constructor
startTransaction
public PaymentTransaction startTransaction() throws PaymentServiceException
- Starts a new Transaction.
The invoker of this method should explicitly cast the returned
object to genericTransaction
- Throws: PaymentServiceException
- if a transaction cannot be started.
- Overrides:
- startTransaction in class Purse
- See Also:
- startTransaction
startTransaction
public PaymentTransaction startTransaction(PaymentTransactionRecord pr) throws PaymentServiceException
- Resume an existing transaction
- Parameters:
- pr - Existing payment transaction record
- Returns:
- a new PaymentTransaction object
- Throws: PaymentServiceException
- in case of exceptions
- Overrides:
- startTransaction in class Purse
getPaymentSystemName
public String getPaymentSystemName()
- Get the Payment System Name which is represented by this purse
Access to the attribute _paymentSystemName. Overriding default
method defined in Purse.java
The first part of the payment system name is a static class-wide
constant that is unique to a payment system (GENERIC). The second
part is the brand name (e.g. EuroCard).
- Overrides:
- getPaymentSystemName in class Purse
- See Also:
- getPaymentSystemName
registerWithBank
public void registerWithBank() throws PaymentServiceException
- Register or re-register a purse _with_the_bank_.
Implemented from abstract method defined in Purse
- Throws: PaymentServiceException
- if
registration failed
- Overrides:
- registerWithBank in class Purse
- See Also:
- registerWithBank
getAccountNumber
protected String getAccountNumber()
- Get the account number
- Returns:
- string containing the account number for this purse
- See Also:
- registerWithBank
supportedCurrency
public Vector supportedCurrency()
- Return the list of supported currencies
Implemented from abstract method defined in Purse
- Overrides:
- supportedCurrency in class Purse
- See Also:
- supportedCurrency
isCurrencySupported
public boolean isCurrencySupported(Currency currency)
- Check if a given currency is supported
Implemented from abstract method defined in Purse
- Overrides:
- isCurrencySupported in class Purse
- See Also:
- isCurrencySupported
offeredSecurityServices
public Vector offeredSecurityServices()
- Get the list of security services offered
Implemented from abstract method defined in Purse
- Overrides:
- offeredSecurityServices in class Purse
- See Also:
- offeredSecurityServices
isSecurityServiceOffered
public boolean isSecurityServiceOffered(SecurityOption service)
- Check if a specific security service is offered
Implemented from abstract method defined in Purse
- Overrides:
- isSecurityServiceOffered in class Purse
- See Also:
- isSecurityServiceOffered
getAmount
public Amount getAmount() throws AmountNotApplicable
- Get the current amount in the purse
Implemented from abstract method defined in Purse
- Throws: AmountNotApplicable
- always because
current amount does not make sense in this system
- Overrides:
- getAmount in class Purse
- See Also:
- getAmount
getAmountFromBank
public Amount getAmountFromBank() throws AmountNotApplicable, PaymentServiceException
- Get the amount (balance) in our bank account. The value of the
amount can be positive or negative, the latter indicating money
owed. This makes sense only for account-based payment systems.
- Returns:
- amount according to the bank account
- Throws: AmountNotApplicable
- in those systems where it is not
possible to check the bank balance
- Throws: PaymentServiceException
- for other miscellaneous errors
- Overrides:
- getAmountFromBank in class AccountBasedPurse
setUnlockedAmount
public synchronized void setUnlockedAmount(Amount amount)
- Set the unlocked amount
Implemented from abstract method defined in Purse
- Overrides:
- setUnlockedAmount in class Purse
- See Also:
- setUnlockedAmount
getUnlockedAmount
public Amount getUnlockedAmount()
- Get the unlocked amount
Implemented from abstract method defined in Purse
- Overrides:
- getUnlockedAmount in class Purse
- See Also:
- getUnlockedAmount
getPurseAddress
public PaymentEntity getPurseAddress()
- We override getPurseAddress() so that it always contains the current host
address. TODO: Check if this is a reasonable thing to do
- Returns:
- PaymentEntity object indicating the address
- Overrides:
- getPurseAddress in class Purse
isEnabled
public boolean isEnabled()
- This adapter is always available for use. Indicate it by always
returning true.
- Returns:
- s true
- Overrides:
- isEnabled in class Purse
isRegistered
public boolean isRegistered()
- Has this purse been registered with its "bank"?
- Returns:
- s true if registered, false otherwise
- Overrides:
- isRegistered in class Purse
disable
protected void disable() throws PaymentServiceException
- Disable an active purse by killing its listener service point
thread, if one exists
- Pre-conditions: The purse must have been already initiated
during PaymentManager.init
- Post-condition: The purse is disabled and can be safely
deleted if necessary
- Used-by: PurseReference#deactivate
- Throws: PaymentServiceException
- if service point thread cannot
be killed
- Overrides:
- disable in class Purse
getPrintableStatusInfo
public Hashtable getPrintableStatusInfo()
- Return a hash table containing "attribute-value" pairs describing
the status of the purse. Overrides the default implementation in
the parent class.
- Used-by: PurseManagementApp during purse configuration
- Returns:
- Hashtable containing attr-value pairs
- Overrides:
- getPrintableStatusInfo in class Purse
- See Also:
- getPrintableStatusInfo
init
public synchronized void init() throws PaymentServiceException
- Initialise. The following actions are currently taken:
- Register a place to receive payments
- [tbd] read in preferences (initialise with defaults if needed)
- Throws: PaymentServiceException
- on init failure
- Overrides:
- init in class Purse
setupChoices
public static void setupChoices()
- set up choices vector
setup
public void setup(TinguinSession dis) throws PaymentServiceException
- Setup the purse.
We have the option of entirely re-writing setup() or trying to provide
additional services to those provided by the base class. We'll do the
latter.
- Parameters:
- dis - an active Tinguin session
- Returns:
- nothing
- Throws: PaymentServiceException
- on misc. errors
- Overrides:
- setup in class Purse
- See Also:
- setup
All Packages Class Hierarchy This Package Previous Next Index