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