Classified ads
Classes | Public Types | Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
NetworkRequestExecutor Class Reference

Logic for handling tasks received from other peers or from user. More...

#include <netrequestexecutor.h>

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

Classes

struct  NetworkRequestQueueItem
 Work queue item. More...
 

Public Types

enum  NetworkRequestState {
  NewRequest, Processing, NodeIsInWishList, RequestBeingSentAround,
  ReadyToSend
}
 

Public Slots

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

Public Member Functions

 NetworkRequestExecutor (MController *aController, Model &aModel)
 
 ~NetworkRequestExecutor ()
 

Private Member Functions

void processNodeGreeting (NetworkRequestQueueItem &aEntry)
 
void processRequestForNodesAroundHash (NetworkRequestQueueItem &entry)
 
void processRequestForContentPublish (NetworkRequestQueueItem &entry)
 
void processRequestForPrivateMessagePublish (NetworkRequestQueueItem &aEntry)
 
void processRequestForBinaryBlob (NetworkRequestQueueItem &aEntry)
 
void processRequestForClassifiedAd (NetworkRequestQueueItem &aEntry)
 
void processRequestForProfilePoll (NetworkRequestQueueItem &aEntry)
 
void processRequestForUserProfile (NetworkRequestQueueItem &aEntry)
 
void processRequestForUserProfileComment (NetworkRequestQueueItem &aEntry)
 
void doSendRequestToNode (NetworkRequestQueueItem &aEntry, const Hash &aNodeToSend=KNullHash)
 
void sendRequestToNodesAroundHash (NetworkRequestQueueItem &aEntry, bool aUseContentHashNotDestination=false)
 
void processBinaryBlob (NetworkRequestQueueItem &aEntry)
 
void processPrivateMessage (NetworkRequestQueueItem &aEntry)
 
void processUserProfileCommentsForProfile (NetworkRequestQueueItem &entry)
 
void processUserProfileComment (NetworkRequestQueueItem &aEntry)
 
void processPrivateMessagesForProfile (NetworkRequestQueueItem &aEntry)
 
void processUserProfile (NetworkRequestQueueItem &aEntry)
 
void processClassifiedAd (NetworkRequestQueueItem &aEntry)
 
void processAdsClassified (NetworkRequestQueueItem &aEntry)
 

Private Attributes

MControlleriController
 
ModeliModel
 
bool iNowRunning
 
time_t iLastTimeOfNodeConnectedNodeStatusUpdate
 

Detailed Description

Logic for handling tasks received from other peers or from user.

Here is class that takes requests sent (or generated locally) from queue, obtains data needed and puts results into send-queues of nodes that need to see the results.

Member Enumeration Documentation

◆ NetworkRequestState

requests may be new, being processed, or ready to be sent, have enum indicating the state

Enumerator
NewRequest 

NetworkRequestExecutor has not yet touched

Processing 

is working in this very moment

NodeIsInWishList 

node connection in progress

RequestBeingSentAround 

request is sent to nodes around hash

ReadyToSend 

request completed but not sent

Constructor & Destructor Documentation

◆ NetworkRequestExecutor()

NetworkRequestExecutor::NetworkRequestExecutor ( MController aController,
Model aModel 
)

constructor

◆ ~NetworkRequestExecutor()

NetworkRequestExecutor::~NetworkRequestExecutor ( )

Member Function Documentation

◆ doSendRequestToNode()

void NetworkRequestExecutor::doSendRequestToNode ( NetworkRequestQueueItem aEntry,
const Hash aNodeToSend = KNullHash 
)
private

method for actually sending the bytes to peer

Parameters
aEntryis the request to send
aNodeToSendis fingerprint of the node where to send ; if KNullHash then aEntry.iDestinationNode is used. If aNodeSend is not connected at the moment, request is simply ignored.

◆ nodeConnectionAttemptStatus

void NetworkRequestExecutor::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

◆ processAdsClassified()

void NetworkRequestExecutor::processAdsClassified ( NetworkRequestQueueItem aEntry)
private

method for producing reply to request concerning a classified ad classification -> e.g. this method sends an listing of ads to remote node, the classification of the ads match hash given in entry

◆ processBinaryBlob()

void NetworkRequestExecutor::processBinaryBlob ( NetworkRequestQueueItem aEntry)
private

