View Javadoc

1   package org.xvsm.remote.freepastry;
2   
3   import rice.p2p.commonapi.Id;
4   import rice.p2p.commonapi.Message;
5   
6   /***
7    * Implements the Message interface of the FreePastry-API. Is needed to send
8    * messages through the network.
9    * 
10   * @author Hannu-Daniel Goiss
11   */
12  public class FreePastryMessage implements Message {
13  	Id from;
14  	Id to;
15  	byte data[];
16  
17  	public FreePastryMessage(Id from, Id to, byte data[]) {
18  		this.from = from;
19  		this.to = to;
20  		this.data = data;
21  	}
22  
23  	public String toString() {
24  		return "MyMsg from " + from + " to " + to + " data: " + data;
25  	}
26  
27  	public int getPriority() {
28  		return 0;
29  	}
30  
31  	/***
32  	 * @return the data
33  	 */
34  	public byte[] getData() {
35  		return data;
36  	}
37  
38  }