blob: c9301f9049c97068944afb16f554bb0c0e415a6a (
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
|
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 {
/** Returns the instant after which this remembers all requests */
Instant remembersRequestsSince();
/** 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);
}
|