dev.fitko.fitconnect.api.config.http.Timeouts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client Show documentation
Show all versions of client Show documentation
Library that provides client access to the FIT-Connect api-endpoints for sending, subscribing and
routing
The newest version!
package dev.fitko.fitconnect.api.config.http;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import java.time.Duration;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Timeouts {
public static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(30);
/**
* Read Timeout in seconds. Value 0 means no timeout at all.
*/
@Builder.Default
private int readTimeout = DEFAULT_TIMEOUT.toSecondsPart();
/**
* Write Timeout in seconds. Value 0 means no timeout at all.
*/
@Builder.Default
private int writeTimeout = DEFAULT_TIMEOUT.toSecondsPart();
/**
* Connection Timeout in seconds. Value 0 means no timeout at all.
*/
@Builder.Default
private int connectionTimeout = DEFAULT_TIMEOUT.toSecondsPart();
public Duration getReadTimeoutInSeconds() {
return Duration.ofSeconds(readTimeout);
}
public Duration getWriteTimeoutInSeconds() {
return Duration.ofSeconds(writeTimeout);
}
public Duration getConnectionTimeoutInSeconds() {
return Duration.ofSeconds(connectionTimeout);
}
}