Пример #1
0
 /**
  * Parameterized constructor for this class. Creates a message with the specified from and to
  * addresses
  *
  * @param from The NodeHandle of the sending node.
  * @param to The Pastry ID of the target node.
  */
 public NetInfDHTMessage(NodeHandle from, Id to) {
   this.from = from.getId();
   this.to = to;
 }
Пример #2
0
 public void serialize(OutputBuffer buf) throws IOException {
   boolean hasSource = (source != null);
   buf.writeBoolean(hasSource);
   if (hasSource) source.serialize(buf);
   topic.serialize(buf);
 }
Пример #3
0
 @Override
 public String toString() {
   return " from " + (from == null ? "unknown" : from.getId());
 }