aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/MissingIdException.java
blob: 21229b4b3583099c5920bf32bbe3a0a33f9583f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.core.restapiv2;

import com.yahoo.vdslib.state.Node;
import com.yahoo.vespa.clustercontroller.utils.staterestapi.errors.MissingUnitException;

public class MissingIdException extends MissingUnitException {

    private static String[] createPath(String cluster, Node n) {
        String[] path = new String[3];
        path[0] = cluster;
        path[1] = n.getType().toString();
        path[2] = String.valueOf(n.getIndex());
        return path;
    }

    public MissingIdException(String cluster, Node n) {
        super(createPath(cluster, n), 2);
    }

}