]> git.basschouten.com Git - openhab-addons.git/blob
e92ef47d775ab985c2958cf172f5e5a83a854dae
[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.digitalstrom.internal.lib.listener;
14
15 import org.openhab.binding.digitalstrom.internal.lib.structure.scene.InternalScene;
16
17 /**
18  * The {@link SceneStatusListener} is notified, if an {@link InternalScene} status has changed or a
19  * {@link InternalScene} has been removed or added.
20  *
21  * <p>
22  * By implementation with the id {@link #SCENE_DISCOVERY} this listener can be used as a scene discovery to get
23  * informed, if a new {@link InternalScene}s is added or removed from the digitalSTROM-System.<br>
24  * For that the {@link SceneStatusListener} has to be registered on the
25  * {@link SceneManager#registerSceneListener(SceneStatusListener)}. Then the {@link SceneStatusListener} gets
26  * informed by the methods {@link #onSceneAdded(InternalScene)} and {@link #onSceneRemoved(InternalScene)}.
27  *
28  * @author Michael Ochel - Initial contribution
29  * @author Matthias Siegele - Initial contribution
30  */
31 public interface SceneStatusListener {
32
33     /**
34      * The {@link SceneStatusListener} id for the discovery implementation.
35      */
36     static final String SCENE_DISCOVERY = "SceneDiscovery";
37
38     /**
39      * This method is called whenever the state of the {@link InternalScene} has changed.
40      *
41      * @param newState (true = call | false = undo)
42      */
43     void onSceneStateChanged(boolean newState);
44
45     /**
46      * This method is called whenever an {@link InternalScene} is removed.
47      *
48      * @param scene that was removed
49      */
50     void onSceneRemoved(InternalScene scene);
51
52     /**
53      * This method is called whenever an {@link InternalScene} is added.
54      *
55      * @param scene that was added
56      */
57     void onSceneAdded(InternalScene scene);
58
59     /**
60      * Return the id of this {@link SceneStatusListener}.
61      *
62      * @return the scene listener id
63      */
64     String getSceneStatusListenerID();
65 }