2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.digitalstrom.internal.lib.serverconnection;
16 * The {@link HttpTransport} executes a request to the DigitalSTROM-Server.
18 * @author Michael Ochel - Initial contribution
19 * @author Matthias Siegele - Initial contribution
21 public interface HttpTransport {
24 * Executes a digitalSTROM-request through calling {@link #execute(String, int, int)} with default connection time
25 * out and read timeout.
27 * @param request to execute
30 String execute(String request);
33 * Executes a digitalSTROM-request.
35 * @param request to execute
36 * @param connectTimeout of execution
37 * @param readTimeout of execution
40 String execute(String request, int connectTimeout, int readTimeout);
43 * Executes a digitalSTROM test request and returns the HTTP-Code.
45 * @param testRequest to execute
48 int checkConnection(String testRequest);
51 * Returns the connection timeout for sensor data readings.
53 * @return sensor data connection timeout
55 int getSensordataConnectionTimeout();
58 * Returns the read timeout for sensor data readings.
60 * @return sensor data read timeout
62 int getSensordataReadTimeout();
65 * Saves the SSL-Certificate in a file at the given path.
68 * @return absolute path
70 String writePEMCertFile(String path);