aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/ConfigProducerRoot.java
blob: c686f22392ab5e652c1eaf27410df065dc266592 (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
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model;

import com.yahoo.config.ConfigInstance;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.config.model.producer.AbstractConfigProducer;
import com.yahoo.vespa.model.admin.Admin;
import com.yahoo.vespa.model.filedistribution.FileDistributor;

import java.util.Set;


/**
 * Intended to be used as an external interface to the vespa model root.
 *
 * @author Tony Vaagenes
 */
public interface ConfigProducerRoot extends ConfigProducer {

    /**
     * Adds the given producer (at any depth level) as descendant to this root nodes.
     *
     * @param id string id of descendant
     * @param descendant the producer to add to this root node
     */
    void addDescendant(String id, AbstractConfigProducer descendant);

    /**
     * @return an unmodifiable copy of the set of configIds in this root.
     */
    Set<String> getConfigIds();

    ConfigInstance.Builder getConfig(ConfigInstance.Builder builder, String configId);

    /**
     * Resolves config of the given type and config id.
     * @param clazz The type of config
     * @param configId The config id
     * @return A config instance of the given type
     */
    public <CONFIGTYPE extends ConfigInstance> CONFIGTYPE getConfig(Class<CONFIGTYPE> clazz, String configId);
    
    /**
     * Get the global deploy state of this model.
     */
    DeployState getDeployState();

    FileDistributor getFileDistributor();

    Admin getAdmin();

}