]> git.basschouten.com Git - openhab-addons.git/blob
3f52de28bc005277264fde65c72fd225c816733e
[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.nibeheatpump.internal.connection;
14
15 import org.openhab.binding.nibeheatpump.internal.NibeHeatPumpException;
16 import org.openhab.binding.nibeheatpump.internal.config.NibeHeatPumpConfiguration;
17 import org.openhab.binding.nibeheatpump.internal.message.NibeHeatPumpMessage;
18
19 /**
20  * Define interface to communicate Nibe heat pumps.
21  *
22  * @author Pauli Anttila - Initial contribution
23  */
24 public interface NibeHeatPumpConnector {
25
26     /**
27      * Procedure for connect to heat pump.
28      *
29      * @param configuration
30      *            Configuration parameters for connector.
31      *
32      * @throws NibeHeatPumpException
33      */
34     void connect(NibeHeatPumpConfiguration configuration) throws NibeHeatPumpException;
35
36     /**
37      * Procedure for disconnect from heat pump.
38      */
39     void disconnect();
40
41     /**
42      * Procedure for register event listener.
43      *
44      * @param listener
45      *            Event listener instance to handle events.
46      */
47     void addEventListener(NibeHeatPumpEventListener listener);
48
49     /**
50      * Procedure for remove event listener.
51      *
52      * @param listener
53      *            Event listener instance to remove.
54      */
55     void removeEventListener(NibeHeatPumpEventListener listener);
56
57     /**
58      * Procedure for sending datagram to heat pump.
59      *
60      * @throws NibeHeatPumpException
61      */
62     void sendDatagram(NibeHeatPumpMessage msg) throws NibeHeatPumpException;
63
64     /**
65      * Procedure to check if connector is currently connected to heat pump.
66      *
67      * @return true, if connected
68      */
69     boolean isConnected();
70 }