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.velux.internal.bridge;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.velux.internal.bridge.common.BridgeAPI;
18 import org.openhab.binding.velux.internal.bridge.common.BridgeCommunicationProtocol;
21 * This interface is implemented by classes that provide general communication with the Velux bridge.
26 * <LI>{@link VeluxBridgeProvider#bridgeCommunicate} for generic communication,</LI>
27 * <LI>{@link VeluxBridgeProvider#bridgeAPI} for access to all interaction/communication methods.</LI>
30 * @author Guenther Schreiner - Initial contribution
33 public interface VeluxBridgeProvider {
36 * Initializes a client/server communication towards <b>Velux</b> Bridge
37 * based on the Basic I/O interface {@link VeluxBridge} and parameters
38 * passed as arguments (see below) and provided by
39 * {@link org.openhab.binding.velux.internal.config.VeluxBridgeConfiguration}.
40 * This method automatically decides to invoke a login communication before the
41 * intended request if there has not been an authentication before.
43 * @param communication {@link BridgeCommunicationProtocol} describing the intended
44 * communication, that is request and response interactions as well as appropriate URL
46 * @return true if communication was successful, and false otherwise.
49 public boolean bridgeCommunicate(BridgeCommunicationProtocol communication);
52 * Returns the class {@link BridgeAPI} which summarizes all interfacing methods.
54 * @return <b>BridgeAPI</b>
55 * containing all API methods.
57 public @Nullable BridgeAPI bridgeAPI();