webfunds.client.sox
Class SOXWallet

java.lang.Object
  |
  +--webfunds.utils.Debug
        |
        +--webfunds.client.sox.SOXWallet

public class SOXWallet
extends Debug
implements WalletInterface

The GUI Wallet. Needs to be rewritten into 2 wallets, a highlevel WebFunds GUI wallet and a low level SOX wallet that returns all info internally. See quiteCancel for example of low call. It should not use AccountInfo (artifact of Receipt Store).


Field Summary
protected  AccountStore accountStore
           
protected  java.lang.String closeErrorReason
           
protected  java.util.Vector confirmmails
           
protected  WalletContext context
          Our interface to the outside world.
protected  ContractStore contracts
           
protected static java.lang.String fix
           
protected static java.lang.String name
           
protected static java.lang.String no_net
           
protected  java.util.Properties properties
           
protected  ReceiptsStore receiptStore
           
protected  java.lang.String shortname
           
static java.lang.String SOX_MESSAGE
           
protected  SOXServerStore soxes
           
static java.lang.String[] soxFrames
          As a Wallet, I can add additional plugins.
protected  Store store
           
protected static java.lang.String try_again_later
           
 
Fields inherited from class webfunds.utils.Debug
bug, debugAll, logfix
 
Fields inherited from interface webfunds.client.WalletInterface
CODE_FREEZE, CODE_SHUTDOWN, CODE_UNFREEZE
 
Constructor Summary
SOXWallet()
           
SOXWallet(java.io.PrintWriter bug)
           
SOXWallet(java.io.PrintWriter bug, java.lang.String f)
           
 
Method Summary
 AccountInfo addAccount()
          Client Wallet Interface
 ItemId addContract(AccountInfo info, ItemId item)
          Adds the contract to the Account.
protected  void addPlugins(java.lang.String[] frames)
           
 int adminEvent(int code, java.lang.String reason)
          Shutdown signal or similar.
 byte[] asciiArmour(AbstractPayment pay)
          Make an ASCII-armoured message from a payment, a la PGP armouring.
 byte[] asciiArmourWithError(AbstractPayment pay)
          Make an ASCII-armoured message from a payment, a la PGP armouring.
 boolean ask(java.lang.String q)
          Ask a question of the user, return true if yes
 void aviso(java.lang.String e)
           
 void cancel(AccountId account, ItemId item, java.lang.String pid)
          Cancel a Payment (pid) within a SubAccount.
 void cancel(Transaction trans)
          Cancel a Transaction.
 void cancel(Transaction[] trans)
          Cancel many Transactions.
protected  void cancel(ValueAccount sub, java.lang.String pid)
          Cancel a Payment (pid) within a SubAccount.
 java.lang.String checkReceipt(MailItem mail, AccountId p_src, AccountId p_tgt, ItemId p_item, long amount)
          Check the receipt conforms to what was expected.
 java.lang.String checkReceipt(Receipt receipt, AccountId p_src, AccountId p_tgt, ItemId p_item, long p_qty)
          Check the receipt conforms to what was expected.
 int closeCode()
           
 java.lang.String closeReason()
           
 void confirm(java.util.Vector v, byte[] b)
           
 void confirm(java.util.Vector v, MailItem mi)
           
 AccountId createAccount(java.lang.String name)
          Create a new account in the Wallet and return it's AccountId.
 AbstractPayment decodeSOXPayment(byte[] data)
          Decoder of SOX armoured messages.
 Receipt doDeposit(AbstractPayment pay, AccountId account, byte[] desc, java.lang.String idempotentId)
          Deposit the given payment.
 void error(java.lang.String e)
           
 Account getAccount(AccountId id)
           
 Account getAccount(AccountInfo info)
           
 java.lang.String getAccountHelp()
           
 AccountId getAccountId(AccountInfo info)
           
protected  AccountId getAccountId(SubAccount sub)
          Make an AccountId for this sub account.
