Example #1
0
        public static SendMessageHeaders FromDictionary(IDictionary <string, string> dict)
        {
            var headers = new SendMessageHeaders();

            headers.Domain           = dict.GetOrDefault(nameof(headers.Domain));
            headers.ComputerName     = dict.GetOrDefault(nameof(headers.ComputerName));
            headers.DbToken          = dict.GetOrDefault(nameof(headers.DbToken));
            headers.ConfigToken      = dict.GetOrDefault(nameof(headers.ConfigToken));
            headers.OrganizationUnit = dict.GetOrDefault(nameof(headers.OrganizationUnit));
            headers.ConfigVersion    = dict.GetOrDefault(nameof(headers.ConfigVersion), int.Parse);
            headers.Attempt          = dict.GetOrDefault(nameof(headers.Attempt), int.Parse);
            headers.Hints            = dict.GetOrDefault(nameof(headers.Attempt), GetHints);

            return(headers);
        }
Example #2
0
        public SendMessageHeaders GetSendMessageHeaders(SendIterationContext context)
        {
            var info = agentInfoService.Get();

            var headers = new SendMessageHeaders
            {
                Domain           = info.Domain,
                ComputerName     = info.ComputerName,
                DbToken          = info.DbToken,
                ConfigToken      = info.ConfigToken,
                ConfigVersion    = info.ConfigVersion,
                OrganizationUnit = info.OrganizationUnit,
                Attempt          = context.Attempt,
                Format           = TransportConstants.RequestFormDataFormat,
                Hints            = new[] { MessageHints.OrderedFormData },
            };

            return(headers);
        }
Example #3
0
 protected virtual string GetUri(SendMessageHeaders headers)
 {
     return(QueryHelpers.AddQueryString(url, headers.ToDictionary()));
 }