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