]> git.basschouten.com Git - openhab-addons.git/blob
6dda7a585791e52f129d5a92dcf697ff2125852b
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.regoheatpump.internal.protocol;
14
15 import java.io.IOException;
16 import java.io.InputStream;
17 import java.io.OutputStream;
18
19 /**
20  * The {@link RegoConnection} is responsible for creating connections to clients.
21  *
22  * @author Boris Krivonog - Initial contribution
23  */
24 public interface RegoConnection {
25     /**
26      * Connect to the receiver. Return true if the connection has succeeded or if already connected.
27      *
28      **/
29     public void connect() throws IOException;
30
31     /**
32      * Return true if this manager is connected to the AVR.
33      *
34      * @return
35      */
36     public boolean isConnected();
37
38     /**
39      * Closes the connection.
40      **/
41     public void close();
42
43     /**
44      * Returns an output stream for this connection.
45      */
46     public OutputStream outputStream() throws IOException;
47
48     /**
49      * Returns an input stream for this connection.
50      */
51     public InputStream inputStream() throws IOException;
52 }