aboutsummaryrefslogtreecommitdiffstats
path: root/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/ConfigResponseFactory.java
blob: 1abc4393c55eb5f77e74ac85bee2b97780d1f756 (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
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.rpc;

import com.yahoo.config.codegen.InnerCNode;
import com.yahoo.vespa.config.ConfigPayload;
import com.yahoo.vespa.config.protocol.ConfigResponse;

/**
 * Represents a component that creates config responses from a payload. Different implementations
 * can do transformations of the payload such as compression.
 *
 * @author lulf
 * @since 5.19
 */
public interface ConfigResponseFactory {

    /**
     * Create a {@link ConfigResponse} for a given payload and generation.
     * @param payload The {@link com.yahoo.vespa.config.ConfigPayload} to put in the response.
     * @param defFile The {@link com.yahoo.config.codegen.InnerCNode} def file for this config.
     * @param generation The payload generation.  @return A {@link ConfigResponse} that can be sent to the client.
     */
    ConfigResponse createResponse(ConfigPayload payload, InnerCNode defFile, long generation);

}