protected  AccountInfo getAccountInfo(SubAccount sub)
          Make an AccountInfo for this sub account.
 Account getAccountOrDie(AccountId id)
          Call this one if you know the account is there, and you don't want to handle the exception.
 Account getAccountOrDie(AccountInfo info)
          Call this one if you know the account is there, and you don't want to handle the exception.
 AccountInfo[] getAccounts()
          Get all accounts known to this wallet.
 Account[] getAccounts2()
           
 java.lang.String getContractHelp()
           
 ItemId[] getContracts(AccountInfo account)
          Get all contracts that are in this account
 java.lang.String getProtocol()
          Get the protocol name.
 java.lang.String getShortName()
          Get a name for this wallet.
 Transaction[] getTransactions(AccountInfo info, ItemId contract)
          Transaction is the external Wallet definition of a transaction.
 StateReceipt getTransactionState(AccountId acct, ItemId item, java.lang.String id)
          Low level wallet method to return the state for a transaction.
 long getValue(AccountId acct, ItemId contract, boolean pending)
           
 long getValue(AccountInfo info, ItemId contract, boolean pending)
          Client Wallet Interface
 java.lang.String getVersion()
          Get the version number of the protocol.
 java.lang.String getWalletHelp()
          Provide a help string for each of the different levels.
 boolean handleMail(MailItem mail, SubAccount sub)
          Switchboard for various mail types.
 boolean handleReceipt(Receipt rec, AccountId acct)
           
 boolean handleReceiptData(byte[] recdata, AccountId acct)
          For some reason, Receipts are stored on an account basis.
protected  void internalCancel(ValueAccount sub, java.lang.String pid)
          Cancel a Payment (pid) within a SubAccount.
protected  void internalCancel(ValueAccount sub, java.lang.String[] pids)
          Cancel Payments (by pids) within a SubAccount before they hit the server.
protected  void internalUpdate(SubAccount sub, MailItem mail)
           
protected  void internalUpdate(SubAccount sub, MailItem[] mails)
          Handle this mail that came via another request or another subaccount.
 boolean isClosed()
           
 boolean isTestMode()
          Ask a question of the user, return true if yes
 void makeDeposit(byte[] payBuf, AccountInfo callerAc, byte[] desc)
          Do a deposit.
 byte[] makePayment(ItemId contractid, AccountInfo source, AccountInfo targetinfo, long amount, byte[] desc, java.util.Date from, java.util.Date till)
          Make an ASCII-armoured payment, a la PGP armouring.
 Payment makePurePayment(AccountId src, AccountId tgt, ItemId contractid, long amount, byte[] desc, long from, long till, java.lang.String pid)
          Make a payment.
 Payment makePurePayment(AccountInfo source, AccountInfo target, ItemId instrument, long amount, byte[] description, long validFrom, long validTill, java.lang.String paymentId)
          Conversion between high level and low level.
 Payment makeRollover(AccountId src, AccountId tgt, ItemId contractid, byte[] desc, long till)
          Make a Rollover payment.
 Payment makeSafePayment(AccountId src, AccountId tgt, ItemId contractid, long amount, byte[] desc, long from, long till, java.lang.String pid)
          Make a payment.
 TokenPayment makeTokenPayment(AccountId src, AccountId tgt, ItemId contractid, long amount, byte[] desc, long from, long till, int type)
          Make a Token payment.
protected  void manyUpdates(SubAccount sub, MailItem[] mails)
          Get and sign for the mail from the issuer for this account.
protected  MailItem[] quietCancel(ValueAccount sub, java.lang.String pid)
          Cancel a Payment (pid) within a SubAccount.
protected  void quietCancel(ValueAccount sub, java.lang.String[] pids)
          Cancel many Payments (pid) within a SubAccount.
 boolean removeAccount(AccountInfo accountinfo)
          Client Wallet Interface
 boolean removeContract(AccountInfo accountinfo, ItemId item)
          Client Wallet Interface
 boolean renameAccount(AccountInfo accountinfo, java.lang.String name)
          Rename the account.
protected  void savePaymentAsPending(AccountId src, AbstractPayment pay)
          Save a payment made as Pending.
 void setShortName(java.lang.String name)
          Shortname is used for the stores.
 void setStore(Store store)
          Set the Store.
 void setWalletContext(WalletContext aContext)
          Set the WalletContext.
 java.lang.String toString()
           
protected  MailId[] tryHandle(SubAccount sub, MailItem[] mails)
          Do an update - one single cycle of request with sigs.
protected  MailItem[] tryUpdate(SubAccount sub, MailId[] confirms)
          Do an update - one single cycle of request with sigs.
 void update(AccountId accountId, ItemId item)
          Get and sign for the mail from the issuer for this account.
 void update(AccountInfo accountinfo, ItemId item)
          Get and sign for the mail from the issuer for this account.
protected  void update(Account account, ItemId item)
          Get and sign for the mail from the issuer for this account.
 
