2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.mqtt.generic;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * Interface to keep track of the availability of device using an availability topic or messages received
20 * @author Jochen Klein - Initial contribution
23 public interface AvailabilityTracker {
26 * Adds an availability topic to determine the availability of a device.
28 * Availability topics are usually set by the device as LWT.
30 * @param availability_topic
31 * @param payload_available
32 * @param payload_not_available
34 public void addAvailabilityTopic(String availability_topic, String payload_available, String payload_not_available);
36 public void removeAvailabilityTopic(String availability_topic);
38 public void clearAllAvailabilityTopics();
41 * resets the indicator, if messages have been received.
43 * This is used to time out the availability of the device after some time without receiving a message.
45 public void resetMessageReceived();