|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.sox.MailItem
This class holds an item of mail. A Mail item is different from other objects here because it is first and foremost a byte array, not an object. This precedence is imposed due to the need to sign the correct data so the SOX server can remove the mail.
| Field Summary | |
protected byte[] |
buf
The mail packet as it is passed over the net, and signed for. |
protected byte[] |
msg
The mail item consists of a version, a type and a message. |
static int |
RECEIPT
Mail Type numbers. |
protected int |
type
|
int |
version
|
static int |
VERSION
|
| Constructor Summary | |
MailItem()
Empty mail item - will not save, must set the contents. |
|
MailItem(byte[] data)
Recover from byte array and, in this case only, set the byte array. |
|
MailItem(java.io.InputStream is)
|
|
MailItem(int type,
byte[] msg)
|
|
MailItem(int type,
Encodable obj)
|
|
| Method Summary | |
void |
decode(java.io.InputStream is)
Careful of this conversion - as we are coding the mail item into an array, the on-the-wire format is not the same as the passed around internal mail item. |
void |
encode(java.io.OutputStream os)
|
boolean |
equals(java.lang.Object object)
|
static MailItem |
example()
A life-like example for tests. |
byte[] |
getMail()
the full Mail with headers is the signed component |
MailId |
getMailId()
this is the hash of the MailItem that represents the signature |
byte[] |
getMessage()
the Message component is to be recovered according to Type |
int |
getType()
|
int |
hashCode()
|
void |
init(byte[] oldBuf)
|
boolean |
isReceipt()
|
static void |
main(java.lang.String[] args)
|
void |
setMsg(int type,
byte[] b)
|
void |
setMsg(int type,
Encodable obj)
|
java.lang.String |
toString()
|
| 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,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int VERSION
public int version
public static final int RECEIPT
protected byte[] buf
protected byte[] msg
protected int type
| Constructor Detail |
public MailItem()
public MailItem(int type,
Encodable obj)
throws SOXPacketException
public MailItem(int type,
byte[] msg)
throws SOXPacketException
public MailItem(byte[] data)
throws SOXPacketException
public MailItem(java.io.InputStream is)
throws java.io.IOException,
SOXPacketException
| Method Detail |
public boolean isReceipt()
public int hashCode()
public byte[] getMail()
public byte[] getMessage()
public int getType()
public MailId getMailId()
public void setMsg(int type,
byte[] b)
throws SOXPacketException
public void setMsg(int type,
Encodable obj)
throws SOXPacketException
public void init(byte[] oldBuf)
throws SOXPacketException
public void encode(java.io.OutputStream os)
throws java.io.IOException
public void decode(java.io.InputStream is)
throws SOXPacketException
public boolean equals(java.lang.Object object)
public java.lang.String toString()
public static MailItem example()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||