KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dream > protocol > utobcast > message > UTOBcastChunk


1 /**
2  * Dream
3  * Copyright (C) 2003-2004 INRIA Rhone-Alpes
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact: dream@objectweb.org
20  *
21  * Initial developer(s): Vivien Quema
22  * Contributor(s):
23  */

24
25 package org.objectweb.dream.protocol.utobcast.message;
26
27 import org.objectweb.dream.message.ChunkType;
28 import org.objectweb.dream.message.ChunkTypeImpl;
29 import org.objectweb.dream.protocol.Process;
30 import org.objectweb.dream.queue.SequenceNumberChunk;
31
32 /**
33  * Chunk interface for UTOBcast protocol messages. This interface allows
34  * retrieving the type of the message that contains it: DAT, ACK, REP, UTO, UPD,
35  * or BAK.
36  */

37 public interface UTOBcastChunk extends SequenceNumberChunk
38 {
39   // TODO extends SequenceNumberChunk is not very "exo" !... Could be put in
40
// another chunk
41

42   /** The default name for chunks of this type. */
43   String JavaDoc DEFAULT_NAME = "utoBcastChunk";
44
45   /** The Chunk type of chunks that implements this interface. */
46   ChunkType TYPE = new ChunkTypeImpl(UTOBcastChunk.class,
47                              UTOBcastChunkImpl.class);
48
49   /**
50    * The byte value for DAT message type.
51    */

52   byte DAT = 0;
53
54   /**
55    * The byte value for ACK message type.
56    */

57   byte ACK = 1;
58
59   /**
60    * The byte value for REP message type.
61    */

62   byte REP = 2;
63
64   /**
65    * The byte value for UTO message type.
66    */

67   byte UTO = 3;
68
69   /**
70    * The byte value for UPD message type.
71    */

72   byte UPD = 4;
73
74   /**
75    * The byte value for BAK message type.
76    */

77   byte BAK = 5;
78
79   /**
80    * Returns the UTOBcast type of the message that contains this chunk.
81    *
82    * @return <ul>
83    * <li>0 for DAT messages</li>
84    * <li>1 for ACK messages</li>
85    * <li>2 for REP messages</li>
86    * <li>3 for UTO messages</li>
87    * <li>4 for UPD messages</li>
88    * <li>5 for BACK messages</li>
89    * </ul>
90    */

91   byte getUTOBcastMessageType();
92
93   /**
94    * Sets the UTOBcast type of the message that contains this chunk. This type
95    * can be
96    * <ul>
97    * <li>0 for DAT messages</li>
98    * <li>1 for ACK messages</li>
99    * <li>2 for REP messages</li>
100    * <li>3 for UTO messages</li>
101    * <li>4 for UPD messages</li>
102    * <li>5 for BACK messages</li>
103    * </ul>
104    *
105    * @param type the UTOBcast type to set.
106    */

107   void setUTOBcastMessageType(byte type);
108
109   /**
110    * Returns the process that sent this message.
111    *
112    * @return the process that sent this message.
113    */

114   Process JavaDoc getProcessFrom();
115
116   /**
117    * Sets the process that sent this message.
118    *
119    * @param process the process that sent this message.
120    */

121   void setProcessFrom(Process JavaDoc process);
122
123   /**
124    * Returns the process to which this message is destinated.
125    *
126    * @return the process to which this message is destinated.
127    */

128   Process JavaDoc getProcessTo();
129
130   /**
131    * Sets the process to which this message is destinated.
132    *
133    * @param process the process to which this message is destinated.
134    */

135   void setProcessTo(Process JavaDoc process);
136
137 }
Popular Tags