]> git.basschouten.com Git - openhab-addons.git/blob
2870158ac397129d44fc9c9ef9d3d7af276b0491
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.nibeuplink.internal.command;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jetty.client.HttpClient;
17 import org.eclipse.jetty.client.api.Response.CompleteListener;
18 import org.eclipse.jetty.client.api.Response.ContentListener;
19 import org.eclipse.jetty.client.api.Response.FailureListener;
20 import org.eclipse.jetty.client.api.Response.SuccessListener;
21 import org.openhab.binding.nibeuplink.internal.connector.StatusUpdateListener;
22
23 /**
24  * public interface for all commands
25  *
26  * @author Alexander Friese - initial contribution
27  */
28 @NonNullByDefault
29 public interface NibeUplinkCommand extends SuccessListener, FailureListener, ContentListener, CompleteListener {
30
31     static int MAX_RETRIES = 5;
32
33     /**
34      * this method is to be called by the UplinkWebinterface class
35      *
36      * @param asyncclient client which will handle the command
37      */
38     void performAction(HttpClient asyncclient);
39
40     /**
41      * update the status of the registered listener instance
42      *
43      */
44     void updateListenerStatus();
45
46     /**
47      * register a listener
48      *
49      * @param listener the listener to be registered.
50      */
51     void setListener(StatusUpdateListener listener);
52 }