File | Line |
---|
edu/nwu/scribe/dll/DataPacket.java | 37 |
edu/nwu/scribe/dll/PublishRequest.java | 37 |
public class PublishRequest extends PastryPacket
{
/** The version of the packet. */
private static final int VERSION = 0;
/** The field definition of the packet. */
private static final IPacketField[] FIELDS = new IPacketField[]
{
new SimpleField(DefaultTypeMapping.OBJECT, "session",
"the session identifier"),
new SimpleField(DefaultTypeMapping.OBJECT, "source",
"the data source"),
new SimpleField(DefaultTypeMapping.LONG, "seqnr",
"the sequence number"),
new SimpleField(DefaultTypeMapping.OBJECT, "timestamp",
"the send timestamp"),
new SimpleField(DefaultTypeMapping.INTEGER, "hops",
"the hop distance"),
new ArrayField(DefaultTypeMapping.ARRAY, 1,
DefaultTypeMapping.BYTE, "data", "the data")
};
/** The session identifier. */
private Identifier session;
/** The source. */
private AgentId source;
/** The sequence number. */
private long seqNr;
/** The timestamp. */
private ITimestamp timestamp;
/** The hop distance. */
private int hops;
/** The data. */
private byte[] data;
/**
* Creates a new instance of DataPacket.
*/
public PublishRequest() |
File | Line |
---|
edu/nwu/scribe/dll/JoinRedirect.java | 70 |
edu/nwu/scribe/dll/CostQueryRequest.java | 69 |
public CostQueryRequest(Identifier session, NodeId node)
{
this();
this.session = session;
this.node = node;
}
/**
* Get the session identifier.
*
* @return the session identifier
*/
public Identifier getSessionId()
{
return session;
}
/**
* Get the node.
*
* @return the node
*/
public NodeId getNode()
{
return node;
}
/**
* Decode the byte stream.
*
* @param in the input stream
* @throws InvalidPacketException if the packet is invalid
*/
protected void decode(FieldDecoder in)
throws edu.nwu.net.api.InvalidPacketException
{
super.decode(in);
session = (Identifier) in.decode();
node = (NodeId) in.decode();
}
/**
* Encode the byte stream.
*
* @param out the output stream
*/
protected void encode(FieldEncoder out)
{
super.encode(out);
out.encode(session);
out.encode(node);
}
} |
File | Line |
---|
edu/nwu/scribe/bll/MulticastProtocol.java | 248 |
edu/nwu/scribe/bll/MulticastProtocol.java | 293 |
logger.debug(this + ": publish packet " + pkt.getSeqNr()
+ " from " + pkt.getSource());
}
for (int i = 0; i < children.length; i++)
{
DataPacket forward = new DataPacket(pkt.getSessionId(),
pkt.getSource(), pkt.getSeqNr(),
pkt.getSendTimestamp(), pkt.getHopCount() + 1,
pkt.getData());
forward.setDestination(children[i].getId());
getEndPoint().route(children[i], forward);
}
}
else |