aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateRequests.java
blob: 810392bf34de0db9602d675c42ed7e1f2003441b (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.core;

import com.yahoo.vespa.clustercontroller.utils.staterestapi.requests.UnitStateRequest;

import java.util.List;

public class StateRequests {

    public static class Get extends StateRequests implements UnitStateRequest {
        private final List<String> path;
        private final int recursive;

        public Get(String req, int recursive) {
            path = req.isEmpty() ? List.of() : List.of(req.split("/"));
            this.recursive = recursive;
        }

        @Override
        public int getRecursiveLevels() {
            return recursive;
        }

        @Override
        public List<String> getUnitPath() {
            return path;
        }

    }

}