Classified ads
|
Network-connection logic relating fetching items from DHT. More...
#include <retrievalengine.h>
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) |
Public Attributes | |
bool | iNeedsToRun |
Private Member Functions | |
void | emptyNodeCandidateList () |
void | askConnectionsForNodesOnConnectList () |
void | sendQueryItemToAlreadyConnectedNodes () |
void | sendQueryToNode (const Hash &aNode) |
void | checkForSuccessfullyConnectedNodes () |
void | checkForUnSuccessfullyConnectedNodes () |
Private Attributes | |
Controller * | iController |
Model & | iModel |
NetworkRequestExecutor::NetworkRequestQueueItem | iObjectBeingRetrieved |
QList< Hash > | iNodeCandidatesToTryQuery |
QList< Hash > | iNodesSuccessfullyConnected |
QList< Hash > | iNodesFailurefullyConnected |
bool | iNowRunning |
QList< NetworkRequestExecutor::NetworkRequestQueueItem > | iDownloadQueue |
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.
RetrievalEngine::RetrievalEngine | ( | Controller * | aController, |
Model & | aModel | ||
) |
Constructor
aController | application controller. not owned |
aModel | persistent storage. |
RetrievalEngine::~RetrievalEngine | ( | ) |
Destructor
|
private |
|
private |
|
private |
|
private |
|
signal |
|
slot |
when connection is attempted, NetworkListener will emit the status (failed or success) of the connection, emitted signal is connected here
|
signal |
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
|
slot |
this class is a not a thread, but QTimer, thus run.
|
private |
|
private |
void RetrievalEngine::startRetrieving | ( | NetworkRequestExecutor::NetworkRequestQueueItem | aObject, |
bool | aIsPriorityWork | ||
) |
command-interface for this class: start to do work
aObject | specifies the object to dl. |
aIsPriorityWork | is set to true if download should start right away, bypassing all other stuff that might be in the queue |
|
private |
application controller
|
private |
queue of items that we should get
|
private |
persistent storage
bool RetrievalEngine::iNeedsToRun |
when this is set to false, thread will terminate and run() return
|
private |
list of nodes where iWorkItem might be pushed to
|
private |
|
private |
|
private |
|
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