Interface WotThingDescriptionProvider

All Superinterfaces:
akka.actor.Extension

@Immutable public interface WotThingDescriptionProvider extends akka.actor.Extension
Extension for providing WoT (Web of Things) ThingDescriptions for given thingIds from either a ThingDefinition or a FeatureDefinition from which the URL to a WoT ThingModel is resolved and the ThingDescription is provided.
Since:
2.4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    get(akka.actor.ActorSystem system)
    Get the WotThingDescriptionProvider for an actor system.
    Optional<org.eclipse.ditto.things.model.Feature>
    provideFeatureSkeletonForCreation(String featureId, org.eclipse.ditto.things.model.FeatureDefinition featureDefinition, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Provides a Feature skeleton for the given featureId using the passed featureDefinition to extract a ThingModel URL from, fetching the ThingModel and generating the skeleton via WotThingSkeletonGenerator.
    org.eclipse.ditto.wot.model.ThingDescription
    provideFeatureTD(org.eclipse.ditto.things.model.ThingId thingId, org.eclipse.ditto.things.model.Thing thing, org.eclipse.ditto.things.model.Feature feature, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Provides a ThingDescription for the given thingDefinition, thingId and featureId combination.
    Optional<org.eclipse.ditto.things.model.Thing>
    provideThingSkeletonForCreation(org.eclipse.ditto.things.model.ThingId thingId, org.eclipse.ditto.things.model.ThingDefinition thingDefinition, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Provides a Thing skeleton for the given thingId using the passed thingDefinition to extract a ThingModel URL from, fetching the ThingModel and generating the skeleton via WotThingSkeletonGenerator.
    org.eclipse.ditto.wot.model.ThingDescription
    provideThingTD(org.eclipse.ditto.things.model.ThingDefinition thingDefinition, org.eclipse.ditto.things.model.ThingId thingId, org.eclipse.ditto.things.model.Thing thing, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Provides a ThingDescription for the given thingDefinition and thingId combination.
  • Method Details

    • provideThingTD

      org.eclipse.ditto.wot.model.ThingDescription provideThingTD(@Nullable org.eclipse.ditto.things.model.ThingDefinition thingDefinition, org.eclipse.ditto.things.model.ThingId thingId, @Nullable org.eclipse.ditto.things.model.Thing thing, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Provides a ThingDescription for the given thingDefinition and thingId combination.
      Parameters:
      thingDefinition - the ThingDefinition to extract the URL from a ThingModel from to use as template for the provided ThingDescription.
      thingId - the ThingId to provide the ThingDescription for.
      thing - the optional Thing to use to resolve placeholders and metadata from.
      dittoHeaders - the DittoHeaders for possibly thrown DittoRuntimeExceptions.
      Returns:
      the ThingDescription.
      Throws:
      org.eclipse.ditto.wot.model.ThingDefinitionInvalidException - if the passed in thingDefinition was null or did not contain a ThingModel URL.
      org.eclipse.ditto.wot.model.WotThingModelNotAccessibleException - if the ThingModel could not be accessed/ downloaded.
    • provideFeatureTD

      org.eclipse.ditto.wot.model.ThingDescription provideFeatureTD(org.eclipse.ditto.things.model.ThingId thingId, @Nullable org.eclipse.ditto.things.model.Thing thing, org.eclipse.ditto.things.model.Feature feature, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Provides a ThingDescription for the given thingDefinition, thingId and featureId combination.
      Parameters:
      thingId - the ThingId to provide the ThingDescription for.
      thing - the optional Thing to use to resolve placeholders and metadata from.
      feature - the Feature to provide the ThingDescription for.
      dittoHeaders - the DittoHeaders for possibly thrown DittoRuntimeExceptions.
      Returns:
      the ThingDescription.
      Throws:
      org.eclipse.ditto.wot.model.ThingDefinitionInvalidException - if the passed in featureDefinition was null or did not contain a ThingModel URL.
      org.eclipse.ditto.wot.model.WotThingModelNotAccessibleException - if the ThingModel could not be accessed/ downloaded.
    • provideThingSkeletonForCreation

      Optional<org.eclipse.ditto.things.model.Thing> provideThingSkeletonForCreation(org.eclipse.ditto.things.model.ThingId thingId, @Nullable org.eclipse.ditto.things.model.ThingDefinition thingDefinition, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Provides a Thing skeleton for the given thingId using the passed thingDefinition to extract a ThingModel URL from, fetching the ThingModel and generating the skeleton via WotThingSkeletonGenerator. The implementation should not throw exceptions, but return an empty optional if something went wrong during fetching or generation of the skeleton.
      Parameters:
      thingId - the ThingId to generate the Thing skeleton for.
      thingDefinition - the ThingDefinition to resolve the ThingModel URL from.
      dittoHeaders - the DittoHeaders for possibly thrown DittoRuntimeExceptions.
      Returns:
      an optional Thing skeleton or empty optional if something went wrong during the skeleton creation.
    • provideFeatureSkeletonForCreation

      Optional<org.eclipse.ditto.things.model.Feature> provideFeatureSkeletonForCreation(String featureId, @Nullable org.eclipse.ditto.things.model.FeatureDefinition featureDefinition, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Provides a Feature skeleton for the given featureId using the passed featureDefinition to extract a ThingModel URL from, fetching the ThingModel and generating the skeleton via WotThingSkeletonGenerator. The implementation should not throw exceptions, but return an empty optional if something went wrong during fetching or generation of the skeleton.
      Parameters:
      featureId - the FeatureId to generate the Feature skeleton for.
      featureDefinition - the FeatureDefinition to resolve the ThingModel URL from.
      dittoHeaders - the DittoHeaders for possibly thrown DittoRuntimeExceptions.
      Returns:
      an optional Feature skeleton or empty optional if something went wrong during the skeleton creation.
    • get

      static WotThingDescriptionProvider get(akka.actor.ActorSystem system)
      Get the WotThingDescriptionProvider for an actor system.
      Parameters:
      system - the actor system.
      Returns:
      the WotThingDescriptionProvider extension.