Class DetectorModel
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.iotevents.DetectorModel
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IDetectorModel
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:37.224Z")
@Stability(Experimental)
public class DetectorModel
extends Resource
implements IDetectorModel
(experimental) Defines an AWS IoT Events detector model in this stack.
Example:
import software.amazon.awscdk.services.iotevents.*; import software.amazon.awscdk.services.iotevents.actions.*; import software.amazon.awscdk.services.lambda.*; IFunction func; Input input = Input.Builder.create(this, "MyInput") .inputName("my_input") // optional .attributeJsonPaths(List.of("payload.deviceId", "payload.temperature")) .build(); State warmState = State.Builder.create() .stateName("warm") .onEnter(List.of(Event.builder() .eventName("test-enter-event") .condition(Expression.currentInput(input)) .actions(List.of(new LambdaInvokeAction(func))) .build())) .onInput(List.of(Event.builder() // optional .eventName("test-input-event") .actions(List.of(new LambdaInvokeAction(func))).build())) .onExit(List.of(Event.builder() // optional .eventName("test-exit-event") .actions(List.of(new LambdaInvokeAction(func))).build())) .build(); State coldState = State.Builder.create() .stateName("cold") .build(); // transit to coldState when temperature is less than 15 warmState.transitionTo(coldState, TransitionOptions.builder() .eventName("to_coldState") // optional property, default by combining the names of the States .when(Expression.lt(Expression.inputAttribute(input, "payload.temperature"), Expression.fromString("15"))) .executing(List.of(new LambdaInvokeAction(func))) .build()); // transit to warmState when temperature is greater than or equal to 15 coldState.transitionTo(warmState, TransitionOptions.builder() .when(Expression.gte(Expression.inputAttribute(input, "payload.temperature"), Expression.fromString("15"))) .build()); DetectorModel.Builder.create(this, "MyDetectorModel") .detectorModelName("test-detector-model") // optional .description("test-detector-model-description") // optional property, default is none .evaluationMethod(EventEvaluation.SERIAL) // optional property, default is iotevents.EventEvaluation.BATCH .detectorKey("payload.deviceId") // optional property, default is none and single detector instance will be created and all inputs will be routed to it .initialState(warmState) .build();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
(experimental) A fluent builder forDetectorModel
.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.iotevents.IDetectorModel
IDetectorModel.Jsii$Default, IDetectorModel.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
DetectorModel
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
DetectorModel
(software.amazon.jsii.JsiiObjectRef objRef) DetectorModel
(software.constructs.Construct scope, String id, DetectorModelProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IDetectorModel
fromDetectorModelName
(software.constructs.Construct scope, String id, String detectorModelName) (experimental) Import an existing detector model.(experimental) The name of the detector model.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
DetectorModel
protected DetectorModel(software.amazon.jsii.JsiiObjectRef objRef) -
DetectorModel
protected DetectorModel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
DetectorModel
@Stability(Experimental) public DetectorModel(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DetectorModelProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
fromDetectorModelName
@Stability(Experimental) @NotNull public static IDetectorModel fromDetectorModelName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String detectorModelName) (experimental) Import an existing detector model.- Parameters:
scope
- This parameter is required.id
- This parameter is required.detectorModelName
- This parameter is required.
-
getDetectorModelName
(experimental) The name of the detector model.- Specified by:
getDetectorModelName
in interfaceIDetectorModel
-