private Duration checkClaimTimeout(final long timeoutInSeconds) { // check if the timeout is smaller than the maximum possible claim-timeout and > 0: if ((timeoutInSeconds < 0) || (timeoutInSeconds > maxClaimTimeout.getSeconds())) { throw new TimeoutInvalidException(timeoutInSeconds, maxClaimTimeout.getSeconds()); } else { return Duration.ofSeconds(timeoutInSeconds); } }
private Duration checkMessageTimeout(final long timeoutInSeconds) { // check if the timeout is smaller than the maximum possible message-timeout and > 0: if ((timeoutInSeconds < 0) || (timeoutInSeconds > maxMessageTimeout.getSeconds())) { throw new TimeoutInvalidException(timeoutInSeconds, maxMessageTimeout.getSeconds()); } else { return Duration.ofSeconds(timeoutInSeconds); } }
@Override protected TimeoutInvalidException doBuild(final DittoHeaders dittoHeaders, @Nullable final String message, @Nullable final String description, @Nullable final Throwable cause, @Nullable final URI href) { return new TimeoutInvalidException(dittoHeaders, message, description, cause, href); }