Interface WotThingDescriptionGenerator


public interface WotThingDescriptionGenerator
Generator for WoT (Web of Things) ThingDescription based on a given WoT ThingModel and context of the Ditto Thing to generate the ThingDescription for.
Since:
2.4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    org.eclipse.ditto.wot.model.ThingDescription
    generateThingDescription(org.eclipse.ditto.things.model.ThingId thingId, org.eclipse.ditto.things.model.Thing thing, org.eclipse.ditto.json.JsonObject placeholderLookupObject, String featureId, org.eclipse.ditto.wot.model.ThingModel thingModel, URL thingModelUrl, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Generates a ThingDescription for the given thingId, optionally using the passed thing to lookup thing specific placeholders.
    of(akka.actor.ActorSystem actorSystem, WotConfig wotConfig, WotThingModelFetcher thingModelFetcher)
    Creates a new instance of WotThingDescriptionGenerator with the given wotConfig.
  • Method Details

    • generateThingDescription

      org.eclipse.ditto.wot.model.ThingDescription generateThingDescription(org.eclipse.ditto.things.model.ThingId thingId, @Nullable org.eclipse.ditto.things.model.Thing thing, @Nullable org.eclipse.ditto.json.JsonObject placeholderLookupObject, @Nullable String featureId, org.eclipse.ditto.wot.model.ThingModel thingModel, URL thingModelUrl, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Generates a ThingDescription for the given thingId, optionally using the passed thing to lookup thing specific placeholders. Uses the passed in thingModel and generates TD forms, security definition etc. in order to make it a valid TD.
      Parameters:
      thingId - the ThingId to generate the ThingDescription for.
      thing - the optional Thing from which to resolve metadata from.
      placeholderLookupObject - the optional JsonObject to dynamically resolve placeholders from (e.g. a Thing or Feature).
      featureId - the optional feature name if the TD should be generated for a certain feature of the Thing.
      thingModel - the ThingModel to use as template for generating the TD.
      thingModelUrl - the URL from which the ThingModel was fetched.
      dittoHeaders - the DittoHeaders for possibly thrown DittoRuntimeException which might occur during the generation.
      Returns:
      the generated ThingDescription for the given thingId based on the passed in thingModel.
      Throws:
      org.eclipse.ditto.wot.model.WotThingModelInvalidException - if the WoT ThingModel did not contain the mandatory "@type" being "tm:ThingModel"
    • of

      static WotThingDescriptionGenerator of(akka.actor.ActorSystem actorSystem, WotConfig wotConfig, WotThingModelFetcher thingModelFetcher)
      Creates a new instance of WotThingDescriptionGenerator with the given wotConfig.
      Parameters:
      actorSystem - the actor system to use.
      wotConfig - the WoTConfig to use for creating the generator.
      thingModelFetcher - the ThingModel fetcher to fetch linked other ThingModels during the TD generation process.
      Returns:
      the created WotThingDescriptionGenerator.