Package com.xero.api
Class XeroRateLimitException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.xero.api.XeroException
-
- com.xero.api.XeroRateLimitException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
XeroAppMinuteRateLimitException,XeroDailyRateLimitException,XeroMinuteRateLimitException
public class XeroRateLimitException extends XeroException
Base application exception all other rate limit Xero exceptions should extend- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetAppLimitRemaining()get remaining app limitIntegergetDayLimitRemaining()get remaining daily limitStringgetMessage()get messageIntegergetMinuteLimitRemaining()get remaining minute limitlonggetRetryAfterSeconds()get retry after secondsintgetStatusCode()get Status Code-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
XeroRateLimitException
public XeroRateLimitException(int statusCode, Integer appLimitRemaining, Integer dayLimitRemaining, Integer minuteLimitRemaining, Long retryAfterSeconds, String message, Exception e)Init XeroRateLimitException- Parameters:
statusCode- int the server status code returned.appLimitRemaining- Integer the number of calls remaining for app limitdayLimitRemaining- Integer the number of calls in a 24 hour rolling window remain for an orgminuteLimitRemaining- Integer the number of calls in a 60 second rolling window remain for an orgretryAfterSeconds- Long the number of seconds to wait before resuming API callsmessage- String the message pertaining to the rate limite- Exception object with details about the original exception
-
-
Method Detail
-
getStatusCode
public int getStatusCode()
get Status Code- Returns:
- int with server status code.
-
getMessage
public String getMessage()
get message- Overrides:
getMessagein classThrowable- Returns:
- Sting with the message pertaining to the rate limit
-
getAppLimitRemaining
public Integer getAppLimitRemaining()
get remaining app limit- Returns:
- Integer the number of calls remaining for app limit
-
getDayLimitRemaining
public Integer getDayLimitRemaining()
get remaining daily limit- Returns:
- Integer the number of calls in a 24 hour rolling window remain for an org
-
getMinuteLimitRemaining
public Integer getMinuteLimitRemaining()
get remaining minute limit- Returns:
- Integer the number of calls in a 60 second rolling window remain for an org
-
getRetryAfterSeconds
public long getRetryAfterSeconds()
get retry after seconds- Returns:
- Long the number of seconds to wait before resuming API calls
-
-