method for producing reply to request concerning a binary blob -> e.g. this method sends a binary blob

◆ processClassifiedAd()

void NetworkRequestExecutor::processClassifiedAd ( NetworkRequestQueueItem aEntry)
private

method for producing reply to request concerning a classified ad -> e.g. this method sends an ad to remote node

◆ processNodeGreeting()

void NetworkRequestExecutor::processNodeGreeting ( NetworkRequestQueueItem aEntry)
private

method for sending one or more node references to given node

◆ processPrivateMessage()

void NetworkRequestExecutor::processPrivateMessage ( NetworkRequestQueueItem aEntry)
private

method for producing reply to request concerning a private msg -> e.g. this method sends a private message

◆ processPrivateMessagesForProfile()

void NetworkRequestExecutor::processPrivateMessagesForProfile ( NetworkRequestQueueItem aEntry)
private

method for producing send queue items for every private message that the requesting profile has in queue.

◆ processRequestForBinaryBlob()

void NetworkRequestExecutor::processRequestForBinaryBlob ( NetworkRequestQueueItem aEntry)
private

method for requesting retrieval of a binary file

◆ processRequestForClassifiedAd()

void NetworkRequestExecutor::processRequestForClassifiedAd ( NetworkRequestQueueItem aEntry)
private

method for requesting retrieval of a binary file

◆ processRequestForContentPublish()

void NetworkRequestExecutor::processRequestForContentPublish ( NetworkRequestQueueItem entry)
private

method for publishing a profile+ad+binary file+profile comment + db record

◆ processRequestForNodesAroundHash()

void NetworkRequestExecutor::processRequestForNodesAroundHash ( NetworkRequestQueueItem entry)
private

method for sending nodegreeting around given hash. user initiates this and this sends around queries about nodes around given hash. the nodes that are sent the query are already-connected nodes

◆ processRequestForPrivateMessagePublish()

void NetworkRequestExecutor::processRequestForPrivateMessagePublish ( NetworkRequestQueueItem aEntry)
private

method for publishing a private message

◆ processRequestForProfilePoll()

void NetworkRequestExecutor::processRequestForProfilePoll ( NetworkRequestQueueItem aEntry)
private

method for requesting update of profile data and comments

◆ processRequestForUserProfile()

void NetworkRequestExecutor::processRequestForUserProfile ( NetworkRequestQueueItem aEntry)
private

method for requesting retrieval of a operator profile. so this means that some neighboring node sent us a request regarding a particular profile and this method then finds it from our local data store, or does not.

◆ processRequestForUserProfileComment()

void NetworkRequestExecutor::processRequestForUserProfileComment ( NetworkRequestQueueItem aEntry)
private

method for requesting retrieval of a comment of operator profile. this is called in situation where user wants to locally view a comment and it is not in local storage so we need to ask other nodes to send it to us.

◆ processUserProfile()

void NetworkRequestExecutor::processUserProfile ( NetworkRequestQueueItem aEntry)
private

method for producing reply to request concerning a user profile -> e.g. this method sends a profile to remote node

◆ processUserProfileComment()

void NetworkRequestExecutor::processUserProfileComment ( NetworkRequestQueueItem aEntry)
private

method for producing bytearray to send to other node containing single profile comment

◆ processUserProfileCommentsForProfile()

void NetworkRequestExecutor::processUserProfileCommentsForProfile ( NetworkRequestQueueItem entry)
private

method for producing reply to request concerning profile comments e.g. this method sends a profile comments whose commented profile matches the one given in the request

◆ run

void NetworkRequestExecutor::run ( )
slot

this class is no thread but lets try pretending..

◆ sendRequestToNodesAroundHash()

void NetworkRequestExecutor::sendRequestToNodesAroundHash ( NetworkRequestQueueItem aEntry,
bool  aUseContentHashNotDestination = false 
)
private

method for checking nodes around hash, sending request to those and if not already connected, adding those nodes to wishlist

Member Data Documentation

◆ iController

MController* NetworkRequestExecutor::iController
private

◆ iLastTimeOfNodeConnectedNodeStatusUpdate

time_t NetworkRequestExecutor::iLastTimeOfNodeConnectedNodeStatusUpdate
private

◆ iModel

Model& NetworkRequestExecutor::iModel
private

◆ iNowRunning

bool NetworkRequestExecutor::iNowRunning
private

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