Interface DiscoveryListener
@NonNullByDefault
public interface DiscoveryListener
The
DiscoveryListener interface for receiving discovery events.
A class that is interested in processing discovery events fired synchronously by a DiscoveryService has to
implement this interface.
- Author:
- Michael Grammling - Initial contribution, Andre Fuechsel - Added removeOlderThings
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@Nullable Collection<ThingUID> removeOlderResults(DiscoveryService source, Instant timestamp, @Nullable Collection<ThingTypeUID> thingTypeUIDs, @Nullable ThingUID bridgeUID) Removes all results belonging to one of the given types that are older than the given timestamp.voidthingDiscovered(DiscoveryService source, DiscoveryResult result) Invoked synchronously when aDiscoveryResulthas been created by the accordingDiscoveryService.voidthingRemoved(DiscoveryService source, ThingUID thingUID) Invoked synchronously when an already existingThinghas been marked to be deleted by the accordingDiscoveryService.
-
Method Details
-
thingDiscovered
Invoked synchronously when aDiscoveryResulthas been created by the accordingDiscoveryService.Hint: This method could even be invoked for
DiscoveryResults, whose existence has already been informed about.- Parameters:
source- the discovery service which is the source of this event (not null)result- the discovery result (not null)
-
thingRemoved
Invoked synchronously when an already existingThinghas been marked to be deleted by the accordingDiscoveryService.Hint: This method could even be invoked for
DiscoveryResults, whose removal has already been informed about.- Parameters:
source- the discovery service which is the source of this event (not null)thingUID- the Thing UID to be removed (not null)
-
removeOlderResults
@Nullable Collection<ThingUID> removeOlderResults(DiscoveryService source, Instant timestamp, @Nullable Collection<ThingTypeUID> thingTypeUIDs, @Nullable ThingUID bridgeUID) Removes all results belonging to one of the given types that are older than the given timestamp.- Parameters:
source- the discovery service which is the source of this event (not null)timestamp- timestamp, all older results will be removedthingTypeUIDs- collection ofThingTypes, only results of theseThingTypes will be removed; ifnullthenDiscoveryService.getSupportedThingTypes()will be used insteadbridgeUID- if notnullonly results of that bridge are being removed- Returns:
- collection of thing UIDs of all removed things
-