2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.io.neeo.internal.discovery;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * This interface defines the contract for brain discovery implementations
20 * @author Tim Roberts - Initial Contribution
23 public interface BrainDiscovery extends AutoCloseable {
26 * Adds a lister for discovery notifications
28 * @param listener the non-null listener
30 void addListener(DiscoveryListener listener);
33 * Removes the listener from discovery notifications
35 * @param listener the non-null listener
37 void removeListener(DiscoveryListener listener);
40 * Adds the specified system information as discovery
42 * @param address a non-null, non-empty IP address for the system
43 * @return true if added, false otherwise
45 boolean addDiscovered(String address);
48 * Removes any discovered information associated with the servlet URL
50 * @param servletUrl a non-null, non-empty servlet URL
51 * @return true if removed, false otherwise
53 boolean removeDiscovered(String servletUrl);
56 * Start the discovery process
58 void startDiscovery();
61 * Ends the discovery process
63 * @see java.lang.AutoCloseable#close()