aboutsummaryrefslogtreecommitdiffstats
path: root/config-provisioning/src/main/java/com/yahoo/config/provision/HostEvent.java
blob: 7942d421162ca3f130960423294f96afefed922e (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.provision;

import java.util.Objects;

/**
 * A maintenance event for a host.
 *
 * @author mpolden
 */
public class HostEvent {

    private final String id;
    private final String hostId;
    private final String description;

    public HostEvent(String id, String hostId, String description) {
        this.id = Objects.requireNonNull(id);
        this.hostId = Objects.requireNonNull(hostId);
        this.description = Objects.requireNonNull(description);
    }

    /** ID of the event */
    public String id() {
        return id;
    }

    /** ID of the host affected by this event, i.e. instance ID */
    public String hostId() {
        return hostId;
    }

    /** Human-readable description of the event */
    public String description() {
        return description;
    }

    @Override
    public String toString() {
        return "event " + id + " affecting host " + hostId + ": '" + description + "'";
    }

}