Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CODEX_Quorum::ByzantineQuorumSystem Class Reference

ByzantineQuorumSystem is an abstract base class derived from QuorumSystem. More...

#include <QuorumSystem.h>

Inheritance diagram for CODEX_Quorum::ByzantineQuorumSystem:

Inheritance graph
[legend]
Collaboration diagram for CODEX_Quorum::ByzantineQuorumSystem:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ByzantineQuorumSystem (ResponseTracker *aRT)
 Create a ByzantineQuorumSystem.
virtual ~ByzantineQuorumSystem ()
 Virtual destructor.
virtual unsigned int quorumSystemSize ()=0
virtual unsigned int quorumSize ()=0
virtual unsigned int faultsTolerated ()=0
virtual bool broadcastMessage (const Message &msg, ReturnVector &rets, ResponseCallback *cb)=0
 Send a message to all the servers in a QuorumSystem.
virtual bool unicastMessage (const MessageVector &msgs, ReturnVector &rets, ResponseCallback *cb=0)=0
 Send a server-specific message to each server in a QuorumSystem.
virtual void poll (MessageDispatcher &requestDispatcher, QuorumDispatcher &responseDispatcher)=0
 Poll the RemoteServer%s for incoming messages, storing or dispatching them as appropriate.
virtual unsigned char * extractKey (const unsigned char *data)
 Forwards a request to ResponseTracker::extractKey().
virtual bool keyRegistered (const unsigned char *key)
 Determines whether a key is registered with the ResponseTracker.

Protected Attributes

ResponseTrackerm_responseTracker
 This is used to match responses to their associated requests.

Detailed Description

ByzantineQuorumSystem is an abstract base class derived from QuorumSystem.

It provides no additional interfaces, and is simply used to distinguish Byzantine quorum systems from other types.

Definition at line 221 of file QuorumSystem.h.


Member Function Documentation

virtual bool CODEX_Quorum::QuorumSystem::broadcastMessage const Message msg,
ReturnVector rets,
ResponseCallback cb
[pure virtual, inherited]
 

Send a message to all the servers in a QuorumSystem.

This method only sends messages. It expects the vector rets to be initialized before calling. Repeated calls can be made until sufficient servers have been contacted. The subclass implementation should check the current values of rets before making connections.

The message sent is also registered with the ResponseTracker, since broadcasts are generally requests awaiting replies. This can be prevented by passing a 0 callback. It is advisable in cases where the sender is part of the quorum system for there to be distinct outgoing and incoming server identifiers. For example, the first bit of the first byte might flag whether this is a request being sent by the server or a response to a request from the server. This prevents the request from being treated as a response to itself in ResponseTracker.

All messages should have identifying information for the initiator of the request and a unique ID for the request.

Parameters:
msg A message to broadcast to the QuorumSystem.
rets Vector of RemoteServerReturn%s to the message.
cb If not 0, the request is added to the ResponseTracker using cb as its message callback. This should only be done once for any given request.
Returns:
true if the broadcast was successfully sent to all servers.

Implemented in CODEX_Quorum::StaticByzantineQuorumSystem< N, T >, CODEX_Quorum::StaticByzantineQuorumSystem< nServers, nFaults >, and CODEX_Quorum::StaticByzantineQuorumSystem< 3 *T+1, T >.

Referenced by CODEX_Server::SignRequestHandler::handler(), and CODEX_Server::BroadcastRequestHandler::handler().

virtual unsigned int CODEX_Quorum::QuorumSystem::faultsTolerated  )  [pure virtual, inherited]
 

Returns:
The number of faults tolerated by this QuorumSystem.

Implemented in CODEX_Quorum::StaticByzantineQuorumSystem< N, T >, CODEX_Quorum::StaticByzantineQuorumSystem< nServers, nFaults >, and CODEX_Quorum::StaticByzantineQuorumSystem< 3 *T+1, T >.

Referenced by CODEX_KeyService::DelegateResponseVerifier::handler(), CODEX_KeyService::SignWriteCallback::operator()(), CODEX_KeyService::SignReadCallback::operator()(), CODEX_KeyService::SignCreateCallback::operator()(), and CODEX_KeyService::ClientReadCallback::operator()().

virtual bool CODEX_Quorum::QuorumSystem::keyRegistered const unsigned char *  key  )  [inline, virtual, inherited]
 

Determines whether a key is registered with the ResponseTracker.

