aboutsummaryrefslogtreecommitdiffstats
path: root/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/LegacyJaxRsTimeouts.java
blob: 9f97f71987e308bd015fdd69b07503fcc464674a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.jaxrs.client;

import java.time.Duration;

/**
 * Legacy defaults for timeouts.
 *
 * Clients should instead define their own JaxRsTimeouts tailored to their use-case.
 *
 * @author hakonhall
 */
// Immutable
public class LegacyJaxRsTimeouts implements JaxRsTimeouts {
    private static final Duration CONNECT_TIMEOUT = Duration.ofSeconds(30);
    private static final Duration READ_TIMEOUT = Duration.ofSeconds(30);

    @Override
    public Duration getConnectTimeoutOrThrow() {
        return CONNECT_TIMEOUT;
    }

    @Override
    public Duration getReadTimeoutOrThrow() {
        return READ_TIMEOUT;
    }
}