blob: 9ca5d41984359e8cfa1f41e615dd74847ec77efd (
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
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.provision;
import java.time.Instant;
import java.util.Optional;
/**
* Instances of this are used to keep track of (notify and query)
* which hosts are currently connected to the config system.
*
* @author bratseth
*/
public interface HostLivenessTracker {
/** Called each time a config request is received from a client */
void receivedRequestFrom(String hostname);
/**
* Returns the epoch timestamp of the last request received from the given hostname,
* or empty if there is no memory of this host making a request
*/
Optional<Instant> lastRequestFrom(String hostname);
}
|