Methods inherited from class webfunds.utils.Debug
debug, debug, debug, debug, err, getDebug, logend, logmsg, logstart, logword
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

context

protected WalletContext context
Our interface to the outside world.

accountStore

protected AccountStore accountStore

soxes

protected SOXServerStore soxes

receiptStore

protected ReceiptsStore receiptStore

store

protected Store store

contracts

protected ContractStore contracts

confirmmails

protected java.util.Vector confirmmails

properties

protected java.util.Properties properties

name

protected static final java.lang.String name

shortname

protected java.lang.String shortname

fix

protected static final java.lang.String fix

try_again_later

protected static final java.lang.String try_again_later

no_net

protected static final java.lang.String no_net

soxFrames

public static final java.lang.String[] soxFrames
As a Wallet, I can add additional plugins.

closeErrorReason

protected java.lang.String closeErrorReason

SOX_MESSAGE

public static final java.lang.String SOX_MESSAGE
Constructor Detail

SOXWallet

public SOXWallet()

SOXWallet

public SOXWallet(java.io.PrintWriter bug)

SOXWallet

public SOXWallet(java.io.PrintWriter bug,
                 java.lang.String f)
Method Detail

error

public void error(java.lang.String e)

aviso

public void aviso(java.lang.String e)

ask

public boolean ask(java.lang.String q)
Ask a question of the user, return true if yes

isTestMode

public boolean isTestMode()
Ask a question of the user, return true if yes

setWalletContext

public void setWalletContext(WalletContext aContext)
Set the WalletContext. This is our only access to the outside world. For example, we get Stores and Contracts from it. XXX: Context should be set in the ctor. YYY: Construction is complicated by class loader, hence separate init?
Specified by:
setWalletContext in interface WalletInterface

addPlugins

protected void addPlugins(java.lang.String[] frames)

setShortName

public void setShortName(java.lang.String name)
Shortname is used for the stores. Can be set by child.

getShortName

public java.lang.String getShortName()
Description copied from interface: WalletInterface
Get a name for this wallet. Only used for debugging currently.
Specified by:
getShortName in interface WalletInterface

getProtocol

public java.lang.String getProtocol()
Description copied from interface: WalletInterface
Get the protocol name. Only used for debugging currently.
Specified by:
getProtocol in interface WalletInterface

getVersion

public java.lang.String getVersion()
Description copied from interface: WalletInterface
Get the version number of the protocol. This is a high level wallet version number, not effecting protocol compatibility. Only used for debugging currently.
Specified by:
getVersion in interface WalletInterface

getWalletHelp

public java.lang.String getWalletHelp()
Description copied from interface: WalletInterface
Provide a help string for each of the different levels.
Specified by:
getWalletHelp in interface WalletInterface

getAccountHelp

public java.lang.String getAccountHelp()
Specified by:
getAccountHelp in interface WalletInterface

getContractHelp

public java.lang.String getContractHelp()
Specified by:
getContractHelp in interface WalletInterface

setStore

public void setStore(Store store)
              throws StoreException
Set the Store. This is the only access we have to persistant storage. Unfortunately, it's quite limiting.

isClosed

public boolean isClosed()

closeCode

public int closeCode()

closeReason

public java.lang.String closeReason()

adminEvent

public int adminEvent(int code,
                      java.lang.String reason)
Shutdown signal or similar. Client Wallet Interface
Specified by:
adminEvent in interface WalletInterface
Tags copied from interface: WalletInterface
Parameters:
code - a number that might indicate urgency or reason
reason - a printable or loggable string that might indicate reason
Returns:
0 if wallet believes it has successfully shutdown, else some number indicating something...

getValue

public long getValue(AccountInfo info,
                     ItemId contract,
                     boolean pending)
Client Wallet Interface
Specified by:
getValue in interface WalletInterface
Tags copied from interface: WalletInterface
Parameters:
pending - if true, the value of pending payments, else confirmed
Returns:
the total value if countable, else Long.MIN_VALUE on error

getValue

public long getValue(AccountId acct,
                     ItemId contract,
                     boolean pending)

getAccountOrDie

public Account getAccountOrDie(AccountId id)
Call this one if you know the account is there, and you don't want to handle the exception.

getAccountOrDie

public Account getAccountOrDie(AccountInfo info)
Call this one if you know the account is there, and you don't want to handle the exception.

getAccount

public Account getAccount(AccountId id)
                   throws StoreException

getAccount

