]> git.basschouten.com Git - openhab-addons.git/blob
20d08c370f6f15c537c5ab9458dd9f084c719b49
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.livisismarthome.internal.listener;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * The {@link EventListener} is called by the {@link org.openhab.binding.livisismarthome.internal.LivisiWebSocket} on
19  * new Events and if the {@link org.openhab.binding.livisismarthome.internal.LivisiWebSocket}
20  * closed the connection.
21  *
22  * @author Oliver Kuhl - Initial contribution
23  */
24 @NonNullByDefault
25 public interface EventListener {
26
27     /**
28      * This method is called, whenever a new event comes from the LIVISI SmartHome service (like a device change for
29      * example).
30      *
31      * @param msg message
32      */
33     void onEvent(String msg);
34
35     /**
36      * This method is called when the LIVISI SmartHome websocket services throws an onError.
37      *
38      * @param cause cause / throwable
39      */
40     void onError(Throwable cause);
41
42     /**
43      * This method is called, when the evenRunner stops abnormally (statuscode <> 1000).
44      */
45     void connectionClosed();
46 }