001: /*
002: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003: * notice. All rights reserved.
004: */
005: package com.tc.net.protocol.delivery;
006:
007: import com.tc.bytes.TCByteBuffer;
008: import com.tc.exception.ImplementMe;
009: import com.tc.net.protocol.TCNetworkHeader;
010: import com.tc.net.protocol.TCNetworkMessage;
011: import com.tc.net.protocol.delivery.OOOProtocolMessage;
012:
013: /**
014: *
015: */
016: public class TestProtocolMessage implements OOOProtocolMessage {
017: public TCNetworkMessage msg;
018: public long sent;
019: public long ack;
020: public boolean isHandshake = false;
021: public boolean isHandshakeReplyOk = false;
022: public boolean isSend = false;
023: public boolean isAck = false;
024: private boolean isGoodbye = false;
025: public short sessionId = 0;
026:
027: public TestProtocolMessage(TCNetworkMessage msg, long sent, long ack) {
028: this .msg = msg;
029: this .sent = sent;
030: this .ack = ack;
031: }
032:
033: public TestProtocolMessage() {
034: //
035: }
036:
037: public long getAckSequence() {
038: return ack;
039: }
040:
041: public long getSent() {
042: return sent;
043: }
044:
045: public boolean isHandshake() {
046: return isHandshake;
047: }
048:
049: public boolean isHandshakeReplyOk() {
050: return isHandshakeReplyOk;
051: }
052:
053: public boolean isHandshakeReplyFail() {
054: return !isHandshakeReplyOk;
055: }
056:
057: public boolean isSend() {
058: return isSend;
059: }
060:
061: public boolean isAck() {
062: return isAck;
063: }
064:
065: public short getSessionId() {
066: return (sessionId);
067: }
068:
069: public void setSessionId(short id) {
070: sessionId = id;
071: }
072:
073: /*********************************************************************************************************************
074: * TCNetworkMessage stuff
075: */
076:
077: public TCNetworkHeader getHeader() {
078: throw new ImplementMe();
079: }
080:
081: public TCNetworkMessage getMessagePayload() {
082: throw new ImplementMe();
083: }
084:
085: public TCByteBuffer[] getPayload() {
086: throw new ImplementMe();
087: }
088:
089: public TCByteBuffer[] getEntireMessageData() {
090: throw new ImplementMe();
091: }
092:
093: public boolean isSealed() {
094: throw new ImplementMe();
095: }
096:
097: public void seal() {
098: throw new ImplementMe();
099: }
100:
101: public int getDataLength() {
102: throw new ImplementMe();
103: }
104:
105: public int getHeaderLength() {
106: throw new ImplementMe();
107: }
108:
109: public int getTotalLength() {
110: throw new ImplementMe();
111: }
112:
113: public void wasSent() {
114: throw new ImplementMe();
115: }
116:
117: public void setSentCallback(Runnable callback) {
118: throw new ImplementMe();
119: }
120:
121: public Runnable getSentCallback() {
122: throw new ImplementMe();
123: }
124:
125: public void recycle() {
126: throw new ImplementMe();
127: }
128:
129: public boolean isGoodbye() {
130: return isGoodbye;
131: }
132:
133: public void reallyDoRecycleOnWrite() {
134: //
135: }
136: }
|