Classes | Public Types
Tonido::Data::PeerManager Class Reference

Manages Peers. More...

List of all members.

Classes

struct  PeerStatusData

Public Types

typedef boost::shared_ptr
< PeerManager
SharedPtr

Public Member Functions

Ctors & Dtors
 PeerManager (void)
 Ctor.
 ~PeerManager (void)
 Dtor.
Peer Management
Peer::SharedPtr peerGet (const PeerID &a_peerID)
 Get specific Peer given a PeerID.
bool peerUpdate (const Peer::SharedPtr &a_peer)
 Updates a Specific Peer.
bool peerAdd (const Peer::SharedPtr &a_peer)
 Add a new Peer.
bool peerDelete (const PeerID &a_peer)
 Removes the peer.
bool peerCollectionGet (Peer::Collection &a_collection, const Poco::UUID &a_groupID, int64_bt a_from=-1, int64_bt a_numOfRecs=-1)
 Returns the list of peers in a given group.
bool peerCollectionGet (Peer::Collection &a_collection, int64_bt a_from=-1, int64_bt a_numOfRecs=-1)
 Returns the full list of peers that we know about.
bool getPeerOnline (const PeerID &a_peer)
 Returns if the peer is online.
bool isPeerConnected (const PeerID &a_peer)
 Returns if the peer is connected to us.
bool isPeerLocal (const PeerID &a_peer)
 Returns if the peer is in local network.
uint32_bt numPeersOnline ()
 Get number of online peers.
bool blockedPeersCollectionGet (std::vector< PeerID > &a_List)
 Gets List of blockced peers.
bool blockedPeerAdd (const PeerID &a_peerid)
 Block peer.
bool blockedPeerDelete (const PeerID &a_peerid)
 Remove blocked peer.
bool isPeerBlocked (const PeerID &a_peerid)
 Checks if peer is blocked.
Internal Use Only
void handlePeerHello (Message::SharedPtr &args)
 handlePeerHello
void handlePeerHelloOk (Message::SharedPtr &args)
 handlePeerHelloOk
void handlePeerInfo (Message::SharedPtr &args)
 handlePeerInfo
void sendHello (const PeerID &a_peerID)
 sendHello
void processNetworkOnline ()
 Event Notification Functions.
void processNetworkOffline ()
void processPeerConnect (const PeerID &a_peerID)
void processPeerDisconnect (const PeerID &a_peerID)
void processGroupAdded ()
void processGroupRemoved ()
void processGroupUserAdded ()
void processGroupUserRemoved ()
void processPeerLookupOnline (const PeerID &a_peerID, bool a_isLocal, bool a_applyLocal)
void processPeerLookupOffline (const PeerID &a_peerID)
void onTimer ()
 Processes the scheduled timer message.

Detailed Description

Manages Peers.

Interface to working with Peers


Constructor & Destructor Documentation

Tonido::Data::PeerManager::PeerManager ( void  )

Ctor.

details if needed ...

Tonido::Data::PeerManager::~PeerManager ( void  )

Dtor.

details if needed ...


Member Function Documentation

bool Tonido::Data::PeerManager::blockedPeerAdd ( const PeerID a_peerid)

Block peer.

Parameters:
a_peeridpeer id to block
Returns:
true if peer is blocked, false otherwise
bool Tonido::Data::PeerManager::blockedPeerDelete ( const PeerID a_peerid)

Remove blocked peer.

Parameters:
a_peeridpeer id to remove
Returns:
true if peer is removed, false otherwise
bool Tonido::Data::PeerManager::blockedPeersCollectionGet ( std::vector< PeerID > &  a_List)

Gets List of blockced peers.

Parameters:
a_Listoutput list of blocked peers
Returns:
true if success, false otherwise
bool Tonido::Data::PeerManager::getPeerOnline ( const PeerID a_peer)

Returns if the peer is online.

Parameters:
a_peerpeer id to check
Returns:
true if peer is online, false otherwise
void Tonido::Data::PeerManager::handlePeerHello ( Message::SharedPtr &  args)

handlePeerHello

Handles a Peer Hello message

void Tonido::Data::PeerManager::handlePeerHelloOk ( Message::SharedPtr &  args)

handlePeerHelloOk

Handles a Peer Hello message

void Tonido::Data::PeerManager::handlePeerInfo ( Message::SharedPtr &  args)

handlePeerInfo

Handles a Peer Info message

bool Tonido::Data::PeerManager::isPeerBlocked ( const PeerID a_peerid)

Checks if peer is blocked.

Parameters:
a_peeridpeer id to check
Returns:
true if peer is blocked, false otherwise
bool Tonido::Data::PeerManager::isPeerConnected ( const PeerID a_peer)

Returns if the peer is connected to us.

Parameters:
a_peerpeer id to check
Returns:
true if peer is connected, false otherwise
bool Tonido::Data::PeerManager::isPeerLocal ( const PeerID a_peer)

Returns if the peer is in local network.

Parameters:
a_peerpeer id to check
Returns:
true if peer is in local network, false otherwise
uint32_bt Tonido::Data::PeerManager::numPeersOnline ( )

Get number of online peers.

Returns:
number of online peers
bool Tonido::Data::PeerManager::peerAdd ( const Peer::SharedPtr &  a_peer)

Add a new Peer.

Parameters:
a_peerpeer to add
Returns:
true if success, false otherwise
bool Tonido::Data::PeerManager::peerCollectionGet ( Peer::Collection &  a_collection,
const Poco::UUID &  a_groupID,
int64_bt  a_from = -1,
int64_bt  a_numOfRecs = -1 
)

Returns the list of peers in a given group.

Parameters:
a_collectionoutput collection of peers
a_groupIDgroup id to get peers
a_fromstart position to read
a_numOfRecsnumber of records to return
Returns:
true if success, false otherwise
bool Tonido::Data::PeerManager::peerCollectionGet ( Peer::Collection &  a_collection,
int64_bt  a_from = -1,
int64_bt  a_numOfRecs = -1 
)

Returns the full list of peers that we know about.

Parameters:
a_collectionoutput collection of peers
a_fromstart position to read
a_numOfRecsnumber of records to return
Returns:
true if success, false otherwise
bool Tonido::Data::PeerManager::peerDelete ( const PeerID a_peer)

Removes the peer.

Parameters:
a_peerpeer to remove
Returns:
true if success, false otherwise
Peer::SharedPtr Tonido::Data::PeerManager::peerGet ( const PeerID a_peerID)

Get specific Peer given a PeerID.

Parameters:
a_peerIDpeerID to get
Returns:
Peer
bool Tonido::Data::PeerManager::peerUpdate ( const Peer::SharedPtr &  a_peer)

Updates a Specific Peer.

Parameters:
a_peerpeer to update
Returns:
true if success, false otherwise
void Tonido::Data::PeerManager::processNetworkOnline ( )

Event Notification Functions.

Processes various events

void Tonido::Data::PeerManager::sendHello ( const PeerID a_peerID)

sendHello

Sends an hello to generate a PEER_CONNECT


Generated on Wed Oct 12 2011 21:46:53. © CodeLathe LLC 2007-2011. All Rights Reserved.