Example #1
0
        public void Write(WebEventBodyDocument webEventBodyDocument, string applicationId, IndexEventSplunkType indexEventSplunkType)
        {
            if (webEventBodyDocument == null)
            {
                throw new ArgumentNullException(nameof(webEventBodyDocument));
            }

            if (string.IsNullOrEmpty(applicationId))
            {
                throw new ArgumentNullException(nameof(applicationId));
            }

            BackgroundWebEventsQueue.Queue(IndexEventSplunkContractFactory
                                           .Create(webEventBodyDocument, applicationId, indexEventSplunkType));
        }
        public void WriteDocumentAsync(ITrafficLog trafficLog)
        {
            if (trafficLog == null)
            {
                throw new ArgumentNullException(nameof(trafficLog));
            }

            var webEventDocument = WebEventDocumentFactory.Create(trafficLog);

            if (webEventDocument == null)
            {
                throw new NullReferenceException(nameof(webEventDocument));
            }

            BackgroundWebEventsQueue.Queue(IndexEventSplunkContractFactory.Create(
                                               webEventDocument,
                                               trafficLog.ApplicationId,
                                               IndexEventSplunkType.WebEvent));
        }