]> git.basschouten.com Git - openhab-addons.git/blob
c7e6d9893eae861ec28dacb8e4f842989838ccf7
[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.tradfri.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.thing.ThingStatus;
17 import org.openhab.core.thing.ThingStatusDetail;
18
19 import com.google.gson.JsonElement;
20
21 /**
22  * The {@link CoapCallback} is receives coap response data asynchronously.
23  *
24  * @author Kai Kreuzer - Initial contribution
25  */
26 @NonNullByDefault
27 public interface CoapCallback {
28
29     /**
30      * This is being called, if new data is received from a CoAP request.
31      *
32      * @param data the received json structure
33      */
34     void onUpdate(JsonElement data);
35
36     /**
37      * Tells the listener to set the Thing status.
38      * Should usually be directly passed on to updateStatus() on the ThingHandler.
39      *
40      * @param status The thing status
41      * @param statusDetail the status detail
42      */
43     void setStatus(ThingStatus status, ThingStatusDetail statusDetail);
44 }