]> git.basschouten.com Git - openhab-addons.git/blob
ae9496f7b53a8926343ce2639945b0f5ba7a3988
[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.velux.internal.bridge;
14
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;
19
20 /**
21  * This interface is implemented by classes that provide general communication with the Velux bridge.
22  * <P>
23  * Communication
24  * </P>
25  * <UL>
26  * <LI>{@link VeluxBridgeProvider#bridgeCommunicate} for generic communication,</LI>
27  * <LI>{@link VeluxBridgeProvider#bridgeAPI} for access to all interaction/communication methods.</LI>
28  * </UL>
29  *
30  * @author Guenther Schreiner - Initial contribution
31  */
32 @NonNullByDefault
33 public interface VeluxBridgeProvider {
34
35     /**
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.
42      *
43      * @param communication {@link BridgeCommunicationProtocol} describing the intended
44      *            communication, that is request and response interactions as well as appropriate URL
45      *            definition.
46      * @return true if communication was successful, and false otherwise.
47      */
48
49     boolean bridgeCommunicate(BridgeCommunicationProtocol communication);
50
51     /**
52      * Returns the class {@link BridgeAPI} which summarizes all interfacing methods.
53      *
54      * @return <b>BridgeAPI</b>
55      *         containing all API methods.
56      */
57     @Nullable
58     BridgeAPI bridgeAPI();
59 }