|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.network.NetworkMessage | +--ostore.network.AuthenticationMsg
The first message sent across a new connection in
YANetwork
. Replaces IdentityMessage
.
This message informs the receiver of the sender's primary contact id. The receiver can then eliminate redundant connections. This message is required because outgoing connections do not in general come from the sender's listen port, and also because virtual node ids may listen on several ports in addition to their "primary" port.
This message also optionally includes certificates mapping virtual node ids to the primary contact id. These certificates are included if and only if the sending node hosts multiple virtual nodes.
Eventually the content of this message will be signed by the sender, and
the sender's key will be bound to its NodeId
using some
sort of certificate authority. The message should also include some
sort of timestamp or counter to prevent replay attacks.
Only then will the message securely authenticate the sender.
Field Summary |
---|
Fields inherited from class ostore.network.NetworkMessage |
---|
comp_q, est_rtt_ms, inbound, peer, sender, tries, user_data, wait_ms |
Constructor Summary | |
---|---|
AuthenticationMsg(InputBuffer buffer)
Constructs an AuthenticationMsg from its
serialize d form. |
|
AuthenticationMsg(NodeId peer,
NodeId local_contact_id,
NodeId this_connection_id,
VirtualizedNetCert[] certs)
Creates a message mapping the sender's InetAddress and
port number for a specific connection to the sender's primary
contact NodeId . |
Method Summary | |
---|---|
Object |
clone()
|
NodeId |
get_connection_id()
Returns the address and port used by this specific connection, which may be different from the sender's contact id. |
NodeId |
get_contact_id()
Returns the primary id to use to contact the sender of this message. |
VirtualizedNetCert[] |
get_virtualized_net_certs()
Returns an array of VirtualizedNetCert objects. |
void |
serialize(OutputBuffer buffer)
Add the object to the buffer . |
String |
toString()
Returns a human-readable representation of this message. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AuthenticationMsg(NodeId peer, NodeId local_contact_id, NodeId this_connection_id, VirtualizedNetCert[] certs)
InetAddress
and
port number for a specific connection to the sender's primary
contact NodeId
.
public AuthenticationMsg(InputBuffer buffer) throws QSException
AuthenticationMsg
from its
serialize
d form.
Method Detail |
public NodeId get_contact_id()
public NodeId get_connection_id()
public VirtualizedNetCert[] get_virtualized_net_certs()
VirtualizedNetCert
objects. Each declares
that the specified virtual node can be contacted at the primary id.
Returning the whole array is not as safe as cloning it, so be careful not to modify the array itself.
public void serialize(OutputBuffer buffer)
QuickSerializable
buffer
.
serialize
in interface QuickSerializable
serialize
in class NetworkMessage
buffer
- the output buffer to add the object topublic Object clone() throws CloneNotSupportedException
clone
in class NetworkMessage
CloneNotSupportedException
public String toString()
toString
in class NetworkMessage
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |