aboutsummaryrefslogtreecommitdiffstats
path: root/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/LegacyJaxRsTimeouts.java
blob: 3f2139f6bf0a60550e5b03882eec095272395d4d (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
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;
    }
}