/** * 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; }
public void serialize(OutputBuffer buf) throws IOException { boolean hasSource = (source != null); buf.writeBoolean(hasSource); if (hasSource) source.serialize(buf); topic.serialize(buf); }
@Override public String toString() { return " from " + (from == null ? "unknown" : from.getId()); }