|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.superhac.JXBStreamer.Core.XBMSPEncoderDecoder
public class XBMSPEncoderDecoder
This handles all the XMBSP packet Decoding and Encoding. This is used by the XBMSPServerMessageHandler's to decode and code messages.
The protocol is documented here.
More information can be found at Superhac.com
Constructor Summary | |
---|---|
protected |
XBMSPEncoderDecoder()
|
Method Summary | |
---|---|
protected void |
decodepacket(java.nio.ByteBuffer buff)
Takes the socket buffer thats passed in and decodes the message. |
protected XBMSPEncoderDecoder |
encodePacketError(byte errorCode,
java.lang.String errorMessage)
Encodes a packet ERROR response to this instance of XBMSPEncoderDecoder. |
protected XBMSPEncoderDecoder |
encodePacketFileContents(java.nio.ByteBuffer data)
Encodes a packet encodePacketFileContents response to this instance of XBMSPEncoderDecoder. |
protected XBMSPEncoderDecoder |
encodePacketFileData(java.lang.String name,
java.lang.String data)
Encodes a packet PacketFileData response to this instance of XBMSPEncoderDecoder. |
protected XBMSPEncoderDecoder |
encodePacketHandle(int handle)
Encodes a packet PacketHandle response to this instance of XBMSPEncoderDecoder. |
protected XBMSPEncoderDecoder |
encodePacketOk()
Encodes a packet OK response to this instance of XBMSPEncoderDecoder. |
protected java.nio.ByteBuffer |
getPacket()
Call this after the message is ready to be transmitted. |
protected byte |
getPayloadByte()
Gets the first byte from the payload.. |
protected byte[] |
getPayloadData()
Gets the first byte[] from the payload.. |
protected int |
getPayloadInt()
Gets the first Int from the payload.. |
protected int |
getPayloadInt2()
Gets the second Int from the payload.. |
protected long |
getPayloadInt64()
Gets the first long(INT64) from the payload.. |
protected java.lang.String |
getPayloadString()
Gets the first String from the payload.. |
protected java.lang.String |
getPayloadString2()
Gets the Second String from the payload.. |
protected byte |
getType()
Returns the packet type (type field) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String SERVER_VERSION
protected static final byte XBMSP_PACKET_NULL
protected static final byte XBMSP_PACKET_SETCWD
protected static final byte XBMSP_PACKET_FILELIST_OPEN
protected static final byte XBMSP_PACKET_FILELIST_READ
protected static final byte XBMSP_PACKET_FILE_INFO
protected static final byte XBMSP_PACKET_FILE_OPEN
protected static final byte XBMSP_PACKET_FILE_READ
protected static final byte XBMSP_PACKET_FILE_SEEK
protected static final byte XBMSP_PACKET_CLOSE
protected static final byte XBMSP_PACKET_CLOSE_ALL
protected static final byte XBMSP_PACKET_SET_CONFIGURATION_OPTION
protected static final byte XBMSP_PACKET_AUTHENTICATION_INIT
protected static final byte XBMSP_PACKET_AUTHENTICATE
protected static final byte XBMSP_PACKET_UPCWD
protected static final byte XBMSP_PACKET_OK
protected static final byte XBMSP_PACKET_ERROR
protected static final byte XBMSP_PACKET_HANDLE
protected static final byte XBMSP_PACKET_FILE_DATA
protected static final byte XBMSP_PACKET_FILE_CONTENTS
protected static final byte XBMSP_PACKET_AUTHENTICATION_CONTINUE
protected static final byte XBMSP_PACKET_SERVER_DISCOVERY_QUERY
protected static final byte XBMSP_PACKET_SERVER_DISCOVERY_REPLY
protected static final byte XBMSP_ERROR_OK
protected static final byte XBMSP_ERROR_FAILURE
protected static final byte XBMSP_ERROR_UNSUPPORTED
protected static final byte XBMSP_ERROR_NO_SUCH_FILE
protected static final byte XBMSP_ERROR_INVALID_FILE
protected static final byte XBMSP_ERROR_INVALID_HANDLE
protected static final byte XBMSP_ERROR_OPEN_FAILED
protected static final byte XBMSP_ERROR_TOO_MANY_OPEN_FILES
protected static final byte XBMSP_ERROR_TOO_LONG_READ
protected static final byte XBMSP_ERROR_ILLEGAL_SEEK
protected static final byte XBMSP_ERROR_OPTION_IS_READ_ONLY
protected static final byte XBMSP_ERROR_INVALID_OPTION_VALUE
protected static final byte XBMSP_ERROR_AUTHENTICATION_NEEDED
protected static final byte XBMSP_ERROR_AUTHENTICATION_FAILED
protected static final byte XBMSP_FILE_SEEK_TYPE_FWDFROMBEG
protected static final byte XBMSP_FILE_SEEK_TYPE_BCKFROMEND
protected static final byte XBMSP_FILE_SEEK_TYPE_FWDFROMCUR
protected static final byte XBMSP_FILE_SEEK_TYPE_BCKFROMCUR
Constructor Detail |
---|
protected XBMSPEncoderDecoder()
Method Detail |
---|
protected java.nio.ByteBuffer getPacket()
protected byte getType()
protected void decodepacket(java.nio.ByteBuffer buff)
buff
- the Buffer from the socket.protected XBMSPEncoderDecoder encodePacketOk()
protected XBMSPEncoderDecoder encodePacketError(byte errorCode, java.lang.String errorMessage)
errorCode
- the error code as defined by the XBMSP protocol.errorMessage
- an optional TEXT message
protected XBMSPEncoderDecoder encodePacketHandle(int handle)
handle
- the handle number of the file or directory
protected XBMSPEncoderDecoder encodePacketFileData(java.lang.String name, java.lang.String data)
name
- The name of the file or handle(file.getName())data
- The XML encoded String with the file data. (e.g. file size,
accessTime, etc..)
protected XBMSPEncoderDecoder encodePacketFileContents(java.nio.ByteBuffer data)
data
- the raw file data for the request
protected byte getPayloadByte()
protected byte[] getPayloadData()
protected int getPayloadInt()
protected int getPayloadInt2()
protected long getPayloadInt64()
protected java.lang.String getPayloadString()
protected java.lang.String getPayloadString2()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |