Class semper.payment.ecash.ecashPurse
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 changePassword()
Let user change ecash password of this purse by typing the new password twice.
 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 PurseServices
 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(TinguinDisplay, String, String, String)
Let user enter some info on a Tinguin window with a header, some auxiliary text, and a prompt.
 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 PurseServices
 o init()
Initialise.
 o initPassword(TinguinDisplay)
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 PurseServices
 o myStreamSize()
Implementing the Streamable interface
 o offeredSecurityServices()
Get the list of security services offered Implemented from abstract method defined in PurseServices
 o readObject(StreamInputInterface)
Implementing the Streamable interface
 o registerWithBank()
Register or re-register a purse with the bank.
 o registerWithBank(String, String)
 o remove()
Remove a purse Implemented from abstract method defined in PurseServices
 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 PurseServices
 o setup(TinguinDisplay)
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
 o writeObject(StreamOutputInterface)
Implementing the Streamable interface

Variables

 o _pocket
  protected Pocket _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 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
in case of exceptions
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
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 PurseServices
Overrides:
registerWithBank in class Purse
See Also:
registerWithBank
 o registerWithBank
  public void registerWithBank(String openAccountPassword,
                               String randomString) throws PaymentServiceException, ECException
 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 remove
  public void remove()
Remove a purse Implemented from abstract method defined in PurseServices
See Also:
remove
 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 PurseServices
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 PurseServices
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 PurseServices
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 PurseServices
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 PurseServices
Overrides:
getAmount in class Purse
See Also:
getAmount Includes expired cash?
 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 PurseServices
Overrides:
setUnlockedAmount in class Purse
See Also:
setUnlockedAmount
 o getUnlockedAmount
  public Amount getUnlockedAmount()
Get the unlocked amount Implemented from abstract method defined in PurseServices
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 String 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(TinguinDisplay dis) throws PaymentServiceException
Setting up an ecash purse
Parameters:
dis - an active Tinguin session
Returns:
nothing
Throws: PaymentServiceException
on misc. errors
Overrides:
setup in class Purse
See Also:
setup
 o getInput
  public String getInput(TinguinDisplay 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
 o initPassword
  public String initPassword(TinguinDisplay display)
Let user choose ecash password by typing it twice
Returns:
the password from the user
 o changePassword
  public void changePassword() throws PaymentServiceException
Let user change ecash password of this purse by typing the new password twice. The old password must be typed first to prevent others from changing the password.
 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.
Overrides:
init in class Purse
 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. Implemented from abstract method defined in Purse.java
See Also:
getBankName
 o toString
  public String toString()
Now extend the toString() method of Purse class
Overrides:
toString in class Purse
 o writeObject
  public void writeObject(StreamOutputInterface s) throws StreamIOException
Implementing the Streamable interface
Throws: StreamIOException
as usual
Overrides:
writeObject in class Purse
 o readObject
  public void readObject(StreamInputInterface s) throws StreamIOException
Implementing the Streamable interface
Throws: StreamIOException
as usual
Overrides:
readObject in class Purse
 o myStreamSize
  public int myStreamSize() throws StreamIOException
Implementing the Streamable interface
Overrides:
myStreamSize in class Purse

All Packages  Class Hierarchy  This Package  Previous  Next  Index