]> git.basschouten.com Git - openhab-addons.git/blob
87dc91988a17c620f21211abc23c5c24aa9e1fd4
[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.innogysmarthome.internal.listener;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.innogysmarthome.internal.InnogyWebSocket;
17
18 /**
19  * The {@link EventListener} is called by the {@link InnogyWebSocket} on new Events and if the {@link InnogyWebSocket}
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 innogy service (like a device change for example).
29      *
30      * @param msg
31      */
32     void onEvent(String msg);
33
34     /**
35      * This method is called when the innogy websocket services throws an onError.
36      *
37      * @param cause
38      */
39     void onError(Throwable cause);
40
41     /**
42      * This method is called, when the evenRunner stops abnormally (statuscode <> 1000).
43      */
44     void connectionClosed();
45 }