C# 클래스 WebApiThrottle.ThrottlingHandler

상속: System.Net.Http.DelegatingHandler
파일 보기 프로젝트 열기: stefanprodan/WebApiThrottle

공개 메소드들

메소드 설명
ThrottlingHandler ( ) : System

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

ThrottlingHandler ( WebApiThrottle.ThrottlePolicy policy, IPolicyRepository policyRepository, IThrottleRepository repository, IThrottleLogger logger, IIpAddressParser ipAddressParser = null ) : System

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

보호된 메소드들

메소드 설명
ComputeThrottleKey ( RequestIdentity requestIdentity, RateLimitPeriod period ) : string
GetClientIp ( HttpRequestMessage request ) : IPAddress
QuotaExceededResponse ( HttpRequestMessage request, object content, HttpStatusCode responseCode, string retryAfter ) : Task
SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task
SetIdentity ( HttpRequestMessage request ) : RequestIdentity

메소드 상세

ComputeThrottleKey() 보호된 메소드

protected ComputeThrottleKey ( RequestIdentity requestIdentity, RateLimitPeriod period ) : string
requestIdentity RequestIdentity
period RateLimitPeriod
리턴 string

GetClientIp() 보호된 메소드

protected GetClientIp ( HttpRequestMessage request ) : IPAddress
request System.Net.Http.HttpRequestMessage
리턴 System.Net.IPAddress

QuotaExceededResponse() 보호된 메소드

protected QuotaExceededResponse ( HttpRequestMessage request, object content, HttpStatusCode responseCode, string retryAfter ) : Task
request System.Net.Http.HttpRequestMessage
content object
responseCode HttpStatusCode
retryAfter string
리턴 Task

SendAsync() 보호된 메소드

protected SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task
request System.Net.Http.HttpRequestMessage
cancellationToken System.Threading.CancellationToken
리턴 Task

SetIdentity() 보호된 메소드

protected SetIdentity ( HttpRequestMessage request ) : RequestIdentity
request System.Net.Http.HttpRequestMessage
리턴 RequestIdentity

ThrottlingHandler() 공개 메소드

Initializes a new instance of the ThrottlingHandler class. By default, the QuotaExceededResponseCode property is set to 429 (Too Many Requests).
public ThrottlingHandler ( ) : System
리턴 System

ThrottlingHandler() 공개 메소드

Initializes a new instance of the ThrottlingHandler class. Persists the policy object in cache using IPolicyRepository implementation. The policy object can be updated by ThrottleManager at runtime.
public ThrottlingHandler ( WebApiThrottle.ThrottlePolicy policy, IPolicyRepository policyRepository, IThrottleRepository repository, IThrottleLogger logger, IIpAddressParser ipAddressParser = null ) : System
policy WebApiThrottle.ThrottlePolicy /// The policy. ///
policyRepository IPolicyRepository /// The policy repository. ///
repository IThrottleRepository /// The repository. ///
logger IThrottleLogger /// The logger. ///
ipAddressParser IIpAddressParser /// The IpAddressParser ///
리턴 System