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 TypeMethodDescriptionOptional<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 skeletonFeaturefor the givenfeatureId.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 skeletonThingfor the giventhingId.static WotThingSkeletonGeneratorof(akka.actor.ActorSystem actorSystem, WotThingModelFetcher thingModelFetcher) Creates a new instance of WotThingSkeletonGenerator with the givenwotConfig.
-
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 skeletonThingfor the giventhingId. Uses the passed inthingModeland generatesattributeson Thing level for all required properties in that TM- Features for all included TM submodels (links with
tm:submodeltype) - 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
thingIdbased on the passed inthingModel. - 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 skeletonFeaturefor the givenfeatureId. Uses the passed inthingModeland generatespropertiesfor all required properties in that TM
- Parameters:
featureId- the FeatureId to generatethingModel- 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
featureIdbased on the passed inthingModel. - 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 givenwotConfig.- Parameters:
actorSystem- the actor system to use.thingModelFetcher- the ThingModel fetcher to fetch linked other ThingModels during the generation process.- Returns:
- the created WotThingSkeletonGenerator.
-