2 * Copyright (c) 2010-2023 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.homeassistant.internal.listener;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.mqtt.generic.ChannelStateUpdateListener;
17 import org.openhab.core.thing.ChannelUID;
18 import org.openhab.core.types.Command;
19 import org.openhab.core.types.State;
22 * A proxy class for {@link ChannelStateUpdateListener} forwarding everything to the real listener.
24 * This class is used to be able handle special cases like timeouts.
26 * @author Jochen Klein - Initial contribution
29 public abstract class ChannelStateUpdateListenerProxy implements ChannelStateUpdateListener {
31 private final ChannelStateUpdateListener original;
33 public ChannelStateUpdateListenerProxy(ChannelStateUpdateListener original) {
34 this.original = original;
38 public void updateChannelState(ChannelUID channelUID, State value) {
39 original.updateChannelState(channelUID, value);
43 public void postChannelCommand(ChannelUID channelUID, Command value) {
44 original.postChannelCommand(channelUID, value);
48 public void triggerChannel(ChannelUID channelUID, String eventPayload) {
49 original.triggerChannel(channelUID, eventPayload);