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.json;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.velux.internal.bridge.common.BridgeCommunicationProtocol;
19 * <B>Common JSON-based bridge communication message scheme supported by the </B><I>Velux</I><B> bridge.</B>
21 * This bridge communication is an extension of the common
22 * {@link org.openhab.binding.velux.internal.bridge.common.BridgeCommunicationProtocol BridgeCommunicationProtocol}.
24 * Message semantic will be defined by the implementation of the separate message classes,
25 * which are defined within {@link org.openhab.binding.velux.internal.bridge.json.JsonBridgeAPI JsonBridgeAPI}.
27 * The implementations will define the information which to send query and receive answer
29 * {@link org.openhab.binding.velux.internal.bridge.VeluxBridgeProvider VeluxBridgeProvider}.
31 * (Methods in this interface for the appropriate interaction:
33 * <LI>{@link #getURL} to return the URL suffix for accessing the specific service access point.</LI>
34 * <LI>{@link #getObjectOfRequest} to return the request object for further JSON serialization.</LI>
35 * <LI>{@link #getClassOfResponse} to retrieve the class of the object of response message for further JSON
36 * deserialization.</LI>
37 * <LI>{@link #setResponse} for storing the response according to the desired class after JSON deserialization.</LI>
38 * <LI>{@link #getDeviceStatus} to retrieve the current device status.</LI>
39 * <LI>{@link #getErrors} to retrieve the current error status.</LI>
43 * @author Guenther Schreiner - Initial contribution.
46 interface JsonBridgeCommunicationProtocol extends BridgeCommunicationProtocol {
49 * Returning the URL suffix for accessing the specific service access point.
51 * @return <b>sapURL</b>
52 * as String which is to be combined with the bridge address.
57 * Returning the request object for further JSON serialization.
59 * @return <b>ObjectOfRequest</b>
62 Object getObjectOfRequest();
65 * Returning the class of the object of response message for further JSON deserialization.
67 * @return <b>ClassOfResponseObject</b>
68 * is the appropriate class Object.
70 Class<?> getClassOfResponse();
73 * Storing the response according to the desired class after JSON deserialization.
75 * @param response is the appropriate object of previously given class Object.
77 void setResponse(Object response);
80 * Returning the communication status included within the response message.
82 * @return <b>deviceStatus</b> as String describing the current status of the bridge.
84 String getDeviceStatus();
87 * Returning the communication status included within the response message.
89 * @return <b>errors</b> as String[] describing the status of the operation according to the request in depth.