All Packages Class Hierarchy This Package Previous Next Index
Class semper.payment.ecash.ecashPurse
java.lang.Object
|
+----semper.payment.Purse
|
+----semper.payment.CashLikePurse
|
+----semper.payment.ecash.ecashPurse
- public class ecashPurse
- extends CashLikePurse
-
_pocket
- The ecash pocket object for this purse
-
ecashPurse()
- Constructor
Each time the Semper program is executed, the payment manager
will call the no-arg constructor for each installed ecash Purse (or
when it is used for the first time).
-
disable()
- Disable an active ecash purse.
-
getAccountName()
- Get the account name
-
getAmount()
- Get the current amount in the purse (available as electronic coins)
Implemented from abstract method defined in Purse
-
getBalance()
- Get the current balance at the mint as recorded by the purse.
-
getBankName()
- Get the name of the bank to which this purse is attached (if any)
In case of ecash the name consists of a number, identifying the Mint.
-
getImagePursePassword()
-
-
getInput(TinguinSession, String, String, String)
- Let user enter some info on a Tinguin window with a header,
some auxiliary text, and a prompt.
-
getLogo(int)
- Get a logo of the specified size.
-
getMinimumNumberOfPayments()
- Get the minimum number of payments for this ecash purse
-
getPaymentSystemName()
- Get the Payment System Name which is represented by this purse
Access to the attribute _paymentSystemName.
-
getPurseAddress()
- Get the address to which payment protocol messages should be sent in
order to interact with this purse.
-
getUnlockedAmount()
- Get the unlocked amount
Implemented from abstract method defined in Purse
-
init()
- Initialise.
-
initPassword(TinguinSession)
- Let user choose ecash password by typing it twice
-
isCurrencySupported(Currency)
- Check if a given currency is supported.
-
isEnabled()
- Is the adapter of this Purse enabled for use?
Each subclass of this class should override this method if the
adapter is to be usable.
-
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.
-
registerWithBank(String, String)
- Register or re-register a purse with the bank.
-
setAccountName(String)
- Set the account name of this purse
-
setImagePursePassword(String)
-
-
setMinimumNumberOfPayments(Long)
- Set the minimum number of payments for this ecash purse
-
setPurseAddress(PaymentEntity)
- Set the address of this purse
-
setPurseDirectory(String)
- Set the directory of this ecash purse where ecashlib will store its files.
-
setUnlockedAmount(Amount)
- Set the unlocked amount
Implemented from abstract method defined in Purse
-
setup(TinguinSession)
-
Setting up an ecash purse
-
startTransaction()
- Starts a new Transaction.
-
startTransaction(PaymentTransactionRecord)
- Continues a Transaction on the specified TransactionRecord.
-
supportedCurrency()
- Return the list of supported currencies
Assumes: ecash pocket is initialized.
-
toString()
- Now extend the toString() method of Purse class
_pocket
protected transient ecashPocket _pocket
- The ecash pocket object for this purse
ecashPurse
public ecashPurse()
- Constructor
Each time the Semper program is executed, the payment manager
will call the no-arg constructor for each installed ecash Purse (or
when it is used for the first time). As part of the initialization
this will prompt the user to type the pursePassword. If a
correct pursePassword is typed the user will be able to do
ecash transactions for the remainder of the session.
purseName PaymentManager gets this from access control?
pursePassword PaymentManager gets this from access control?
purseDirectory for storage of ecash coins etc.
accountName at ecash Mint
address of Purse
bank at least containing hostname and port of ecash Mint
-> not really useful for the ecash adapter, but could be used
instead of the hostname and port and possibly mintID below
if the class PaymentEntity has a sufficiently rich constructor
for this info.
mintID ecash Mint ID
hostname of ecash Mint
port at ecash Mint, default 5885
getLogo
public URL getLogo(int size_index)
- Get a logo of the specified size.
- Overrides:
- getLogo in class Purse
isEnabled
public boolean isEnabled()
- Is the adapter of this Purse enabled for use?
Each subclass of this class should override this method if the
adapter is to be usable.
- 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() method of Purse class.
PRE: Purse's pocket must be there.
An ecash purse is considered registered only if the status
of its pocket can be resolved and is equal to "OK".
- Overrides:
- isRegistered in class Purse
startTransaction
public PaymentTransaction startTransaction(PaymentTransactionRecord txr) throws PaymentServiceException
- Continues a Transaction on the specified TransactionRecord.
The invoker of this method should explicitly cast the returned
object to ecashTransaction
- Parameters:
- txr - Payment transaction record
- Returns:
- a new ecashTransaction object
- Throws: PaymentServiceException
- to be handled
- Overrides:
- startTransaction in class Purse
- See Also:
- startTransaction
startTransaction
public PaymentTransaction startTransaction() throws PaymentServiceException
- Starts a new Transaction. This creates a new TransactionRecord.
The invoker of this method should explicitly cast the returned
object to ecashTransaction
- Throws: PaymentServiceException
- to be handled
- Overrides:
- startTransaction in class Purse
- See Also:
- startTransaction
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 (e.g. GENERIC). The second
part is the brand name (e.g. EuroCard).
- Overrides:
- getPaymentSystemName in class Purse
- See Also:
- getPaymentSystemName
registerWithBank
public void registerWithBank()
- Register or re-register a purse with the bank.
Implemented from abstract method defined in Purse
- Overrides:
- registerWithBank in class Purse
- See Also:
- registerWithBank
registerWithBank
public void registerWithBank(String openAccountPassword,
String randomString) throws PaymentServiceException
- Register or re-register a purse with the bank.
Implemented from abstract method defined in Purse
- Throws: PaymentServiceException
- to be handled
- See Also:
- registerWithBank
setAccountName
public synchronized void setAccountName(String accountName)
- Set the account name of this purse
- Parameters:
- accountName - String
- Returns:
- nothing
getAccountName
protected String getAccountName()
- Get the account name
- Returns:
- string containing the account name for this purse
- See Also:
- registerWithBank
supportedCurrency
public Vector supportedCurrency()
- Return the list of supported currencies
Assumes: ecash pocket is initialized.
Always returns Vector of size at most 1.
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.
Assume that supportedCurrency() returns a Vector of size 1.
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()
- Get the current amount in the purse (available as electronic coins)
Implemented from abstract method defined in Purse
- Overrides:
- getAmount in class Purse
- See Also:
- getAmount
getBalance
public Amount getBalance()
- Get the current balance at the mint as recorded by the purse.
- See Also:
- getAmount
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()
- Get the address to which payment protocol messages should be sent in
order to interact with this purse.
- Returns:
- PaymentEntity object indicating the address
- Overrides:
- getPurseAddress in class Purse
setPurseAddress
public synchronized void setPurseAddress(PaymentEntity address)
- Set the address of this purse
- Parameters:
- address - PaymentEntity
- Returns:
- nothing
- Overrides:
- setPurseAddress in class Purse
getImagePursePassword
public byte[] getImagePursePassword()
setImagePursePassword
public synchronized void setImagePursePassword(String pwd) throws PaymentServiceException
setPurseDirectory
public synchronized void setPurseDirectory(String purseDirectory)
- Set the directory of this ecash purse where ecashlib will store its files.
- Parameters:
- purseDirectory - String
- Returns:
- nothing
setMinimumNumberOfPayments
public synchronized void setMinimumNumberOfPayments(Long x)
- Set the minimum number of payments for this ecash purse
- Parameters:
- x - Long
- Returns:
- nothing
getMinimumNumberOfPayments
public synchronized Long getMinimumNumberOfPayments()
- Get the minimum number of payments for this ecash purse
- Returns:
- nothing
setup
public void setup(TinguinSession dis) throws PaymentServiceException
- Setting up an ecash purse
- Parameters:
- dis - an active Tinguin session
- Returns:
- nothing
- Throws: PaymentServiceException
- to be handled
- Overrides:
- setup in class Purse
- See Also:
- setup
getInput
public String getInput(TinguinSession display,
String heading,
String text,
String prompt) throws InputCancel
- Let user enter some info on a Tinguin window with a header,
some auxiliary text, and a prompt.
The user must choose "OK".
Copy of this method also used in TransactionBrowserApp class
- Returns:
- String
- Throws: InputCancel
- cancel by user
initPassword
public String initPassword(TinguinSession display)
- Let user choose ecash password by typing it twice
- Returns:
- the password from the user
init
public synchronized void init() throws PaymentServiceException
- Initialise. ?Register a place to receive payments?
Create an ecash pocket for a registered purse.
Assuming that the ecashPurse is enabled.
Password is chosen by user.
- Throws: PaymentServiceException
- handled by PaymentManager
- Overrides:
- init in class Purse
disable
protected void disable() throws PaymentServiceException
- Disable an active ecash purse.
This method tells ecashlib to finalize the current purse.
Implements dummy method of super class Purse.
- Throws: PaymentServiceException
- if purse cannot be disabled
- Overrides:
- disable in class Purse
- See Also:
- disable
getBankName
public String getBankName() throws PaymentServiceException
- Get the name of the bank to which this purse is attached (if any)
In case of ecash the name consists of a number, identifying the Mint.
Access to the attribute _bankName.
- Throws: PaymentServiceException
- to be handled
toString
public String toString()
- Now extend the toString() method of Purse class
- Overrides:
- toString in class Purse
All Packages Class Hierarchy This Package Previous Next Index