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

Variable Index

 o _pocket
The ecash pocket object for this purse

Constructor Index

 o 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).

Method Index

 o disable()
Disable an active ecash purse.
 o getAccountName()
Get the account name
 o getAmount()
Get the current amount in the purse (available as electronic coins) Implemented from abstract method defined in Purse
 o getBalance()
Get the current balance at the mint as recorded by the purse.
 o 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.
 o getImagePursePassword()
 o getInput(TinguinSession, String, String, String)
Let user enter some info on a Tinguin window with a header, some auxiliary text, and a prompt.
 o getLogo(int)
Get a logo of the specified size.
 o getMinimumNumberOfPayments()
Get the minimum number of payments for this ecash purse
 o getPaymentSystemName()
Get the Payment System Name which is represented by this purse Access to the attribute _paymentSystemName.
 o getPurseAddress()
Get the address to which payment protocol messages should be sent in order to interact with this purse.
 o getUnlockedAmount()
Get the unlocked amount Implemented from abstract method defined in Purse
 o init()
Initialise.
 o initPassword(TinguinSession)
Let user choose ecash password by typing it twice
 o isCurrencySupported(Currency)
Check if a given currency is supported.
 o 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.
 o isRegistered()
Has this purse been registered with its "bank"?
 o isSecurityServiceOffered(SecurityOption)
Check if a specific security service is offered Implemented from abstract method defined in Purse
 o offeredSecurityServices()
Get the list of security services offered Implemented from abstract method defined in Purse
 o registerWithBank()
Register or re-register a purse with the bank.
 o registerWithBank(String, String)
Register or re-register a purse with the bank.
 o setAccountName(String)
Set the account name of this purse
 o setImagePursePassword(String)
 o setMinimumNumberOfPayments(Long)
Set the minimum number of payments for this ecash purse
 o setPurseAddress(PaymentEntity)
Set the address of this purse
 o setPurseDirectory(String)
Set the directory of this ecash purse where ecashlib will store its files.
 o setUnlockedAmount(Amount)
Set the unlocked amount Implemented from abstract method defined in Purse
 o setup(TinguinSession)
Setting up an ecash purse
 o startTransaction()
Starts a new Transaction.
 o startTransaction(PaymentTransactionRecord)
Continues a Transaction on the specified TransactionRecord.
 o supportedCurrency()
Return the list of supported currencies Assumes: ecash pocket is initialized.
 o toString()
Now extend the toString() method of Purse class

Variables

 o _pocket
 protected transient ecashPocket _pocket
The ecash pocket object for this purse

Constructors

 o 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

Methods

 o getLogo
 public URL getLogo(int size_index)
Get a logo of the specified size.

Overrides:
getLogo in class Purse
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o setAccountName
 public synchronized void setAccountName(String accountName)
Set the account name of this purse

Parameters:
accountName - String
Returns:
nothing
 o getAccountName
 protected String getAccountName()
Get the account name

Returns:
string containing the account name for this purse
See Also:
registerWithBank
 o 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
 o 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
 o 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
 o 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
 o 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
 o getBalance
 public Amount getBalance()
Get the current balance at the mint as recorded by the purse.

See Also:
getAmount
 o 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
 o getUnlockedAmount
 public Amount getUnlockedAmount()
Get the unlocked amount Implemented from abstract method defined in Purse

Overrides:
getUnlockedAmount in class Purse
See Also:
getUnlockedAmount
 o 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
 o setPurseAddress
 public synchronized void setPurseAddress(PaymentEntity address)
Set the address of this purse

Parameters:
address - PaymentEntity
Returns:
nothing
Overrides:
setPurseAddress in class Purse
 o getImagePursePassword
 public byte[] getImagePursePassword()
 o setImagePursePassword
 public synchronized void setImagePursePassword(String pwd) throws PaymentServiceException
 o 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
 o setMinimumNumberOfPayments
 public synchronized void setMinimumNumberOfPayments(Long x)
Set the minimum number of payments for this ecash purse

Parameters:
x - Long
Returns:
nothing
 o getMinimumNumberOfPayments
 public synchronized Long getMinimumNumberOfPayments()
Get the minimum number of payments for this ecash purse

Returns:
nothing
 o 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
 o 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
 o initPassword
 public String initPassword(TinguinSession display)
Let user choose ecash password by typing it twice

Returns:
the password from the user
 o 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
 o 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
 o 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
 o 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