aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/main/java/com/yahoo/vespa/config/GetConfigRequest.java
blob: 35b503416ce1e4e1227e85d8132f50ed656a5f93 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config;

import com.yahoo.vespa.config.protocol.DefContent;

import java.util.Optional;

/**
 * Interface for getConfig requests.
 * @author Ulf Lilleengen
 */
public interface GetConfigRequest {

    /**
     * Returns the ConfigKey for this request.
     *
     * @return the ConfigKey for this config request
     */
    ConfigKey<?> getConfigKey();

    /**
     * The def file contents in the request, or empty array if not sent/not supported
     *
     * @return the contents (payload) of the def schema
     */
    DefContent getDefContent();

    /**
     * Get Vespa version for this GetConfigRequest
     */
    Optional<com.yahoo.vespa.config.protocol.VespaVersion> getVespaVersion();

    /**
     * Whether or not the config can be retrieved from or stored in a cache.
     *
     * @return true if content should _not_ be cached, false if it should.
     */
    boolean noCache();

    /**
     * Returns the md5 of the config definition in the request.
     *
     * @return an md5 of config definition in request.
     */
    String getRequestDefMd5();

    /**
     * Returns the payload checksums from the config request.
     *
     * @return the payload checksums from request.
     */
    PayloadChecksums configPayloadChecksums();

}