コード例 #1
0
        public Dictionary <string, object> getConfiguration()
        {
            log.Debug("Entering  getConfiguration");
            log.Debug("Get Configuration " + CollectorConstants.getBeaconURL());
            log.Debug("Get Configuration " + CollectorConstants.getClientName());
            log.Debug("Get Configuration " + CollectorConstants.getProjectName());
            log.Debug("Get Configuration " + CollectorConstants.getScenarioName());
            String url = CollectorConstants.getBeaconURL() + "/getConfig?ClientName=" + CollectorConstants.getClientName() + "&ProjectName=" + CollectorConstants.getProjectName() + "&Scenario=" + CollectorConstants.getScenarioName() + "&updateRunID=true";

            if (CollectorConstants.getLoadTest().Equals("true"))
            {
                url = url + "&isLoadTest=true";
            }
            //Map<String, Object> result = new HashMap<String, Object>();
            //result = HttpUtils.callService(url,"GET",null,ConfigurationLoader.getApiToken());
            try
            {
                Dictionary <String, Object> results = HTTPUtils.callService(url, "GET", null, CollectorConstants.getApiToken());
                Dictionary <String, Object> jsonObj = JSONUtils.JsonStringToMap(results["response"].ToString());
                return(jsonObj);
            }
            catch (Exception e)
            {
                log.Error("Exception in parsing configuration : {}", e);
                return(null);
            }
        }