1 package com.smartdevicelink.protocol;
\r
3 import com.smartdevicelink.protocol.enums.MessageType;
\r
4 import com.smartdevicelink.protocol.enums.SessionType;
\r
6 public class ProtocolMessage {
\r
7 private byte version = 1;
\r
8 private SessionType _sessionType = SessionType.RPC;
\r
9 private MessageType _messageType = MessageType.UNDEFINED;
\r
10 private byte _sessionID = 0;
\r
11 private byte _rpcType;
\r
12 private int _functionID;
\r
13 private int _correlationID;
\r
14 private int _jsonSize;
\r
16 private byte[] _data = null;
\r
17 private byte[] _bulkData = null;
\r
19 public ProtocolMessage() {}
\r
21 public byte getVersion() {
\r
25 public void setVersion(byte version) {
\r
26 this.version = version;
\r
29 public byte getSessionID() {
\r
33 public void setSessionID(byte sessionID) {
\r
34 this._sessionID = sessionID;
\r
37 public byte[] getData() {
\r
41 public void setData(byte[] data) {
\r
43 this._jsonSize = data.length;
\r
46 public byte[] getBulkData() {
\r
50 public void setBulkData(byte[] bulkData) {
\r
51 if (this._bulkData != null)
\r
52 this._bulkData = null;
\r
53 this._bulkData = new byte[bulkData.length];
\r
54 System.arraycopy(bulkData, 0, this._bulkData, 0, bulkData.length);
\r
55 //this._bulkData = bulkData;
\r
58 public SessionType getSessionType() {
\r
59 return _sessionType;
\r
62 public void setSessionType(SessionType sessionType) {
\r
63 this._sessionType = sessionType;
\r
66 public MessageType getMessageType() {
\r
67 return _messageType;
\r
70 public void setMessageType(MessageType messageType) {
\r
71 this._messageType = messageType;
\r
74 public byte getRPCType() {
\r
78 public void setRPCType(byte _rpcType) {
\r
79 this._rpcType = _rpcType;
\r
82 public int getFunctionID() {
\r
86 public void setFunctionID(int _functionID) {
\r
87 this._functionID = _functionID;
\r
90 public int getCorrID() {
\r
91 return _correlationID;
\r
94 public void setCorrID(int _correlationID) {
\r
95 this._correlationID = _correlationID;
\r
98 public int getJsonSize() {
\r
102 public void setJsonSize(int _jsonSize) {
\r
103 this._jsonSize = _jsonSize;
\r