Interface WotThingSkeletonGenerator


public interface WotThingSkeletonGenerator
Generator for WoT (Web of Things) based Ditto Things and Feature skeletons based on a given WoT ThingModel for creation of Ditto entities (Things/Features).
Since:
2.4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<org.eclipse.ditto.things.model.Feature>
    generateFeatureSkeleton(String featureId, org.eclipse.ditto.wot.model.ThingModel thingModel, URL thingModelUrl, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Generates a skeleton Feature for the given featureId.
    Optional<org.eclipse.ditto.things.model.Thing>
    generateThingSkeleton(org.eclipse.ditto.things.model.ThingId thingId, org.eclipse.ditto.wot.model.ThingModel thingModel, URL thingModelUrl, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
    Generates a skeleton Thing for the given thingId.
    of(akka.actor.ActorSystem actorSystem, WotThingModelFetcher thingModelFetcher)
    Creates a new instance of WotThingSkeletonGenerator with the given wotConfig.
  • Method Details

    • generateThingSkeleton

      Optional<org.eclipse.ditto.things.model.Thing> generateThingSkeleton(org.eclipse.ditto.things.model.ThingId thingId, org.eclipse.ditto.wot.model.ThingModel thingModel, URL thingModelUrl, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Generates a skeleton Thing for the given thingId. Uses the passed in thingModel and generates
      • attributes on Thing level for all required properties in that TM
      • Features for all included TM submodels (links with tm:submodel type)
      • Feature properties on Feature levels for all required properties in linked submodel TMs
      Parameters:
      thingId - the ThingId to generate the Thing skeleton for.
      thingModel - the ThingModel to use as template for generating the Thing skeleton.
      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 Thing skeleton 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"
    • generateFeatureSkeleton

      Optional<org.eclipse.ditto.things.model.Feature> generateFeatureSkeleton(String featureId, org.eclipse.ditto.wot.model.ThingModel thingModel, URL thingModelUrl, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Generates a skeleton Feature for the given featureId. Uses the passed in thingModel and generates
      • properties for all required properties in that TM
      Parameters:
      featureId - the FeatureId to generate
      thingModel - the ThingModel to use as template for generating the Feature skeleton.
      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 Feature skeleton for the given featureId 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 WotThingSkeletonGenerator of(akka.actor.ActorSystem actorSystem, WotThingModelFetcher thingModelFetcher)
      Creates a new instance of WotThingSkeletonGenerator with the given wotConfig.
      Parameters:
      actorSystem - the actor system to use.
      thingModelFetcher - the ThingModel fetcher to fetch linked other ThingModels during the generation process.
      Returns:
      the created WotThingSkeletonGenerator.