webfunds.sox
Class MailRequest
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.sox.Request
|
+--webfunds.sox.MailRequest
- public class MailRequest
- extends Request
- See Also:
- Serialized Form
|
Field Summary |
static java.lang.String |
name
|
protected int |
version
|
static int |
VERSION
The version of the encoded mail request. |
|
Method Summary |
protected static void |
cycle()
|
void |
decode(java.io.InputStream is)
Update this request object with the values from
a request encoded as a byte array (such as previously
returned from the encode() method of a 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). |
Reply |
errorReply(int e)
Get a Reply that matches this Request. |
static MailRequest |
example()
|
MailId[] |
getMailIds()
|
java.lang.String |
getName()
Returns the name of the packet as it goes on the wire. |
MailReply |
goodReply(MailItem[] newMailItems)
|
protected static void |
input()
|
static void |
main(java.lang.String[] args)
|
protected static void |
output()
|
protected static void |
readWrite()
|
java.lang.String |
toString()
Convert this object to a human readable string |
| Methods inherited from class webfunds.sox.Request |
equals,
getAccountId,
getRequestId,
getRequestVersion,
getTimestamp,
getVersion,
isSigned,
reconstructReply,
setRequestVersion,
setSignature,
verify |
| Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
VERSION
public static final int VERSION
- The version of the encoded mail request.
Originally, in Request.VERSION == 2, there were no local versions.
We'll call that VERS == 1.
version
protected int version
name
public static final java.lang.String name
MailRequest
public MailRequest(java.lang.String requestId,
AccountId acc,
MailId[] mails)
MailRequest
public MailRequest(byte[] data)
throws SOXPacketException
MailRequest
public MailRequest(java.io.InputStream is)
throws SOXPacketException
getName
public java.lang.String getName()
- Description copied from class: Request
- Returns the name of the packet as it goes on the wire.
- Overrides:
- getName in class Request
errorReply
public Reply errorReply(int e)
- Get a Reply that matches this Request.
This one is extended from Reply.
- Overrides:
- errorReply in class Request
- Tags copied from class: Request
- Parameters:
err - is the error number to set the reply to
goodReply
public MailReply goodReply(MailItem[] newMailItems)
getMailIds
public MailId[] getMailIds()
encode
public void encode(java.io.OutputStream os)
throws java.io.IOException
- Description copied from class: Request
- 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).
If the signature is not present, an unsigned
request will be encoded.
(That is, it is sign()'s responsibility to set
the sig to null in order to sign.)
- Overrides:
- encode in class Request
- Tags copied from class: Request
- Parameters:
os - the stream on which to send the output- Returns:
- byte[] the request in encoded form
decode
public void decode(java.io.InputStream is)
throws java.io.IOException,
SOXPacketException
- Description copied from class: Request
- Update this request object with the values from
a request encoded as a byte array (such as previously
returned from the encode() method of a request object).
If the signature is not present in the encoded data, the
current signature (if any) will be removed.
This method is usually used by subclasses to decode
the request/timestamp/sig fields.
- Overrides:
- decode in class Request
- Tags copied from class: Request
- Parameters:
is - the stream from which to read the request
toString
public java.lang.String toString()
- Description copied from class: Request
- Convert this object to a human readable string
- Overrides:
- toString in class Request
example
public static MailRequest example()
main
public static void main(java.lang.String[] args)
cycle
protected static void cycle()
throws java.lang.Exception
output
protected static void output()
throws java.lang.Exception
readWrite
protected static void readWrite()
throws java.lang.Exception
input
protected static void input()
throws java.lang.Exception