public Account getAccount(AccountInfo info)
                   throws StoreException

getAccountId

public AccountId getAccountId(AccountInfo info)

getAccounts

public AccountInfo[] getAccounts()
Description copied from interface: WalletInterface
Get all accounts known to this wallet.
Specified by:
getAccounts in interface WalletInterface

getAccounts2

public Account[] getAccounts2()

getContracts

public ItemId[] getContracts(AccountInfo account)
Description copied from interface: WalletInterface
Get all contracts that are in this account
Specified by:
getContracts in interface WalletInterface

makePayment

public byte[] makePayment(ItemId contractid,
                          AccountInfo source,
                          AccountInfo targetinfo,
                          long amount,
                          byte[] desc,
                          java.util.Date from,
                          java.util.Date till)
Make an ASCII-armoured payment, a la PGP armouring. Also updates the addressbook. Should targetinfo be an AccountInfo? We don't really know of it. Client Wallet Interface
Specified by:
makePayment in interface WalletInterface

makePurePayment

public Payment makePurePayment(AccountInfo source,
                               AccountInfo target,
                               ItemId instrument,
                               long amount,
                               byte[] description,
                               long validFrom,
                               long validTill,
                               java.lang.String paymentId)
Conversion between high level and low level.

makePurePayment

public Payment makePurePayment(AccountId src,
                               AccountId tgt,
                               ItemId contractid,
                               long amount,
                               byte[] desc,
                               long from,
                               long till,
                               java.lang.String pid)
Make a payment. This should be used by all full service clients, it does: * access to subaccounts, * checks balances, and * saves the pending payment for later reconciliation. and delivers the pure payment back. As a principle, we deal in Units of Contract (underlying units) and not Units of Account (displayed units).
Parameters:
tgt - the target account, may be bearer
src - the source account where funds are written from
contractid - is the name of the contract
amount - the (contract) qty of items of which the payment is for
desc - a description of what this payment is for (optional)
boolean - whether or not the payment is a rollover payment
from - the time from which the payment is valid
till - the time at which the payment will expire
pid - a payment identifier, ignored if empty

makeSafePayment

public Payment makeSafePayment(AccountId src,
                               AccountId tgt,
                               ItemId contractid,
                               long amount,
                               byte[] desc,
                               long from,
                               long till,
                               java.lang.String pid)
                        throws PaymentException
Make a payment. This should be used by all automatic clients, it does: * access to subaccounts, * checks balances, and * saves the pending payment for later reconciliation. and delivers the payment back. It is thread safe.
Parameters:
tgt - the target account, may be bearer
src - the source account where funds are written from
contractid - is the name of the contract
amount - the (contract) qty of items of which the payment is for
desc - a description of what this payment is for (optional)
boolean - whether or not the payment is a rollover payment
from - the time from which the payment is valid
till - the time at which the payment will expire
pid - a payment identifier, ignored if empty

savePaymentAsPending

protected void savePaymentAsPending(AccountId src,
                                    AbstractPayment pay)
                             throws PaymentException
Save a payment made as Pending.
Parameters:
pay - the Payment written out but not as yet saved

makeRollover

public Payment makeRollover(AccountId src,
                            AccountId tgt,
                            ItemId contractid,
                            byte[] desc,
                            long till)
                     throws PaymentException
Make a Rollover payment. This should be used by low level clients. It checks: * access to subaccounts, * saves the pending payment for later reconciliation. and delivers the payment back. It does not check balances (by definition). It is thread safe. Why?
Parameters:
tgt - the target account, should not be bearer, where funds go
src - the source account (to be frozen) where funds are
contractid - is the name of the contract, but this is only used to identify the issuer, all contracts at that issuer effected
desc - a description of what this payment is for (optional)
boolean - whether or not the payment is a rollover payment
from - the time from which the payment is valid
till - the time at which the payment will expire

makeTokenPayment

public TokenPayment makeTokenPayment(AccountId src,
                                     AccountId tgt,
                                     ItemId contractid,
                                     long amount,
                                     byte[] desc,
                                     long from,
                                     long till,
                                     int type)
                              throws PaymentException
Make a Token payment. This should be used by all automatic clients, it does: * access to subaccounts, * checks balances, and * saves the pending payment for later reconciliation. and delivers the payment back. It is thread safe.
Parameters:
tgt - the target account, may be bearer
src - the source account where funds are written from
contractid - is the name of the contract
amount - the (contract) qty of items of which the payment is for
desc - a description of what this payment is for (optional)
boolean - whether or not the payment is a rollover payment
from - the time from which the payment is valid
till - the time at which the payment will expire
type - the type of token method from PaymentFactory

