aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/EndpointStatus.java
blob: 4b326bc7430202e797341133e7e628d7c140e36a (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.application.v4.model;

import java.time.Instant;
import java.util.Objects;

/**
 * Represent the routing status for all endpoints of a deployment.
 *
 * @author smorgrav
 */
public class EndpointStatus {

    private final String agent;
    private final Status status;
    private final Instant changedAt;

    public EndpointStatus(Status status, String agent, Instant changedAt) {
        this.status = Objects.requireNonNull(status);
        this.agent = Objects.requireNonNull(agent);
        this.changedAt = Objects.requireNonNull(changedAt);
    }

    /** Returns the agent responsible setting this status */
    public String agent() {
        return agent;
    }

    /** Returns the current status */
    public Status status() {
        return status;
    }

    /** Returns when this was last changed */
    public Instant changedAt() {
        return changedAt;
    }

    public enum Status {
        in,
        out,
        unknown;
    }

}