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, long 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.void
thingDiscovered
(DiscoveryService source, DiscoveryResult result) Invoked synchronously when aDiscoveryResult
has been created by the accordingDiscoveryService
.void
thingRemoved
(DiscoveryService source, ThingUID thingUID) Invoked synchronously when an already existingThing
has been marked to be deleted by the accordingDiscoveryService
.
-
Method Details
-
thingDiscovered
Invoked synchronously when aDiscoveryResult
has been created by the accordingDiscoveryService
.Hint: This method could even be invoked for
DiscoveryResult
s, 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 existingThing
has been marked to be deleted by the accordingDiscoveryService
.Hint: This method could even be invoked for
DiscoveryResult
s, 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, long 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 ofThingType
s, only results of theseThingType
s will be removed; ifnull
thenDiscoveryService.getSupportedThingTypes()
will be used insteadbridgeUID
- if notnull
only results of that bridge are being removed- Returns:
- collection of thing UIDs of all removed things
-