2 * Copyright (c) 2010-2020 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.NonNull;
16 import org.eclipse.jdt.annotation.NonNullByDefault;
17 import org.openhab.binding.mqtt.generic.ChannelStateUpdateListener;
18 import org.openhab.core.thing.ChannelUID;
19 import org.openhab.core.types.Command;
20 import org.openhab.core.types.State;
23 * A proxy class for {@link ChannelStateUpdateListener} forwarding everything to the real listener.
25 * This class is used to be able handle special cases like timeouts.
27 * @author Jochen Klein - Initial contribution
30 public abstract class ChannelStateUpdateListenerProxy implements ChannelStateUpdateListener {
32 private final ChannelStateUpdateListener original;
34 public ChannelStateUpdateListenerProxy(ChannelStateUpdateListener original) {
35 this.original = original;
39 public void updateChannelState(@NonNull ChannelUID channelUID, @NonNull State value) {
40 original.updateChannelState(channelUID, value);
44 public void postChannelCommand(@NonNull ChannelUID channelUID, @NonNull Command value) {
45 original.postChannelCommand(channelUID, value);
49 public void triggerChannel(@NonNull ChannelUID channelUID, @NonNull String eventPayload) {
50 original.triggerChannel(channelUID, eventPayload);