01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.net.protocol;
05:
06: public class GenericNetworkHeader extends AbstractTCNetworkHeader {
07:
08: private static final int LENGTH = 12;
09:
10: public GenericNetworkHeader() {
11: super (LENGTH, LENGTH);
12: }
13:
14: public void setSequence(int sequence) {
15: data.putInt(4, sequence);
16: }
17:
18: public int getSequence() {
19: return data.getInt(4);
20: }
21:
22: public void setClientNum(int num) {
23: data.putInt(8, num);
24: }
25:
26: public int getClientNum() {
27: return data.getInt(8);
28: }
29:
30: public int getHeaderByteLength() {
31: return LENGTH;
32: }
33:
34: protected void setHeaderLength(short length) {
35: if (length != LENGTH) {
36: throw new IllegalArgumentException("Header length must be "
37: + LENGTH);
38: }
39:
40: return;
41: }
42:
43: public int getMessageDataLength() {
44: return data.getInt(0);
45: }
46:
47: void setMessageDataLength(int length) {
48: data.putInt(0, length);
49: }
50:
51: public void validate() {
52: return;
53: }
54:
55: }
|