Rice Pastry API

org.mpisws.p2p.transport.peerreview.message
Class UserDataMessage<Handle extends RawSerializable>

java.lang.Object
  extended by org.mpisws.p2p.transport.peerreview.message.UserDataMessage<Handle>
All Implemented Interfaces:
Evidence, PeerReviewMessage, PeerReviewConstants, StatusConstants, RawSerializable
Direct Known Subclasses:
OutgoingUserDataMessage

public class UserDataMessage<Handle extends RawSerializable>
extends java.lang.Object
implements PeerReviewMessage, Evidence

Note, it's only Evidence when the type has been changed. MSG_USERDATA byte type = MSG_USERDATA long long topSeq handle senderHandle hash hTopMinusOne signature sig byte relevantCode // 0xFF = fully, otherwise length in bytes [payload bytes follow]

Author:
Jeff Hoye

Field Summary
static short TYPE
           
 
Fields inherited from interface org.mpisws.p2p.transport.peerreview.PeerReviewConstants
AUTH_CACHE_INTERVAL, CERT_MISSING, CHAL_AUDIT, CHAL_SEND, DEFAULT_AUDIT_INTERVAL_MILLIS, DEFAULT_AUTH_PUSH_INTERVAL_MILLIS, DEFAULT_CHECKPOINT_INTERVAL_MILLIS, DEFAULT_LOG_DOWNLOAD_TIMEOUT, DEFAULT_TIME_TOLERANCE_MILLIS, EVT_ACK, EVT_CHECKPOINT, EVT_CHOOSE_Q, EVT_CHOOSE_RAND, EVT_INIT, EVT_MAX_RESERVED, EVT_MAX_SOCKET_EVT, EVT_MIN_SOCKET_EVT, EVT_RECV, EVT_SEND, EVT_SENDSIGN, EVT_SIGN, EVT_SOCKET_CAN_READ, EVT_SOCKET_CAN_RW, EVT_SOCKET_CAN_WRITE, EVT_SOCKET_CLOSE, EVT_SOCKET_CLOSED, EVT_SOCKET_EXCEPTION, EVT_SOCKET_OPEN_INCOMING, EVT_SOCKET_OPEN_OUTGOING, EVT_SOCKET_OPENED_OUTGOING, EVT_SOCKET_READ, EVT_SOCKET_SHUTDOWN_OUTPUT, EVT_SOCKET_WRITE, EVT_VRF, EX_TYPE_ClosedChannel, EX_TYPE_IO, EX_TYPE_Unknown, FLAG_FULL_MESSAGES_ALL, FLAG_FULL_MESSAGES_SENDER, FLAG_INCLUDE_CHECKPOINT, INVALID, INVESTIGATION_INTERVAL_MILLIS, MAINTENANCE_INTERVAL_MILLIS, MAX_ACTIVE_AUDITS, MAX_ACTIVE_INVESTIGATIONS, MAX_ENTRIES_BETWEEN_CHECKPOINTS, MAX_STATUS_INFO, MAX_WITNESSED_NODES, MSG_ACCUSATION, MSG_ACK, MSG_AUTHPUSH, MSG_AUTHREQ, MSG_AUTHRESP, MSG_CHALLENGE, MSG_RESPONSE, MSG_USERDATA, MSG_USERDGRAM, NO_CERTIFICATE, PROGRESS_INTERVAL_MILLIS, PROOF_INCONSISTENT, PROOF_NONCONFORMANT, RESP_AUDIT, RESP_SEND, SIGNATURE_BAD, SIGNATURE_OK, STATE_SEND_AUDIT, STATE_WAIT_FOR_LOG, TI_AUTH_PUSH, TI_CHECKPOINT, TI_MAINTENANCE, TI_MAKE_PROGRESS, TI_MAX_RESERVED, TI_START_AUDITS, TI_STATUS_INFO, VALID
 
Fields inherited from interface org.mpisws.p2p.transport.peerreview.StatusConstants
STATUS_EXPOSED, STATUS_SUSPECTED, STATUS_TRUSTED
 
Constructor Summary
UserDataMessage(long topSeq, Handle senderHandle, byte[] topMinusOne, byte[] sig, java.nio.ByteBuffer message, int relevantlen)
           
 
Method Summary
static
<H extends RawSerializable>
UserDataMessage<H>
build(InputBuffer buf, Serializer<H> serializer, int hashSize, int sigSize)
           
 short getEvidenceType()
           
 byte[] getHTopMinusOne()
           
 byte[] getInnerHash(java.nio.ByteBuffer header, HashProvider hasher)
           
 byte[] getInnerHash(HashProvider hasher)
           
 byte[] getInnerHash(RawSerializable myId, HashProvider hasher)
          Identifier myId
 java.nio.ByteBuffer getPayload()
           
 int getPayloadLen()
           
 EvtRecv<Handle> getReceiveEvent(HashProvider hasher)
           
 byte getRelevantCode()
           
 int getRelevantLen()
           
 Handle getSenderHandle()
           
 byte[] getSignature()
           
 long getTopSeq()
           
 short getType()
           
 void serialize(OutputBuffer buf)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final short TYPE
See Also:
Constant Field Values
Constructor Detail

UserDataMessage

public UserDataMessage(long topSeq,
                       Handle senderHandle,
                       byte[] topMinusOne,
                       byte[] sig,
                       java.nio.ByteBuffer message,
                       int relevantlen)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getType

public short getType()
Specified by:
getType in interface PeerReviewMessage

getRelevantCode

public byte getRelevantCode()

serialize

public void serialize(OutputBuffer buf)
               throws java.io.IOException
Specified by:
serialize in interface Evidence
Specified by:
serialize in interface RawSerializable
Throws:
java.io.IOException

build

public static <H extends RawSerializable> UserDataMessage<H> build(InputBuffer buf,
                                                                   Serializer<H> serializer,
                                                                   int hashSize,
                                                                   int sigSize)
                                                        throws java.io.IOException
Throws:
java.io.IOException

getTopSeq

public long getTopSeq()

getSenderHandle

public Handle getSenderHandle()

getHTopMinusOne

public byte[] getHTopMinusOne()

getSignature

public byte[] getSignature()

getRelevantLen

public int getRelevantLen()

getPayload

public java.nio.ByteBuffer getPayload()

getReceiveEvent

public EvtRecv<Handle> getReceiveEvent(HashProvider hasher)

getInnerHash

public byte[] getInnerHash(RawSerializable myId,
                           HashProvider hasher)
Identifier myId

Parameters:
myHandle -
hasher -
Returns:
Throws:
java.io.IOException

getInnerHash

public byte[] getInnerHash(HashProvider hasher)
Parameters:
hasher -
Returns:

getInnerHash

public byte[] getInnerHash(java.nio.ByteBuffer header,
                           HashProvider hasher)

getPayloadLen

public int getPayloadLen()

getEvidenceType

public short getEvidenceType()
Specified by:
getEvidenceType in interface Evidence

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection