|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.sox.AbstractPayment
|
+--webfunds.sox.TokenPayment
This class represents a token payment. A token payment consists of tokens, sometimes called coins, which at this level can be thought of as big unguessable numbers. These are created by collecting the tokens out of a database, or by acquiring them from a mint- enabled Issuer with a WithdrawalRequest. It may be useful for classes to derive from this one, in order to have different functionality. For example, it may be easier to derive from this class for the various blinded methods than to have another class. Or maybe not.
| Field Summary | |
protected AccountId |
source
The account from which the payment was drawn. |
static int |
TOKEN_SUBVERSION
The sub version number for this payment structure (*NOT* the super packet type number). |
static int |
TOKEN_TYPE
The type of payment of this class. |
protected Token[] |
tokens
List of Tokens. |
| Fields inherited from class webfunds.sox.AbstractPayment |
desc,
item,
paymentId,
PF_VERSION,
qty,
SINGLETON_VERSION,
subversion,
type,
version |
| Constructor Summary | |
TokenPayment(byte[] paymentData)
Construct a payment object from a byte array that was previously returned from the encode() method of a payment object. |
|
TokenPayment(java.io.InputStream is)
Construct a payment object an input stream, where the data was previously returned from the encode() method of a payment object. |
|
TokenPayment(java.lang.String pid,
AccountId source,
ItemId item,
Token[] tokens,
byte[] desc)
Create a token payment from an array of tokens. |
|
| Method Summary | |
long |
calculateQuantity()
Count up the total Quantity that the tokens CLAIM to represent. |
protected static void |
cycle()
|
void |
decode(java.io.InputStream is)
Update this payment object with the values from a payment encoded as a byte array (such as previously returned from the encode() method of a payment object). |
void |
encode(java.io.OutputStream os)
Encode a payment as a byte array, suitable for sending to third parties for depositing. |
boolean |
equals(java.lang.Object obj)
|
static TokenPayment |
example()
|
static TokenPayment |
example(Token[] tokens)
|
AccountId |
getSource()
Get the account from which the transaction is drawn |
Token[] |
getTokens()
Get the tokens within the payment |
int |
getType()
The type of payment of this class. |
protected static void |
input()
|
boolean |
isSigned()
Check to see if this payment is signed, always false on a token payment? This may not be the case, the tokens themselves may may be signed. |
static void |
main(java.lang.String[] args)
|
protected static void |
output()
|
protected static void |
readWrite()
|
void |
setId(java.lang.String id)
Set the paymentId, so that you can strip it clean on export. |
void |
setSource(AccountId id)
|
java.lang.String |
toString()
|
| Methods inherited from class webfunds.sox.AbstractPayment |
getDesc,
getId,
getItem,
getQty,
getSubVersion,
getTarget,
getValidFrom,
getValidTill,
getVersion,
isBearer,
vString |
| Methods inherited from class webfunds.sox.Encodable |
decode,
encode,
readByteArray,
readCertificate,
readProperties,
readString,
writeByteArray,
writeCertificate,
writeProperties,
writeString |
| Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int TOKEN_TYPE
public static final int TOKEN_SUBVERSION
protected AccountId source
protected Token[] tokens
| Constructor Detail |
public TokenPayment(java.lang.String pid,
AccountId source,
ItemId item,
Token[] tokens,
byte[] desc)
source - the source account, can be empty / nullitem - the item for which the payment is fordesc - a description of what this payment is for (null ==> empty)tokens - an array of tokens, cannot be null or contain nulls,
may be emptypid - identifier for local storage only
public TokenPayment(byte[] paymentData)
throws SOXPacketException
paymentData - the previosly encoded payment
public TokenPayment(java.io.InputStream is)
throws SOXPacketException
is - the input stream from which to read the payment data| Method Detail |
public int getType()
public AccountId getSource()
public void setSource(AccountId id)
public Token[] getTokens()
public void setId(java.lang.String id)
public long calculateQuantity()
public boolean isSigned()
public void decode(java.io.InputStream is)
throws java.io.IOException,
SOXPacketException
paymentData - the previously encoded payment
public void encode(java.io.OutputStream os)
throws java.io.IOException
public java.lang.String toString()
public boolean equals(java.lang.Object obj)
public static TokenPayment example(Token[] tokens)
public static TokenPayment example()
public static void main(java.lang.String[] args)
protected static void cycle()
throws java.lang.Exception
protected static void output()
throws java.lang.Exception
protected static void readWrite()
throws java.lang.Exception
protected static void input()
throws java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||