webfunds.sox
Class BasicReplyPacket
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.sox.BasicReplyPacket
- public class BasicReplyPacket
- extends Encodable
This class, BasicReplyPacket, encapsulates BasicReply
objects, giving them a status value, so that if the
request was invalid an error message is sent in place
of a BasicReply object.
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
BASIC_UNKNOWN
public static final int BASIC_UNKNOWN
BASIC_SUCCESS
public static final int BASIC_SUCCESS
BASIC_INVALID_KEY
public static final int BASIC_INVALID_KEY
BASIC_BADLY_FORMATTED
public static final int BASIC_BADLY_FORMATTED
BASIC_UNKNOWN_REQUEST
public static final int BASIC_UNKNOWN_REQUEST
encoded
protected byte[] encoded
- The body in encoded form
status
protected int status
- The status value
errmsg
protected java.lang.String errmsg
BasicReplyPacket
public BasicReplyPacket(BasicReply body)
BasicReplyPacket
public BasicReplyPacket(int status,
java.lang.String msg)
BasicReplyPacket
public BasicReplyPacket(byte[] data)
throws SOXPacketException
body
public byte[] body()
getErrno
public int getErrno()
success
public boolean success()
keyException
public boolean keyException()
getMessage
public java.lang.String getMessage()
encode
public void encode(java.io.OutputStream os)
- 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
equals
public boolean equals(java.lang.Object obj)
- Overrides:
- equals in class java.lang.Object
example
public static BasicReplyPacket example()
main
public static void main(java.lang.String[] args)