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.silvercrestwifisocket.internal.handler;
17 import org.openhab.binding.silvercrestwifisocket.internal.discovery.SilvercrestWifiSocketDiscoveryService;
18 import org.openhab.binding.silvercrestwifisocket.internal.entities.SilvercrestWifiSocketResponse;
19 import org.openhab.binding.silvercrestwifisocket.internal.runnable.SilvercrestWifiSocketUpdateReceiverRunnable;
20 import org.openhab.core.thing.Thing;
23 * The {@link SilvercrestWifiSocketMediator} is responsible for receiving all the UDP packets and route correctly to
26 * @author Jaime Vaz - Initial contribution
28 public interface SilvercrestWifiSocketMediator {
31 * This method is called by the {@link SilvercrestWifiSocketUpdateReceiverRunnable}, when one new message has been
34 * @param receivedMessage the {@link SilvercrestWifiSocketResponse} message.
36 void processReceivedPacket(final SilvercrestWifiSocketResponse receivedMessage);
39 * Registers a new {@link Thing} and the corresponding {@link SilvercrestWifiSocketHandler}.
41 * @param thing the {@link Thing}.
42 * @param handler the {@link SilvercrestWifiSocketHandler}.
44 void registerThingAndWifiSocketHandler(final Thing thing, final SilvercrestWifiSocketHandler handler);
47 * Unregisters a {@link SilvercrestWifiSocketHandler} by the corresponding {@link Thing}.
49 * @param thing the {@link Thing}.
51 void unregisterWifiSocketHandlerByThing(final Thing thing);
54 * Returns all the {@link Thing} registered.
56 * @return all the {@link Thing}.
58 Set<Thing> getAllThingsRegistred();
61 * Sets the discovery service to inform the when one new thing has been found.
63 * @param discoveryService the discovery service.
65 void setDiscoveryService(SilvercrestWifiSocketDiscoveryService discoveryService);