◆ ShareUsageBase() [1/2]
FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.ShareUsageBase | ( | ILogger< ShareUsageBase > | logger, |
HttpClient | httpClient, | ||
double | sharePercentage, | ||
int | minimumEntriesPerMessage, | ||
int | maximumQueueSize, | ||
int | addTimeout, | ||
int | takeTimeout, | ||
int | repeatEvidenceIntervalMinutes, | ||
bool | trackSession, | ||
string | shareUsageUrl, | ||
List< string > | blockedHttpHeaders, | ||
List< string > | includedQueryStringParameters, | ||
List< KeyValuePair< string, string >> | ignoreDataEvidenceFilter, | ||
string | aspSessionCookieName = Engines.Constants.DEFAULT_ASP_COOKIE_NAME
|
||
) |
Constructor
- Parameters
-
- logger - The logger to use.
- httpClient - The HttpClient to use when sending request data.
- sharePercentage - The approximate proportion of requests to share. 1 = 100%, 0.5 = 50%, etc.
- minimumEntriesPerMessage - The minimum number of request entries per message sent to 51Degrees.
- maximumQueueSize - The maximum number of items to hold in the queue at one time. This must be larger than minimum entries.
- addTimeout - The timeout in milliseconds to allow when attempting to add an item to the queue. If this timeout is exceeded then usage sharing will be disabled.
- takeTimeout - The timeout in milliseconds to allow when attempting to take an item to the queue.
- repeatEvidenceIntervalMinutes - The interval (in minutes) which is used to decide if repeat evidence is old enough to consider a new session.
- trackSession - Set if the tracker should consider sessions in share usage.
- shareUsageUrl - The URL to send data to
- blockedHttpHeaders - A list of the names of the HTTP headers that share usage should not send to 51Degrees.
- includedQueryStringParameters - A list of the names of query string parameters that share usage should send to 51Degrees.
- ignoreDataEvidenceFilter -
- aspSessionCookieName - The name of the cookie that contains the asp.net session id.
◆ ShareUsageBase() [2/2]
FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.ShareUsageBase ( ILogger< ShareUsageBase > logger, HttpClient httpClient, double sharePercentage, int minimumEntriesPerMessage, int maximumQueueSize, int addTimeout, int takeTimeout, int repeatEvidenceIntervalMinutes, bool trackSession, string shareUsageUrl, List< string > blockedHttpHeaders, List< string > includedQueryStringParameters, List< KeyValuePair< string, string >> ignoreDataEvidenceFilter, string aspSessionCookieName, ITracker tracker ) protectedConstructor
- Parameters
-
- logger - The logger to use.
- httpClient - HttpClient to use when sending request data.
- sharePercentage - The approximate proportion of requests to share. 1 = 100%, 0.5 = 50%, etc.
- minimumEntriesPerMessage - The minimum number of request entries per message sent to 51Degrees.
- maximumQueueSize - The maximum number of items to hold in the queue at one time. This must be larger than minimum entries.
- addTimeout - The timeout in milliseconds to allow when attempting to add an item to the queue. If this timeout is exceeded then usage sharing will be disabled.
- takeTimeout - The timeout in milliseconds to allow when attempting to take an item to the queue.
- repeatEvidenceIntervalMinutes - The interval (in minutes) which is used to decide if repeat evidence is old enough to consider a new session.
- trackSession - Set if the tracker should consider sessions in share usage.
- shareUsageUrl - The URL to send data to
- blockedHttpHeaders - A list of the names of the HTTP headers that share usage should not send to 51Degrees.
includedQueryStringParameters, List< KeyValuePair< string, string >> ignoreDataEvidenceFilter, string aspSessionCookieName, ITracker tracker )
protectedConstructor
- Parameters
-
- logger - The logger to use.
- httpClient - HttpClient to use when sending request data.
- sharePercentage - The approximate proportion of requests to share. 1 = 100%, 0.5 = 50%, etc.
- minimumEntriesPerMessage - The minimum number of request entries per message sent to 51Degrees.
- maximumQueueSize - The maximum number of items to hold in the queue at one time. This must be larger than minimum entries.
- addTimeout - The timeout in milliseconds to allow when attempting to add an item to the queue. If this timeout is exceeded then usage sharing will be disabled.
- takeTimeout - The timeout in milliseconds to allow when attempting to take an item to the queue.
- repeatEvidenceIntervalMinutes - The interval (in minutes) which is used to decide if repeat evidence is old enough to consider a new session.
- trackSession - Set if the tracker should consider sessions in share usage.
- shareUsageUrl - The URL to send data to
- blockedHttpHeaders - A list of the names of the HTTP headers that share usage should not send to 51Degrees.
- includedQueryStringParameters - A list of the names of query string parameters that share usage should send to 51Degrees.
- ignoreDataEvidenceFilter -
- aspSessionCookieName - The name of the cookie that contains the asp.net session id.
- tracker - The ITracker to use to determine if a given IFlowData instance should be shared or not.
- Exceptions
-
- ArgumentNullException - Thrown if certain arguments are null.
- ArgumentException - Thrown if certain argument values are invalid.
Member Function Documentation
◆ AddPipeline()
override void FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.AddPipeline ( IPipeline pipeline ) virtualAdd
- Parameters
-
- pipeline -
Reimplemented from FiftyOne.Pipeline.Core.FlowElements.FlowElementBase< IElementData, IElementPropertyMetaData >.
◆ BuildAndSendXml()
abstract void FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.BuildAndSendXml ( ) protected pure virtual◆ EncodeInvalidXMLChars()
string FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.EncodeInvalidXMLChars ( string text ) encodes any unusual characters into their hex representation
- Exceptions
-
- ArgumentNullException - Thrown if the supplied text is null
◆ ManagedResourcesCleanup()
override void FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.ManagedResourcesCleanup ( ) protected virtualSend any data which has built up locally and not yet been sent to the remote service.
Implements FiftyOne.Pipeline.Core.FlowElements.FlowElementBase< IElementData, IElementPropertyMetaData >.
◆ ProcessInternal()
override void FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.ProcessInternal ( IFlowData data ) protectedProcess the data
- Parameters
-
- data - The IFlowData instance that provides the evidence
- Exceptions
-
- ArgumentNullException - Thrown if the supplied data instance is null
◆ TrySendData()
void FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.TrySendData ( ) protectedAttempt to send the data to the remote service.
This only happens if there is not a task already running.
If any error occurs while sending the data, then usage sharing is stopped.
- Returns
◆ UnmanagedResourcesCleanup()
override void FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.UnmanagedResourcesCleanup ( ) protected virtualClean up any unmanaged resources.
Implements FiftyOne.Pipeline.Core.FlowElements.FlowElementBase< IElementData, IElementPropertyMetaData >.
◆ WriteData()
virtual void FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.WriteData ( XmlWriter writer, ShareUsageData data ) protected virtualVirtual method to be overridden in extending usage share elements.
Write the specified data using the specified writer.
- Parameters
-
- writer - The XmlWriter to use.
- data - The ShareUsageData to write.
- Exceptions
-
- ArgumentNullException - Thrown if the supplied arguments are null
◆ WriteDeviceData()
void FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.WriteDeviceData ( XmlWriter writer, ShareUsageData data ) protectedWrite the specified device data using the specified writer.
- Parameters
-
- writer - The XmlWriter to use.
- data - The ShareUsageData to write.
- Exceptions
-
- ArgumentNullException - Thrown if the supplied arguments are null
◆ WritePipelineInfo()
virtual void FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.WritePipelineInfo ( XmlWriter writer ) protected virtualVirtual method to write details about the pipeline.
- Exceptions
-
- ArgumentNullException - Thrown if the supplied writer is null
Member Data Documentation
◆ HttpClient
HttpClient FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.HttpClient => _httpClient protectedThe HttpClient to use when sending the data.
◆ ShareUsageUrl
string FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.ShareUsageUrl => ShareUsageUri.AbsoluteUri protectedThe base URL to send usage data to.
Property Documentation
◆ ElementDataKey
override string FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.ElementDataKey getThe data key for this element
◆ EvidenceCollection
BlockingCollection<ShareUsageData> FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.EvidenceCollection get protectedQueue used to store entries in memory prior to them being sent to 51Degrees.
◆ EvidenceKeyFilter
override IEvidenceKeyFilter FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.EvidenceKeyFilter getGet the evidence key filter for this element.
◆ IsCanceled
internal bool FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.IsCanceled = false get set protectedIndicates whether share usage has been canceled as a result of an error.
◆ MinEntriesPerMessage
int FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.MinEntriesPerMessage = Constants.SHARE_USAGE_DEFAULT_MIN_ENTRIES_PER_MESSAGE get protectedThe minimum number of request entries per message sent to 51Degrees.
◆ Properties
override IList<IElementPropertyMetaData> FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.Properties getGet a list of the meta-data relating to the properties that this flow element will populate.
For this share usage element, the list will always be empty as it does not populate any properties.
◆ ShareUsageUri
Uri FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.ShareUsageUri get protectedThe base URL to send usage data to.
◆ TakeTimeout
int FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.TakeTimeout get protectedTimeout to use when taking from the queue.
◆ WriterSettings
XmlWriterSettings FiftyOne.Pipeline.Engines.FiftyOne.FlowElements.ShareUsageBase.WriterSettings get protectedInitial value:= new XmlWriterSettings(){ConformanceLevel = ConformanceLevel.Document,Encoding = Encoding.UTF8,CheckCharacters = true,NewLineHandling = NewLineHandling.None,CloseOutput = true,}The settings to use when creating an XML payload to send to the usage sharing web service.