Returns:
Whether the key passed in is registered.

Definition at line 207 of file QuorumSystem.h.

References CODEX_Quorum::QuorumSystem::m_responseTracker.

Referenced by CODEX_Server::UnicastRequestHandler::handler(), and CODEX_Server::BroadcastRequestHandler::handler().

virtual void CODEX_Quorum::QuorumSystem::poll MessageDispatcher requestDispatcher,
QuorumDispatcher responseDispatcher
[pure virtual, inherited]
 

Poll the RemoteServer%s for incoming messages, storing or dispatching them as appropriate.

A non-blocking select(2) is used to determine if there is incoming data. New requests are dispatched, and responses are stored in a ResponseTracker until a quorum has been received, at which point they too will be dispatched.

Parameters:
requestDispatcher Functional object that dispatches new requests
responseDispatcher Functional object that dispatches responses from a quorum

Implemented in CODEX_Quorum::StaticByzantineQuorumSystem< N, T >, CODEX_Quorum::StaticByzantineQuorumSystem< nServers, nFaults >, and CODEX_Quorum::StaticByzantineQuorumSystem< 3 *T+1, T >.

virtual unsigned int CODEX_Quorum::QuorumSystem::quorumSize  )  [pure virtual, inherited]
 

Returns:
The size of a quorum for this QuorumSystem.

Implemented in CODEX_Quorum::StaticByzantineQuorumSystem< N, T >, CODEX_Quorum::StaticByzantineQuorumSystem< nServers, nFaults >, and CODEX_Quorum::StaticByzantineQuorumSystem< 3 *T+1, T >.

Referenced by CODEX_Server::UnicastRequestHandler::handler(), CODEX_Server::SignRequestHandler::handler(), CODEX_APSS::MessageVerifier::handler(), CODEX_KeyService::DelegateResponseVerifier::handler(), CODEX_Server::BroadcastRequestHandler::handler(), CODEX_KeyService::VerifyWriteCallback::operator()(), CODEX_KeyService::SignWriteCallback::operator()(), CODEX_KeyService::SignReadCallback::operator()(), CODEX_KeyService::SignCreateCallback::operator()(), CODEX_KeyService::ClientWriteCallback::operator()(), CODEX_KeyService::ClientReadCallback::operator()(), and CODEX_KeyService::ClientCreateCallback::operator()().

virtual unsigned int CODEX_Quorum::QuorumSystem::quorumSystemSize  )  [pure virtual, inherited]
 

Returns:
The number of servers in this QuorumSystem.

Implemented in CODEX_Quorum::StaticByzantineQuorumSystem< N, T >, CODEX_Quorum::StaticByzantineQuorumSystem< nServers, nFaults >, and CODEX_Quorum::StaticByzantineQuorumSystem< 3 *T+1, T >.

virtual bool CODEX_Quorum::QuorumSystem::unicastMessage const MessageVector msgs,
ReturnVector rets,
ResponseCallback cb = 0
[pure virtual, inherited]
 

Send a server-specific message to each server in a QuorumSystem.

This method only sends messages. It expects the vector rets to be initialized before calling. Repeated calls can be made until sufficient servers have been contacted. The subclass implementation should check the current values of rets before making connections.

By default, the message sent is not registered with the ResponseTracker, since unicasts are not generally requests awaiting replies. This behavior can be changed by passing a callback object. It is advisable in cases where the sender is part of the quorum system for there to be distinct outgoing and incoming server identifiers. For example, the first bit of the first byte might flag whether this is a request being sent by the server or a response to a request from the server. This prevents the request from being treated as a response to itself in ResponseTracker.

Parameters:
msgs A set of messages to unicast to the servers in the QuorumSystem.
rets Vector of RemoteServerReturn%s to the messages.
cb If not 0, the request is added to the ResponseTracker using cb as its message callback. This should only be done once for any given request.
Returns:
true if the unicasts were successfully sent to all servers.

Implemented in CODEX_Quorum::StaticByzantineQuorumSystem< N, T >, CODEX_Quorum::StaticByzantineQuorumSystem< nServers, nFaults >, and CODEX_Quorum::StaticByzantineQuorumSystem< 3 *T+1, T >.

Referenced by CODEX_Server::UnicastRequestHandler::handler().


The documentation for this class was generated from the following file:
Generated on Fri May 6 17:42:30 2005 for COrnell Data EXchange (CODEX) by  doxygen 1.4.1