]> git.basschouten.com Git - openhab-addons.git/blob
36ceb1ce2bf526789367e68ca105b2607de552f1
[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.gardena.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * The {@link GardenaSmartWebSocketListener} is called by the {@link GardenaSmartWebSocket} on new Events and if the
19  * {@link GardenaSmartWebSocket}
20  * closed the connection.
21  *
22  * @author Gerhard Riegler - Initial contribution
23  */
24 @NonNullByDefault
25 public interface GardenaSmartWebSocketListener {
26     /**
27      * This method is called, when the evenRunner stops abnormally (statuscode <> 1000).
28      */
29     void onWebSocketClose(String id);
30
31     /**
32      * This method is called when the Gardena websocket services throws an onError.
33      */
34     void onWebSocketError(String id);
35
36     /**
37      * This method is called, whenever a new event comes from the Gardena service.
38      *
39      * @param msg
40      */
41     void onWebSocketMessage(String msg);
42 }