Exemple #1
0
        private bool ParseIncludeGatewayHealthCheck(IPluginRequest request)
        {
            bool includeGatewayHealthChecksValue = false;

            if (request.ContainsRequestArgument(IncludeGatewayHealthChecksPluginArgumentKey))
            {
                try
                {
                    includeGatewayHealthChecksValue = PluginArgumentHelper.GetAsBoolean(IncludeGatewayHealthChecksPluginArgumentKey, request);
                }
                catch (FormatException)
                {
                    Log.WarnFormat("Invalid value was specified for plugin argument key '{0}': valid values are either 'true' or 'false'.  Proceeding with default value of '{1}'..", IncludeGatewayHealthChecksPluginArgumentKey, includeGatewayHealthChecksValue);
                }
            }

            // Log results.
            if (includeGatewayHealthChecksValue)
            {
                Log.Info("Including gateway health check requests due to user request.");
            }
            else
            {
                Log.InfoFormat("Excluding gateway health check requests from plugin output.  Use the plugin argument '{0}:true' if you wish to include them.", IncludeGatewayHealthChecksPluginArgumentKey);
            }

            return(includeGatewayHealthChecksValue);
        }
Exemple #2
0
        protected void HandlePluginRequestArguments(IPluginRequest pluginRequest)
        {
            if (pluginRequest.ContainsRequestArgument(IncludeGatewayHealthChecksPluginArgumentKey))
            {
                try
                {
                    includeGatewayHealthCheckRequests = PluginArgumentHelper.GetAsBoolean(IncludeGatewayHealthChecksPluginArgumentKey, pluginRequest);
                }
                catch (FormatException)
                {
                    Log.WarnFormat("Invalid value was specified for plugin argument key '{0}': valid values are either 'true' or 'false'.  Proceeding with default value of '{1}'..",
                                   IncludeGatewayHealthChecksPluginArgumentKey, includeGatewayHealthCheckRequests.ToString().ToLowerInvariant());
                }
            }

            // Log results.
            if (includeGatewayHealthCheckRequests)
            {
                Log.Info("Including gateway health check requests due to user request.");
            }
            else
            {
                Log.InfoFormat("Excluding gateway health check requests from plugin output.  Use the plugin argument '{0}:true' if you wish to include them.", IncludeGatewayHealthChecksPluginArgumentKey);
            }
        }
Exemple #3
0
        public static int GetMaxQueryLength(IPluginRequest pluginRequest, string maxQueryLengthArgumentKey, int defaultIfNotFound)
        {
            if (pluginRequest.ContainsRequestArgument(maxQueryLengthArgumentKey))
            {
                try
                {
                    return(PluginArgumentHelper.GetAsInt(maxQueryLengthArgumentKey, pluginRequest));
                }
                catch (FormatException)
                {
                    return(defaultIfNotFound);
                }
            }

            return(defaultIfNotFound);
        }