asciiArmour

public byte[] asciiArmour(AbstractPayment pay)
                   throws PaymentException
Make an ASCII-armoured message from a payment, a la PGP armouring. Filters out exceptions. Low level wallet.

asciiArmourWithError

public byte[] asciiArmourWithError(AbstractPayment pay)
Make an ASCII-armoured message from a payment, a la PGP armouring. High level wallet.

decodeSOXPayment

public AbstractPayment decodeSOXPayment(byte[] data)
Decoder of SOX armoured messages.
Returns:
a good payment or null NOT USED?

makeDeposit

public void makeDeposit(byte[] payBuf,
                        AccountInfo callerAc,
                        byte[] desc)
Do a deposit. High level wallet.
Specified by:
makeDeposit in interface WalletInterface
Tags copied from interface: WalletInterface
Parameters:
payment - is the byte array holding the raw payment
desc - a text description
target - account to deposit to (may already be directed)

doDeposit

public Receipt doDeposit(AbstractPayment pay,
                         AccountId account,
                         byte[] desc,
                         java.lang.String idempotentId)
                  throws DepositException
Deposit the given payment. Method for sophisticated Wallet users (Teller, etc) should not use GUI.
Parameters:
pay - for deposit
account - is the account to use
desc - description
idempotentId - is suggested id for deposit, ignored if null/empty

checkReceipt

public java.lang.String checkReceipt(MailItem mail,
                                     AccountId p_src,
                                     AccountId p_tgt,
                                     ItemId p_item,
                                     long amount)
Check the receipt conforms to what was expected.
Returns:
an error string if not conformant, else null

checkReceipt

public java.lang.String checkReceipt(Receipt receipt,
                                     AccountId p_src,
                                     AccountId p_tgt,
                                     ItemId p_item,
                                     long p_qty)
Check the receipt conforms to what was expected.
Returns:
an error string if not conformant, else null

cancel

public void cancel(Transaction[] trans)
Cancel many Transactions. Provides a chance to batch up the transactions. All details should be the same except Tid. Used, but currently not exploited. Need a similar interface into SOX, and SOX needs to batch these up similarly. Tricky. Client Wallet Interface
Specified by:
cancel in interface WalletInterface

cancel

public void cancel(Transaction trans)
Cancel a Transaction. Client Wallet Interface
Specified by:
cancel in interface WalletInterface

cancel

public void cancel(AccountId account,
                   ItemId item,
                   java.lang.String pid)
            throws CancelException,
                   SOXLaterException
Cancel a Payment (pid) within a SubAccount. And call the update. For high-level user programs.

cancel

protected void cancel(ValueAccount sub,
                      java.lang.String pid)
Cancel a Payment (pid) within a SubAccount. And call the update. This can be used by other wallets. If an error occurs, an error box is popped up.

getTransactionState

public StateReceipt getTransactionState(AccountId acct,
                                        ItemId item,
                                        java.lang.String id)
Low level wallet method to return the state for a transaction.
Returns:
a StateReceipt, or null if the pid is not found

internalCancel

protected void internalCancel(ValueAccount sub,
                              java.lang.String[] pids)
                       throws CancelException,
                              SOXLaterException
Cancel Payments (by pids) within a SubAccount before they hit the server.

internalCancel

protected void internalCancel(ValueAccount sub,
                              java.lang.String pid)
                       throws CancelException,
                              SOXLaterException
Cancel a Payment (pid) within a SubAccount.
Returns:
an error string if errors detected, else empty (never null)

quietCancel

protected void quietCancel(ValueAccount sub,
                           java.lang.String[] pids)
Cancel many Payments (pid) within a SubAccount. Not yet used, more here as a placeholder.
Returns:
an error string if errors detected, else empty (never null)

quietCancel

protected MailItem[] quietCancel(ValueAccount sub,
                                 java.lang.String pid)
                          throws SOXLaterException,
                                 CancelException
Cancel a Payment (pid) within a SubAccount. This can be used by other wallets, but be careful to complete the update and store by calling internalUpdate(SubAccount, MailItem[])
Returns:
Mails received, first of which is the applicable one

createAccount

public AccountId createAccount(java.lang.String name)
                        throws WalletException
