aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/vespa/model/test/ApiService.java
blob: 6abc13ad86cf4a3b91610bb201f5e132d9ba70f9 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.test;

import com.yahoo.config.model.producer.TreeConfigProducer;
import com.yahoo.vespa.model.AbstractService;
import com.yahoo.vespa.model.PortAllocBridge;

/**
 * This is a service for testing the plugin exchange mechanism in the
 * vespamodel. It provides some data that are made public in the API
 * of the plugin that owns it.
 *
 * @author  gjoranv
 */
public class ApiService extends AbstractService implements com.yahoo.test.StandardConfig.Producer {

    private int numSimpleServices = 0;

    /**
     * Creates a new ApiService instance
     *
     * @param parent   The parent ConfigProducer.
     * @param name     Service name
     */
    public ApiService(TreeConfigProducer<?> parent, String name) {
        super(parent, name);
    }

    public void getConfig(com.yahoo.test.StandardConfig.Builder builder) {
        builder.astring("apiservice");
        
    }
    
    public void setNumSimpleServices(int nss) {
        numSimpleServices = nss;
    }

    public int getPortCount() { return 0; }

    @Override public void allocatePorts(int start, PortAllocBridge from) { }
}