CPD Results

The following document contains the results of PMD's CPD

Duplications

FileLine
edu/nwu/scribe/dll/DataPacket.java116
edu/nwu/scribe/dll/PublishRequest.java106
    }

    /**
     * Get the session identifier.
     *
     * @return the session identifier
     */
    public Identifier getSessionId()
    {
        return session;
    }

    /**
     * Get the grand parent.
     *
     * @return the grand parent
     */
    public AgentId getSource()
    {
        return source;
    }

    /**
     * Get the sequence number.
     *
     * @return the layer
     */
    public long getSeqNr()
    {
        return seqNr;
    }

    /**
     * Get the send timestamp.
     *
     * @return the send timestamp
     */
    public ITimestamp getSendTimestamp()
    {
        return timestamp;
    }

    /**
     * Get the number of hops traveled.
     *
     * @return the number of hops
     */
    public int getHops()
    {
        return hops;
    }

    /**
     * Get the data.
     *
     * @return the data
     */
    public byte[] getData()
    {
        return data;
    }

    /**
     * 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();
        source = (AgentId) in.decode();
        seqNr = in.decodeLong();
        timestamp = (ITimestamp) in.decode();
        hops = in.decodeInteger();
        data = in.decodeByteA();
    }

    /**
     * Encode the byte stream.
     *
     * @param out the output stream
     */
    protected void encode(FieldEncoder out)
    {
        super.encode(out);

        out.encode(session);
        out.encode(source);
        out.encodeLong(seqNr);
        out.encode(timestamp);
        out.encodeInteger(hops);
        out.encodeByteA(data);
    }
}

FileLine
edu/nwu/scribe/dll/DataPacket.java37
edu/nwu/scribe/dll/PublishRequest.java37
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()

FileLine
edu/nwu/scribe/dll/JoinRedirect.java70
edu/nwu/scribe/dll/CostQueryRequest.java69
    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);
    }
}

FileLine
edu/nwu/scribe/bll/MulticastProtocol.java248
edu/nwu/scribe/bll/MulticastProtocol.java293
                    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