C# Class WebApiThrottle.ThrottlingMiddleware

Inheritance: Microsoft.Owin.OwinMiddleware
Mostrar archivo Open project: stefanprodan/WebApiThrottle

Public Methods

Method Description
Invoke ( IOwinContext context ) : System.Threading.Tasks.Task
ThrottlingMiddleware ( Microsoft.Owin.OwinMiddleware next ) : Microsoft.Owin

Initializes a new instance of the ThrottlingMiddleware class. By default, the QuotaExceededResponseCode property is set to 429 (Too Many Requests).

ThrottlingMiddleware ( Microsoft.Owin.OwinMiddleware next, WebApiThrottle.ThrottlePolicy policy, IPolicyRepository policyRepository, IThrottleRepository repository, IThrottleLogger logger, IIpAddressParser ipAddressParser ) : Microsoft.Owin

Initializes a new instance of the ThrottlingMiddleware class. Persists the policy object in cache using IPolicyRepository implementation. The policy object can be updated by ThrottleManager at runtime.

Protected Methods

Method Description
ComputeThrottleKey ( RequestIdentity requestIdentity, RateLimitPeriod period ) : string
SetIdentity ( IOwinRequest request ) : RequestIdentity

Method Details

ComputeThrottleKey() protected method

protected ComputeThrottleKey ( RequestIdentity requestIdentity, RateLimitPeriod period ) : string
requestIdentity RequestIdentity
period RateLimitPeriod
return string

Invoke() public method

public Invoke ( IOwinContext context ) : System.Threading.Tasks.Task
context IOwinContext
return System.Threading.Tasks.Task

SetIdentity() protected method

protected SetIdentity ( IOwinRequest request ) : RequestIdentity
request IOwinRequest
return RequestIdentity

ThrottlingMiddleware() public method

Initializes a new instance of the ThrottlingMiddleware class. By default, the QuotaExceededResponseCode property is set to 429 (Too Many Requests).
public ThrottlingMiddleware ( Microsoft.Owin.OwinMiddleware next ) : Microsoft.Owin
next Microsoft.Owin.OwinMiddleware
return Microsoft.Owin

ThrottlingMiddleware() public method

Initializes a new instance of the ThrottlingMiddleware class. Persists the policy object in cache using IPolicyRepository implementation. The policy object can be updated by ThrottleManager at runtime.
public ThrottlingMiddleware ( Microsoft.Owin.OwinMiddleware next, WebApiThrottle.ThrottlePolicy policy, IPolicyRepository policyRepository, IThrottleRepository repository, IThrottleLogger logger, IIpAddressParser ipAddressParser ) : Microsoft.Owin
next Microsoft.Owin.OwinMiddleware
policy WebApiThrottle.ThrottlePolicy /// The policy. ///
policyRepository IPolicyRepository /// The policy repository. ///
repository IThrottleRepository /// The repository. ///
logger IThrottleLogger /// The logger. ///
ipAddressParser IIpAddressParser /// The IpAddressParser ///
return Microsoft.Owin