]> git.basschouten.com Git - openhab-addons.git/blob
6528587551ee429b7ca7b4191dbf6bd096b5112e
[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.digitalstrom.internal.lib.serverconnection;
14
15 /**
16  * The {@link HttpTransport} executes a request to the DigitalSTROM-Server.
17  *
18  * @author Michael Ochel - Initial contribution
19  * @author Matthias Siegele - Initial contribution
20  */
21 public interface HttpTransport {
22
23     /**
24      * Executes a digitalSTROM-request through calling {@link #execute(String, int, int)} with default connection time
25      * out and read timeout.
26      *
27      * @param request to execute
28      * @return response
29      */
30     String execute(String request);
31
32     /**
33      * Executes a digitalSTROM-request.
34      *
35      * @param request to execute
36      * @param connectTimeout of execution
37      * @param readTimeout of execution
38      * @return response
39      */
40     String execute(String request, int connectTimeout, int readTimeout);
41
42     /**
43      * Executes a digitalSTROM test request and returns the HTTP-Code.
44      *
45      * @param testRequest to execute
46      * @return HTTP-Code
47      */
48     int checkConnection(String testRequest);
49
50     /**
51      * Returns the connection timeout for sensor data readings.
52      *
53      * @return sensor data connection timeout
54      */
55     int getSensordataConnectionTimeout();
56
57     /**
58      * Returns the read timeout for sensor data readings.
59      *
60      * @return sensor data read timeout
61      */
62     int getSensordataReadTimeout();
63
64     /**
65      * Saves the SSL-Certificate in a file at the given path.
66      *
67      * @param path to save
68      * @return absolute path
69      */
70     String writePEMCertFile(String path);
71 }