Classified ads
Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
RetrievalEngine Class Reference

Network-connection logic relating fetching items from DHT. More...

#include <retrievalengine.h>

Inheritance diagram for RetrievalEngine:
Inheritance graph
[legend]
Collaboration diagram for RetrievalEngine:
Collaboration graph
[legend]

Public Slots

void nodeConnectionAttemptStatus (Connection::ConnectionState aStatus, const Hash aHashOfAttemptedNode)
 
void run ()
 

Signals

void error (QTcpSocket::SocketError socketError)
 
void notifyOfContentNotReceived (const Hash &aHashOfContent, const ProtocolItemType aTypeOfNotReceivdContent)
 

Public Member Functions

 RetrievalEngine (Controller *aController, Model &aModel)
 
 ~RetrievalEngine ()
 
void startRetrieving (NetworkRequestExecutor::NetworkRequestQueueItem aObject, bool aIsPriorityWork)
 
void notifyOfContentReceived (const Hash &aHashOfContent, const ProtocolItemType aTypeOfReceivdContent)
 

Private Member Functions

void emptyNodeCandidateList ()
 
void askConnectionsForNodesOnConnectList ()
 
void sendQueryItemToAlreadyConnectedNodes ()
 
void sendQueryToNode (const Hash &aNode)
 
void checkForSuccessfullyConnectedNodes ()
 
void checkForUnSuccessfullyConnectedNodes ()
 

Private Attributes

ControlleriController
 
ModeliModel
 
NetworkRequestExecutor::NetworkRequestQueueItem iObjectBeingRetrieved
 
QList< HashiNodeCandidatesToTryQuery
 
QList< HashiNodesSuccessfullyConnected
 
QList< HashiNodesFailurefullyConnected
 
bool iNowRunning
 
QList< NetworkRequestExecutor::NetworkRequestQueueItemiDownloadQueue
 

Detailed Description

Network-connection logic relating fetching items from DHT.

This class has some similarity to PublishingEngine but this does somewhat the reverse. This is given a hash of object to find from network ; in order to so, it will initiate connections nearby nodes and ask for the content in-demand.

Constructor & Destructor Documentation

◆ RetrievalEngine()

RetrievalEngine::RetrievalEngine ( Controller aController,
Model aModel 
)

Constructor

Parameters
aControllerapplication controller. not owned
aModelpersistent storage.

◆ ~RetrievalEngine()

RetrievalEngine::~RetrievalEngine ( )

Destructor

Member Function Documentation

◆ askConnectionsForNodesOnConnectList()

void RetrievalEngine::askConnectionsForNodesOnConnectList ( )
private

◆ checkForSuccessfullyConnectedNodes()

void RetrievalEngine::checkForSuccessfullyConnectedNodes ( )
private

◆ checkForUnSuccessfullyConnectedNodes()

void RetrievalEngine::checkForUnSuccessfullyConnectedNodes ( )
private

◆ emptyNodeCandidateList()

void RetrievalEngine::emptyNodeCandidateList ( )
private

◆ error

void RetrievalEngine::error ( QTcpSocket::SocketError  socketError)
signal

◆ nodeConnectionAttemptStatus

void RetrievalEngine::nodeConnectionAttemptStatus ( Connection::ConnectionState  aStatus,
const Hash  aHashOfAttemptedNode 
)
slot

when connection is attempted, NetworkListener will emit the status (failed or success) of the connection, emitted signal is connected here

◆ notifyOfContentNotReceived

void RetrievalEngine::notifyOfContentNotReceived ( const Hash aHashOfContent,
const ProtocolItemType  aTypeOfNotReceivdContent 
)
signal

◆ notifyOfContentReceived()

void RetrievalEngine::notifyOfContentReceived ( const Hash aHashOfContent,
const ProtocolItemType  aTypeOfReceivdContent 
)

when content is received, we may want to check if it was the content we were waiting for. this method is for performing that check

◆ run

void RetrievalEngine::run ( )
slot

this class is a not a thread, but QTimer, thus run.

◆ sendQueryItemToAlreadyConnectedNodes()

void RetrievalEngine::sendQueryItemToAlreadyConnectedNodes ( )
private

◆ sendQueryToNode()

void RetrievalEngine::sendQueryToNode ( const Hash aNode)
private

◆ startRetrieving()

void RetrievalEngine::startRetrieving ( NetworkRequestExecutor::NetworkRequestQueueItem  aObject,
bool  aIsPriorityWork 
)

command-interface for this class: start to do work

Parameters
aObjectspecifies the object to dl.
aIsPriorityWorkis set to true if download should start right away, bypassing all other stuff that might be in the queue

Member Data Documentation

◆ iController

Controller* RetrievalEngine::iController
private

application controller

◆ iDownloadQueue

QList<NetworkRequestExecutor::NetworkRequestQueueItem> RetrievalEngine::iDownloadQueue
private

queue of items that we should get

◆ iModel

Model& RetrievalEngine::iModel
private

persistent storage

◆ iNodeCandidatesToTryQuery

QList<Hash> RetrievalEngine::iNodeCandidatesToTryQuery
private

list of nodes where iWorkItem might be pushed to

◆ iNodesFailurefullyConnected

QList<Hash> RetrievalEngine::iNodesFailurefullyConnected
private

◆ iNodesSuccessfullyConnected

QList<Hash> RetrievalEngine::iNodesSuccessfullyConnected
private

◆ iNowRunning

bool RetrievalEngine::iNowRunning
private

◆ iObjectBeingRetrieved

NetworkRequestExecutor::NetworkRequestQueueItem RetrievalEngine::iObjectBeingRetrieved
private

what kind of stuff we try. ..this class waits for exactly one item at time. item currently being fetched is stored in this variable


The documentation for this class was generated from the following file: