Class DefaultResourceActions.ValidatingCreate<R>
java.lang.Object
com.inductiveautomation.ignition.gateway.config.actions.DefaultResourceActions.ValidatingCreate<R>
- Type Parameters:
R- This must be the config class object used for thisResourceTypeMeta
- All Implemented Interfaces:
ResourceAction,ResourceAction.Create
- Enclosing class:
- DefaultResourceActions
Performs the default Create operation but allows for validation of the resource prior to the resource being
committed to the configuration system to be persisted. This means that a
DefaultResourceActions.CreateResources is provided to
the supplied validator which contains a DecodedResource instance of the resource which does incur some
overhead since this resource has to be decoded. It is expected that these validations are also fairly
light-weight as this occurs during user interaction from the Web API or the Rest API.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordcom.inductiveautomation.ignition.gateway.config.actions.DefaultResourceActions.CreateImpl.CreateContextUsed internally by the Create implementation for validation.Nested classes/interfaces inherited from interface com.inductiveautomation.ignition.gateway.config.actions.ResourceAction
ResourceAction.ContextObject, ResourceAction.Copy, ResourceAction.Create, ResourceAction.CreateRequest, ResourceAction.Delete, ResourceAction.DeleteRequest, ResourceAction.ListResources, ResourceAction.Modify, ResourceAction.ModifyRequest, ResourceAction.Move, ResourceAction.Read, ResourceAction.Rename, ResourceAction.ValidationFailure -
Constructor Summary
ConstructorsConstructorDescriptionValidatingCreate(Function<DefaultResourceActions.CreateResources<R>, Optional<ResourceAction.ValidationFailure>> validator) -
Method Summary
Modifier and TypeMethodDescription@NotNull StatefulModificationResponsecreate(ConfigurationManager manager, List<ResourceAction.CreateRequest> changes, ResourceAction.ContextObject contextObject) Creates one or more named resources based on the provided list ofResourceAction.CreateRequest.validateResources(Set<com.inductiveautomation.ignition.gateway.config.actions.DefaultResourceActions.CreateImpl.CreateContext> resources)
-
Constructor Details
-
ValidatingCreate
public ValidatingCreate(Function<DefaultResourceActions.CreateResources<R>, Optional<ResourceAction.ValidationFailure>> validator)
-
-
Method Details
-
validateResources
public Optional<ResourceAction.ValidationFailure> validateResources(Set<com.inductiveautomation.ignition.gateway.config.actions.DefaultResourceActions.CreateImpl.CreateContext> resources) -
create
@NotNull public @NotNull StatefulModificationResponse create(ConfigurationManager manager, List<ResourceAction.CreateRequest> changes, ResourceAction.ContextObject contextObject) Description copied from interface:ResourceAction.CreateCreates one or more named resources based on the provided list ofResourceAction.CreateRequest.- Specified by:
createin interfaceResourceAction.Create- Parameters:
manager- The configuration manager to use for creating the resources.changes- The list of requests containing details about the resources to create.contextObject- The context object to associated with the change.- Returns:
- A response indicating the result of the creation operation.
-