PreEmptive Analytics .NET API  1.3
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Classes | Public Member Functions | Events | List of all members
PreEmptive.Analytics.Common.TransmitterThread Class Reference

Class that handles the transmission of messages. More...

Inherits PreEmptive.Analytics.Common.MessageQueueProcessor, and PreEmptive.Analytics.Common.IQueueTransmitter.

Public Member Functions

 TransmitterThread (AgentInfo info, IMessageDequeuer dequeuer, IFlowController flowController, IClientToolsProvider tools)
 Constructor for a TransmitterThread. More...
 
override void Start ()
 Begins the automatic processing of the message queue. (not blocking, creates it's own thread) More...
 
override void ProcessBatch (MessageBatch batch)
 Takes a MessageBatch and either attempts to send it or store it offline based on the settings of the IFlowController. More...
 
void FailTransmissionsNow ()
 Immediately interrupts all transmissions and causes them to fail. If OfflineStorage is disabled, all messages are at least sent to the XMLTransmitter, but assumed to have failed. More...
 
bool Transmit (MessageBatch batch)
 Attempts to send a MessageBatch to a server. More...
 
List< KeyValuePair< string,
string > > 
ConstructHeaders (MessageBatch batch)
 Creates the appropriate headers to be sent along with the message batch. More...
 
string GetUserAgent (AgentInfo agentInfo)
 Gets a formatted string based on the provided AgentInfo object. More...
 
override MessageBatch GetMessageBatch ()
 Creates a MessageBatch based on information in the TransmitterThread. More...
 
- Public Member Functions inherited from PreEmptive.Analytics.Common.MessageQueueProcessor
void ProcessQueue ()
 Signals that the queue processor should immediately stop waiting and process the queue If the queue is in the middle of being processed, then it will be processed once more afterwards with no delay If the queue is not yet running, it is processed on the current thread(ie, it blocks) More...
 
void ProcessQueueBatches ()
 Creates and sends a message batch based on what messages have been queued. More...
 
void Stop ()
 Halts the automatic processing of the message queue. More...
 
void ProcessQueueNow ()
 Processes the queue if the message queue processor is currently running. More...
 

Events

Action< MessageBatchTransmissionFailed
 Signals that there is a need to do offline storage. More...
 
- Events inherited from PreEmptive.Analytics.Common.IQueueTransmitter
Action< MessageBatchTransmissionFailed
 Signals that the transmission of this batch has failed (and will not be reattempted without intervention) More...
 

Additional Inherited Members

- Protected Member Functions inherited from PreEmptive.Analytics.Common.MessageQueueProcessor
 MessageQueueProcessor (IFlowController flowController, ILogger logger, IAsyncProvider asyncprovider)
 Constructor for the MessageQueueProcessor. More...
 
- Protected Attributes inherited from PreEmptive.Analytics.Common.MessageQueueProcessor
IFlowController flowController
 IFlowController that determines the behavior of the MessageQueueProcessor. More...
 
ILogger logger
 The Logger instance available for debug and error messages More...
 
IAsyncProvider AsyncProvider
 The asynchronous mechanism provider More...
 
- Properties inherited from PreEmptive.Analytics.Common.MessageQueueProcessor
bool Running [get, set]
 If the MessageQueueProcessor is currently running. More...
 
- Properties inherited from PreEmptive.Analytics.Common.IQueueProcessor
bool Running [get, set]
 If the MessageQueueProcessor is currently running. More...
 

Detailed Description

Class that handles the transmission of messages.

Constructor & Destructor Documentation

PreEmptive.Analytics.Common.TransmitterThread.TransmitterThread ( AgentInfo  info,
IMessageDequeuer  dequeuer,
IFlowController  flowController,
IClientToolsProvider  tools 
)

Constructor for a TransmitterThread.

Parameters
infoInformation about the implemented Client.
dequeuerThe IMessageDequeuer interface that provides the transmitter with messages
flowControllerThe IFlowController interface that defines TransmitterThread's behavior.
toolsThe client tools provider to be used. This provides Configuration and Logging capabilities

Member Function Documentation

List<KeyValuePair<string, string> > PreEmptive.Analytics.Common.TransmitterThread.ConstructHeaders ( MessageBatch  batch)

Creates the appropriate headers to be sent along with the message batch.

Parameters
batchThe message batch that will be sent.
Returns
The constructed headers.
void PreEmptive.Analytics.Common.TransmitterThread.FailTransmissionsNow ( )

Immediately interrupts all transmissions and causes them to fail. If OfflineStorage is disabled, all messages are at least sent to the XMLTransmitter, but assumed to have failed.

Implements PreEmptive.Analytics.Common.IQueueTransmitter.

override MessageBatch PreEmptive.Analytics.Common.TransmitterThread.GetMessageBatch ( )
virtual

Creates a MessageBatch based on information in the TransmitterThread.

Returns
The newly created MessageBatch.

Reimplemented from PreEmptive.Analytics.Common.MessageQueueProcessor.

string PreEmptive.Analytics.Common.TransmitterThread.GetUserAgent ( AgentInfo  agentInfo)

Gets a formatted string based on the provided AgentInfo object.

Parameters
agentInfoAn AgentInfo object.
Returns
The formatted string.
override void PreEmptive.Analytics.Common.TransmitterThread.ProcessBatch ( MessageBatch  batch)
virtual

Takes a MessageBatch and either attempts to send it or store it offline based on the settings of the IFlowController.

Parameters
batchThe MessageBatch to process.

Reimplemented from PreEmptive.Analytics.Common.MessageQueueProcessor.

override void PreEmptive.Analytics.Common.TransmitterThread.Start ( )
virtual

Begins the automatic processing of the message queue. (not blocking, creates it's own thread)

Reimplemented from PreEmptive.Analytics.Common.MessageQueueProcessor.

bool PreEmptive.Analytics.Common.TransmitterThread.Transmit ( MessageBatch  batch)

Attempts to send a MessageBatch to a server.

Parameters
batchThe MessageBatch to send.
Returns
If the send succeeded.

Implements PreEmptive.Analytics.Common.IQueueTransmitter.

Event Documentation

Action<MessageBatch> PreEmptive.Analytics.Common.TransmitterThread.TransmissionFailed

Signals that there is a need to do offline storage.


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