aboutsummaryrefslogtreecommitdiffstats
path: root/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ConfigServerLikeApplication.java
blob: 9ea340535bc02f3c27ab3179893a981a190fd073 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.service.duper;

import com.yahoo.component.Version;
import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.vespa.applicationmodel.InfrastructureApplication;
import com.yahoo.vespa.applicationmodel.ServiceType;

/**
 * Base class for config server and controller infrastructure applications.
 *
 * @author hakonhall
 */
public abstract class ConfigServerLikeApplication extends InfraApplication {
    protected ConfigServerLikeApplication(InfrastructureApplication application, ClusterSpec.Type clusterType, ServiceType serviceType) {
        super(application, clusterType, ClusterSpec.Id.from(application.applicationName()), serviceType, 19071);
    }

    @Override
    public ClusterSpec getClusterSpecWithVersion(Version version) {
        return ClusterSpec.request(getClusterSpecType(), getClusterSpecId())
                          .vespaVersion(version)
                          .stateful(true)
                          .exclusive(true)
                          .build();
    }

}