|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--webfunds.utils.Debug
|
+--webfunds.client.sox.SOXWallet
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 |
protected WalletContext context
protected AccountStore accountStore
protected SOXServerStore soxes
protected ReceiptsStore receiptStore
protected Store store
protected ContractStore contracts
protected java.util.Vector confirmmails
protected java.util.Properties properties
protected static final java.lang.String name
protected java.lang.String shortname
protected static final java.lang.String fix
protected static final java.lang.String try_again_later
protected static final java.lang.String no_net
public static final java.lang.String[] soxFrames
protected java.lang.String closeErrorReason
public static final java.lang.String SOX_MESSAGE
| Constructor Detail |
public SOXWallet()
public SOXWallet(java.io.PrintWriter bug)
public SOXWallet(java.io.PrintWriter bug,
java.lang.String f)
| Method Detail |
public void error(java.lang.String e)
public void aviso(java.lang.String e)
public boolean ask(java.lang.String q)
public boolean isTestMode()
public void setWalletContext(WalletContext aContext)
protected void addPlugins(java.lang.String[] frames)
public void setShortName(java.lang.String name)
public java.lang.String getShortName()
public java.lang.String getProtocol()
public java.lang.String getVersion()
public java.lang.String getWalletHelp()
public java.lang.String getAccountHelp()
public java.lang.String getContractHelp()
public void setStore(Store store)
throws StoreException
public boolean isClosed()
public int closeCode()
public java.lang.String closeReason()
public int adminEvent(int code,
java.lang.String reason)
code - a number that might indicate urgency or reasonreason - a printable or loggable string that might indicate reason
public long getValue(AccountInfo info,
ItemId contract,
boolean pending)
pending - if true, the value of pending payments, else confirmed
public long getValue(AccountId acct,
ItemId contract,
boolean pending)
public Account getAccountOrDie(AccountId id)
public Account getAccountOrDie(AccountInfo info)
public Account getAccount(AccountId id)
throws StoreException
public Account getAccount(AccountInfo info)
throws StoreException
public AccountId getAccountId(AccountInfo info)
public AccountInfo[] getAccounts()
public Account[] getAccounts2()
public ItemId[] getContracts(AccountInfo account)
public byte[] makePayment(ItemId contractid,
AccountInfo source,
AccountInfo targetinfo,
long amount,
byte[] desc,
java.util.Date from,
java.util.Date till)
public Payment makePurePayment(AccountInfo source,
AccountInfo target,
ItemId instrument,
long amount,
byte[] description,
long validFrom,
long validTill,
java.lang.String paymentId)
public Payment makePurePayment(AccountId src,
AccountId tgt,
ItemId contractid,
long amount,
byte[] desc,
long from,
long till,
java.lang.String pid)
tgt - the target account, may be bearersrc - the source account where funds are written fromcontractid - is the name of the contractamount - the (contract) qty of items of which the payment is fordesc - a description of what this payment is for (optional)boolean - whether or not the payment is a rollover paymentfrom - the time from which the payment is validtill - the time at which the payment will expirepid - a payment identifier, ignored if empty
public Payment makeSafePayment(AccountId src,
AccountId tgt,
ItemId contractid,
long amount,
byte[] desc,
long from,
long till,
java.lang.String pid)
throws PaymentException
tgt - the target account, may be bearersrc - the source account where funds are written fromcontractid - is the name of the contractamount - the (contract) qty of items of which the payment is fordesc - a description of what this payment is for (optional)boolean - whether or not the payment is a rollover paymentfrom - the time from which the payment is validtill - the time at which the payment will expirepid - a payment identifier, ignored if empty
protected void savePaymentAsPending(AccountId src,
AbstractPayment pay)
throws PaymentException
pay - the Payment written out but not as yet saved
public Payment makeRollover(AccountId src,
AccountId tgt,
ItemId contractid,
byte[] desc,
long till)
throws PaymentException
tgt - the target account, should not be bearer, where funds gosrc - the source account (to be frozen) where funds arecontractid - is the name of the contract, but this is only used
to identify the issuer, all contracts at that issuer effecteddesc - a description of what this payment is for (optional)boolean - whether or not the payment is a rollover paymentfrom - the time from which the payment is validtill - the time at which the payment will expire
public TokenPayment makeTokenPayment(AccountId src,
AccountId tgt,
ItemId contractid,
long amount,
byte[] desc,
long from,
long till,
int type)
throws PaymentException
tgt - the target account, may be bearersrc - the source account where funds are written fromcontractid - is the name of the contractamount - the (contract) qty of items of which the payment is fordesc - a description of what this payment is for (optional)boolean - whether or not the payment is a rollover paymentfrom - the time from which the payment is validtill - the time at which the payment will expiretype - the type of token method from PaymentFactory
public byte[] asciiArmour(AbstractPayment pay)
throws PaymentException
public byte[] asciiArmourWithError(AbstractPayment pay)
public AbstractPayment decodeSOXPayment(byte[] data)
public void makeDeposit(byte[] payBuf,
AccountInfo callerAc,
byte[] desc)
payment - is the byte array holding the raw paymentdesc - a text descriptiontarget - account to deposit to (may already be directed)
public Receipt doDeposit(AbstractPayment pay,
AccountId account,
byte[] desc,
java.lang.String idempotentId)
throws DepositException
pay - for depositaccount - is the account to usedesc - descriptionidempotentId - is suggested id for deposit, ignored if null/empty
public java.lang.String checkReceipt(MailItem mail,
AccountId p_src,
AccountId p_tgt,
ItemId p_item,
long amount)
public java.lang.String checkReceipt(Receipt receipt,
AccountId p_src,
AccountId p_tgt,
ItemId p_item,
long p_qty)
public void cancel(Transaction[] trans)
public void cancel(Transaction trans)
public void cancel(AccountId account,
ItemId item,
java.lang.String pid)
throws CancelException,
SOXLaterException
protected void cancel(ValueAccount sub,
java.lang.String pid)
public StateReceipt getTransactionState(AccountId acct,
ItemId item,
java.lang.String id)
protected void internalCancel(ValueAccount sub,
java.lang.String[] pids)
throws CancelException,
SOXLaterException
protected void internalCancel(ValueAccount sub,
java.lang.String pid)
throws CancelException,
SOXLaterException
protected void quietCancel(ValueAccount sub,
java.lang.String[] pids)
protected MailItem[] quietCancel(ValueAccount sub,
java.lang.String pid)
throws SOXLaterException,
CancelException
public AccountId createAccount(java.lang.String name)
throws WalletException
public AccountInfo addAccount()
public boolean renameAccount(AccountInfo accountinfo,
java.lang.String name)
public boolean removeAccount(AccountInfo accountinfo)
public boolean removeContract(AccountInfo accountinfo,
ItemId item)
public ItemId addContract(AccountInfo info,
ItemId item)
public void update(AccountInfo accountinfo,
ItemId item)
accountinfo - is the application-level account descriptor
Client Wallet Interface
public void update(AccountId accountId,
ItemId item)
protected void update(Account account,
ItemId item)
protected AccountInfo getAccountInfo(SubAccount sub)
protected AccountId getAccountId(SubAccount sub)
protected void internalUpdate(SubAccount sub,
MailItem[] mails)
protected void internalUpdate(SubAccount sub,
MailItem mail)
protected void manyUpdates(SubAccount sub,
MailItem[] mails)
protected MailItem[] tryUpdate(SubAccount sub,
MailId[] confirms)
protected MailId[] tryHandle(SubAccount sub,
MailItem[] mails)
public boolean handleMail(MailItem mail,
SubAccount sub)
public boolean handleReceiptData(byte[] recdata,
AccountId acct)
public boolean handleReceipt(Receipt rec,
AccountId acct)
public void confirm(java.util.Vector v,
byte[] b)
public void confirm(java.util.Vector v,
MailItem mi)
public Transaction[] getTransactions(AccountInfo info,
ItemId contract)
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||