Package org.apache.cxf.throttling
Class ThrottleResponse
- java.lang.Object
-
- org.apache.cxf.throttling.ThrottleResponse
-
- Direct Known Subclasses:
SimpleThrottlingManager
public class ThrottleResponse extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected longdelayprotected StringerrorMessageprotected intresponseCodeprotected Map<String,String>responseHeaders
-
Constructor Summary
Constructors Constructor Description ThrottleResponse()ThrottleResponse(int responceCode)ThrottleResponse(int responceCode, long delay)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThrottleResponseaddResponseHeader(String header, String value)Add headers to the response.longgetDelay()Delay processing for specified milliseconds.StringgetErrorMessage()intgetResponseCode()Map<String,String>getResponseHeaders()ThrottleResponsesetDelay(long d)ThrottleResponsesetResponseCode(int rc)ThrottleResponsesetResponseCode(int rc, String msg)
-
-
-
Method Detail
-
addResponseHeader
public ThrottleResponse addResponseHeader(String header, String value)
Add headers to the response. Typically, this would be things like X-RateLimit-Limit headers- Returns:
-
getResponseCode
public int getResponseCode()
-
getErrorMessage
public String getErrorMessage()
-
setResponseCode
public ThrottleResponse setResponseCode(int rc)
-
setResponseCode
public ThrottleResponse setResponseCode(int rc, String msg)
-
getDelay
public long getDelay()
Delay processing for specified milliseconds. Should be "small" to prevent the client from timing out unless the client request is aborted with the HTTP error code.- Returns:
-
setDelay
public ThrottleResponse setDelay(long d)
-
-