|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.sox.Request
|
+--webfunds.sox.DepositRequest
This class represents a deposit request, used by a SOX client to deposit a payment into an account. DepositRequest are usually created from a Payment object and a description string, and then signed.
| Field Summary | |
static int |
DEPOSIT_LOCAL_VERS
The version of the encoded deposit request. |
static int |
DEPOSIT_not_used_yet
The version of the encoded deposit request. |
static int |
DEPOSIT_ORIGINAL
The version of the encoded deposit request. |
static int |
DEPOSIT_WITHDRAW
The version of the encoded deposit request. |
protected byte[] |
depositDesc
A description (can be anything, although very long lengths may be refused by some issuers and clients) of what the payment is for. |
protected java.lang.String |
depositId
An identifier for this deposit request Note: although a java String is used, this identifier should only contain 8-bit ascii characters, following the same rules as that of the payment id (pid). |
static java.lang.String |
name
|
protected byte[] |
payBuf
|
protected AbstractPayment |
payment
The payment to be deposited (as originally created by the payer) (was Payment). |
protected AbstractPayment |
proto
The payment to be withdrawn, paid for with above payment (as originally created by the payer, added at DEPOSIT_WITHDRAW-bis). |
protected byte[] |
protoBuf
|
protected int |
protocolState
The state of the protocol that the caller wants to (re)start this request processing in. |
protected int |
typeOfPayment
The type of payment that the caller wants to withdraw, where the type is a number from PaymentFactory. |
protected int |
version
|
| Fields inherited from class webfunds.sox.Request |
account,
REQ_not_used_yet,
REQ_ORIGINAL,
REQ_SUBS_ADD_V,
req_version,
REQ_VERSION,
requestId,
sig,
timestamp |
| Constructor Summary | |
DepositRequest(byte[] depositReqData)
Construct a deposit request object from a byte array that was previously returned from the encode() method of a deposit request object. |
|
DepositRequest(java.io.InputStream is)
Construct a deposit request object from data on an input stream that was previously returned from the encode() method of a deposit request object. |
|
DepositRequest(java.lang.String requestId,
AccountId acc,
AbstractPayment payment,
AbstractPayment proto,
java.lang.String depositId,
byte[] desc)
Create an unsigned withdrawal request, to get a token payment signed. |
|
DepositRequest(java.lang.String requestId,
AccountId acc,
AbstractPayment payment,
java.lang.String depositId,
byte[] desc)
Create an unsigned deposit request This constructor is the one usually called by SOX clients. |
|
| Method Summary | |
protected static void |
cycle()
|
void |
decode(java.io.InputStream is)
Recover this deposit request object with the values from a deposit request on the input stream (such as might be sent by the encode() method of a deposit request object). |
void |
encode(java.io.OutputStream os)
Encode a deposit request to an output stream, suitable for using with RequestPacket to send to remote servers (which use the decode() method to re-construct the object). |
boolean |
equals(java.lang.Object object)
|
Reply |
errorReply(int e)
Get a Reply with Errors set. |
static DepositRequest |
example()
|
byte[] |
getDepositDesc()
Get the description for this deposit request |
java.lang.String |
getDepositId()
Get the identifier on this deposit request Note: although a java String is used, this identifier should only contain 8-bit ascii characters. |
ItemId |
getItem()
Get the type of item (or "currency") on the payment (this is [almost certainly] the message digest of a ricardian contract). |
java.lang.String |
getName()
Returns the name of the packet as it goes on the wire. |
AbstractPayment |
getPay()
|
Payment |
getPayment()
Get the payment to be deposited. |
byte[] |
getPaymentDesc()
Get the description on the payment |
java.lang.String |
getPaymentId()
Get the identifier on the payment, as originally created by the payer. |
AbstractPayment |
getProto()
Get the proto payment to be signed, if a withdrawal. |
int |
getProtocolState()
|
long |
getQty()
Get the quantity of the item on the payment |
AccountId |
getSource()
Get the account to which the payment is made. |
AccountId |
getTarget()
Get the account from which the transaction was drawn. |
int |
getTypeOfPayment()
|
int |
getVersion()
|
DepositReply |
goodReply(MailItem mail)
|
protected static void |
input()
|
static void |
main(java.lang.String[] args)
|
protected static void |
output()
|
protected static void |
readWrite()
|
void |
setProtocolState(int state)
|
void |
setTypeOfPayment(int type)
|
void |
setVersion(int v)
|
java.lang.String |
toAscii()
|
java.lang.String |
toString()
Convert this object to a human readable string |
java.lang.String |
vString()
|
| Methods inherited from class webfunds.sox.Request |
getAccountId,
getRequestId,
getRequestVersion,
getTimestamp,
isSigned,
reconstructReply,
setRequestVersion,
setSignature,
verify |
| 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 DEPOSIT_ORIGINAL
public static final int DEPOSIT_LOCAL_VERS
public static final int DEPOSIT_WITHDRAW
public static final int DEPOSIT_not_used_yet
protected int version
public static final java.lang.String name
protected AbstractPayment payment
protected byte[] payBuf
protected AbstractPayment proto
protected byte[] protoBuf
protected java.lang.String depositId
protected byte[] depositDesc
protected int typeOfPayment
protected int protocolState
| Constructor Detail |
public DepositRequest(java.lang.String requestId,
AccountId acc,
AbstractPayment payment,
java.lang.String depositId,
byte[] desc)
requestId - the request identifier (must be unique)acc - the despositor's accountpayment - the payment to be depositeddepositId - the deposit request identifier (must be unique)desc - depositor's description of what this transaction is for
public DepositRequest(java.lang.String requestId,
AccountId acc,
AbstractPayment payment,
AbstractPayment proto,
java.lang.String depositId,
byte[] desc)
requestId - the request identifier (must be unique)acc - the despositor's accountpayment - the payment to be deposited, pays for protoproto - the payment to be withdrawn, paid for by paymentdepositId - the deposit request identifier (must be unique)desc - depositor's description of what this transaction is for
public DepositRequest(byte[] depositReqData)
throws SOXPacketException
depositReqData - the previously encoded request
public DepositRequest(java.io.InputStream is)
throws SOXPacketException
| Method Detail |
public int getVersion()
public void setVersion(int v)
public java.lang.String getName()
public Payment getPayment()
public AbstractPayment getPay()
public AbstractPayment getProto()
public java.lang.String getPaymentId()
public AccountId getTarget()
public AccountId getSource()
public ItemId getItem()
public long getQty()
public byte[] getPaymentDesc()
public java.lang.String getDepositId()
public byte[] getDepositDesc()
public int getTypeOfPayment()
public void setTypeOfPayment(int type)
public int getProtocolState()
public void setProtocolState(int state)
public Reply errorReply(int e)
err - is the error number to set the reply topublic DepositReply goodReply(MailItem mail)
public void encode(java.io.OutputStream os)
throws java.io.IOException
os - the stream on which to send the output
public void decode(java.io.InputStream is)
throws java.io.IOException,
SOXPacketException
is - the stream containing the encoded deposit request
public java.lang.String toAscii()
throws java.io.IOException
public boolean equals(java.lang.Object object)
public java.lang.String toString()
public java.lang.String vString()
public static DepositRequest 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 | ||||||||