]> git.basschouten.com Git - openhab-addons.git/blob
2f6a6bcea10ac97ff92e7e444f42819638e53e25
[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.io.neeo.internal.discovery;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * This interface defines the contract for brain discovery implementations
19  *
20  * @author Tim Roberts - Initial Contribution
21  */
22 @NonNullByDefault
23 public interface BrainDiscovery extends AutoCloseable {
24
25     /**
26      * Adds a lister for discovery notifications
27      *
28      * @param listener the non-null listener
29      */
30     void addListener(DiscoveryListener listener);
31
32     /**
33      * Removes the listener from discovery notifications
34      *
35      * @param listener the non-null listener
36      */
37     void removeListener(DiscoveryListener listener);
38
39     /**
40      * Adds the specified system information as discovery
41      *
42      * @param address a non-null, non-empty IP address for the system
43      * @return true if added, false otherwise
44      */
45     boolean addDiscovered(String address);
46
47     /**
48      * Removes any discovered information associated with the servlet URL
49      *
50      * @param servletUrl a non-null, non-empty servlet URL
51      * @return true if removed, false otherwise
52      */
53     boolean removeDiscovered(String servletUrl);
54
55     /**
56      * Start the discovery process
57      */
58     void startDiscovery();
59
60     /**
61      * Ends the discovery process
62      *
63      * @see java.lang.AutoCloseable#close()
64      */
65     @Override
66     void close();
67 }