Interface DiscoveryResult


  • @NonNullByDefault
    public interface DiscoveryResult
    The DiscoveryResult is a container for one result of a discovery process. The discovery process can lead to 0..N DiscoveryResult objects which are fired as an event to registered DiscoveryListeners.
    Author:
    Kai Kreuzer - Initial contribution, Andre Fuechsel - added support for time to live, Thomas Höfer - Added representation
    See Also:
    DiscoveryService, DiscoveryListener
    • Method Detail

      • getThingUID

        ThingUID getThingUID()
        Returns the unique Thing ID of this result object.

        A ThingUID must be a unique identifier of a concrete Thing which must not consist of data which could change (e.g. configuration data such as an IP address). If a Thing disappears and is discovered again, the same Thing ID must be created. A typical Thing ID could be the serial number. It's usually not a product number.

        Returns:
        the Thing ID of this result object (not null, not empty)
      • getThingTypeUID

        ThingTypeUID getThingTypeUID()
        Returns the unique Thing type ID of this result object.

        A Thing type ID could be a product number which identifies the same type of Things. It's usually not a serial number.

        Returns:
        the unique Thing type of this result object (not null, not empty)
      • getBindingId

        String getBindingId()
        Returns the binding ID of this result object.

        The binding ID is extracted from the unique Thing ID.

        Returns:
        the binding ID of this result object (not null, not empty)
      • getProperties

        Map<String,​Object> getProperties()
        Returns the properties of this result object.
        The properties contain information which become part of a Thing.

        Hint: The returned properties are immutable.

        Returns:
        the properties of this result object (not null, could be empty)
      • getRepresentationProperty

        @Nullable String getRepresentationProperty()
        Returns the representation property of this result object.

        The representation property represents an unique human and/or machine readable identifier of the thing that was discovered. Its actual value can be retrieved from the getProperties() map. Such unique identifiers are typically the ipAddress, the macAddress or the serialNumber of the discovered thing.

        Returns:
        the representation property of this result object (could be null)
      • getFlag

        DiscoveryResultFlag getFlag()
        Returns the flag of this result object.
        The flag signals e.g. if the result is DiscoveryResultFlag.NEW or has been marked as DiscoveryResultFlag.IGNORED. In the latter case the result object should be regarded as known by the system so that further processing should be skipped.
        Returns:
        the flag of this result object (not null)
      • getLabel

        String getLabel()
        Returns the human readable label for this result object.
        Returns:
        the human readable label for this result object (not null, could be empty)
      • getBridgeUID

        @Nullable ThingUID getBridgeUID()
        Returns the unique bridge ID of the DiscoveryResult.
        Returns:
        the unique bridge ID (could be null)
      • getTimestamp

        long getTimestamp()
        Get the timestamp of this DiscoveryResult.
        Returns:
        timestamp as long
      • getTimeToLive

        long getTimeToLive()
        Get the time to live in seconds for this entry.
        Returns:
        time to live in seconds