Create a new account in the Wallet and return it's AccountId. This method either returns a valid AccountId or throws an exception, it never returns null. Argument 'name' may be null.

addAccount

public AccountInfo addAccount()
Client Wallet Interface
Specified by:
addAccount in interface WalletInterface

renameAccount

public boolean renameAccount(AccountInfo accountinfo,
                             java.lang.String name)
Rename the account. The Client also has its own DB for this, the address book. It's being polite by telling us, so we can keep it all consistent. Client Wallet Interface
Specified by:
renameAccount in interface WalletInterface
Tags copied from interface: WalletInterface
Returns:
true if succeeded

removeAccount

public boolean removeAccount(AccountInfo accountinfo)
Client Wallet Interface
Specified by:
removeAccount in interface WalletInterface
Tags copied from interface: WalletInterface
Returns:
true if succeeded

removeContract

public boolean removeContract(AccountInfo accountinfo,
                              ItemId item)
Client Wallet Interface
Specified by:
removeContract in interface WalletInterface
Tags copied from interface: WalletInterface
Returns:
true if succeeded

addContract

public ItemId addContract(AccountInfo info,
                          ItemId item)
Adds the contract to the Account. Client Wallet Interface
Specified by:
addContract in interface WalletInterface
Returns:
the itemId of the contract (even when already added), or null on failure

update

public void update(AccountInfo accountinfo,
                   ItemId item)
Get and sign for the mail from the issuer for this account. Will drag in all items that are handled by this account at this issuer - part of the account request structure.
Specified by:
update in interface WalletInterface
Parameters:
accountinfo - is the application-level account descriptor Client Wallet Interface

update

public void update(AccountId accountId,
                   ItemId item)
Get and sign for the mail from the issuer for this account. Will drag in all items that are handled by this account at this issuer - part of the account request structure.

update

protected void update(Account account,
                      ItemId item)
Get and sign for the mail from the issuer for this account. Will drag in all items that are handled by this account at this issuer - part of the account request structure.

getAccountInfo

protected AccountInfo getAccountInfo(SubAccount sub)
Make an AccountInfo for this sub account. Gets the account, then the id. The address bits are unset.

getAccountId

protected AccountId getAccountId(SubAccount sub)
Make an AccountId for this sub account. Gets the account, then the id. The address bits are unset.

internalUpdate

protected void internalUpdate(SubAccount sub,
                              MailItem[] mails)
Handle this mail that came via another request or another subaccount. The subaccount must identify the account and the SOXServer. All mail items must come from the same SOXServer, (but are not necessarily the same subaccount, etc). This points to a flaw in the sox object model.

internalUpdate

protected void internalUpdate(SubAccount sub,
                              MailItem mail)

manyUpdates

protected void manyUpdates(SubAccount sub,
                           MailItem[] mails)
Get and sign for the mail from the issuer for this account.

tryUpdate

protected MailItem[] tryUpdate(SubAccount sub,
                               MailId[] confirms)
Do an update - one single cycle of request with sigs. Bummer. There is a problem here. Mail is requested at the Account/Issuer level. Which means that some of the mail here is in fact for other subs. So, the the sub is simply passed here as an active sub from which we can do the request to the Issuer, the item of the sub forms no part of the data.

tryHandle

protected MailId[] tryHandle(SubAccount sub,
                             MailItem[] mails)
Do an update - one single cycle of request with sigs.

handleMail

public boolean handleMail(MailItem mail,
                          SubAccount sub)
Switchboard for various mail types. Currently, we only handle Receipts here. To handle other types, override this method.
Returns:
true if it is saved *and* can now be confirmed. should really be ternary: {don't know, failed to save, ok} so we can extend, and call super() on this method. throw a save-fail exception?

handleReceiptData

public boolean handleReceiptData(byte[] recdata,
                                 AccountId acct)
For some reason, Receipts are stored on an account basis.

handleReceipt

public boolean handleReceipt(Receipt rec,
                             AccountId acct)

confirm

public void confirm(java.util.Vector v,
                    byte[] b)

confirm

public void confirm(java.util.Vector v,
                    MailItem mi)

getTransactions

public Transaction[] getTransactions(AccountInfo info,
                                     ItemId contract)
Transaction is the external Wallet definition of a transaction. Internally to this wallet, we have Receipts and PendingReceipts. Latter needs to be collected and converted into Transactions. Client Wallet Interface
Specified by:
getTransactions in interface WalletInterface
Returns:
a list of Transactions within this subaccount

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object