All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.fitko.fitconnect.api.config.http.Timeouts Maven / Gradle / Ivy

Go to download

Library that provides client access to the FIT-Connect api-endpoints for sending, subscribing and routing

There is a newer version: 2.3.5
Show 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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy