Esempio n. 1
0
        public static GetSeriesKeysResponse CallGetSeriesKeys(GetSeriesKeysRequest request)
        {
            var response = new GetSeriesKeysResponse();

            try
            {
                var tssFactory = TimeseriesSourceFactory.Factory;

                response.Responsemetadata.Add(request.Requestmetadata);

                foreach (var sourcename in request.Sourcenames)
                {
                    var d = new Dictionary <string, string>();
                    foreach (var kv in request.Filters)
                    {
                        d[kv.Key] = kv.Value;
                    }

                    response.Keys.AddRange(
                        tssFactory[sourcename].GetSeriesKeys(d).Select(
                            t => new SourceSeriesKey()
                    {
                        Seriesname = t.Key, Sourcename = sourcename
                    }));
                }
            }
            catch (Exception ex)
            {
                IOCContainer.Logger.Error(ex.Message);
                throw;
            }

            IOCContainer.Logger.Info($"GetSeriesKeyResponse: {response.Keys.Count} series found");
            return(response);
        }
Esempio n. 2
0
            public static void ShowResponse(GetSeriesKeysResponse response)
            {
                var i = 0;

                Console.WriteLine($"GetSeriesKeysClientHandler");
                foreach (var ts in response.Keys)
                {
                    Console.WriteLine($"Sourcename[{i}]: {ts.Sourcename}/{ts.Seriesname}");
                    i++;
                }
            }