webfunds.sox
Class BasicRequestPacket
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.sox.BasicRequestPacket
- public class BasicRequestPacket
- extends Encodable
This class, BasicRequestPacket, encapsulates BasicRequest
objects, giving them a header etc., so that the payload
can be identified. It is in this form that the requests
are usually transmitted over networks.
- See Also:
- Serialized Form
|
Field Summary |
protected BasicRequest |
body
The request body |
static java.lang.String |
CERT_REQ
The request codes (any non-SOX messages must not use
the SOX prefix, but should instead use the java
namespace convention of using the domains name
(dropping the "com." part if desired),
e.g. |
protected byte[] |
encoded
The body in encoded form |
static java.lang.String |
ENCR_REQ
|
static java.lang.String |
KEY_REQ
|
static java.lang.String |
SERVER_KEY_REQ
|
protected java.lang.String |
type
The request type - this defines what the request is |
static int |
VERSION
|
| Methods inherited from class webfunds.sox.Encodable |
decode,
encode,
main,
readByteArray,
readCertificate,
readProperties,
readString,
writeByteArray,
writeCertificate,
writeProperties,
writeString |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
VERSION
public static final int VERSION
CERT_REQ
public static final java.lang.String CERT_REQ
- The request codes (any non-SOX messages must not use
the SOX prefix, but should instead use the java
namespace convention of using the domains name
(dropping the "com." part if desired),
e.g. "Com.Hotlava.Reset" or "Systemics.Init"
This is to avoid clashes when mixing messages.
KEY_REQ
public static final java.lang.String KEY_REQ
SERVER_KEY_REQ
public static final java.lang.String SERVER_KEY_REQ
ENCR_REQ
public static final java.lang.String ENCR_REQ
type
protected java.lang.String type
- The request type - this defines what the request is
body
protected BasicRequest body
- The request body
encoded
protected transient byte[] encoded
- The body in encoded form
BasicRequestPacket
public BasicRequestPacket(BasicRequest body)
BasicRequestPacket
public BasicRequestPacket(byte[] data)
throws SOXPacketException
body
public BasicRequest body()
- It is possible to have a null body.
encode
public byte[] encode()
- Overrides:
- encode in class Encodable
decode
public void decode(byte[] data)
throws SOXPacketException
- Overrides:
- decode in class Encodable
- Tags copied from class: Encodable
- Throws:
- java.io.IOException - can be thrown if the data is longer than
necessary. In situations where the data should be read from
a larger chunk, it may be more convenient to create a
ByteArrayInputStream from the data and use decode(InputStream).
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object