Class ResourceActionSet.Builder
java.lang.Object
com.inductiveautomation.ignition.gateway.config.actions.ResourceActionSet.Builder
- Enclosing class:
- ResourceActionSet
-
Method Summary
Modifier and TypeMethodDescriptionbuild()copy(ResourceAction.Copy copy) Sets the default Copy operation to aResourceAction.Copy.create(ResourceAction.Create create) Sets the default Create operation to aResourceAction.Create.delete(ResourceAction.Delete delete) Sets the default Delete operation to aResourceAction.Delete.listResources(ResourceAction.ListResources listResources) Sets the default ListResources operation to aResourceAction.ListResources.modify(ResourceAction.Modify modify) Sets the default Modify operation to aResourceAction.Modify.move(ResourceAction.Move move) Sets the default Move operation to aResourceAction.Move.read(ResourceAction.Read read) Sets the default Read operation to aResourceAction.Read.rename(ResourceAction.Rename rename) Sets the default Rename operation to aResourceAction.Rename.withValidatingCopy(Function<DefaultResourceActions.CopyResource<R>, Optional<ResourceAction.ValidationFailure>> validator) Sets the default Copy operation to aDefaultResourceActions.ValidatingCopy, which is backed by the default copy action, but additionally decodes the actual resource and allows for the caller to check the resource for validity.withValidatingCreate(Function<DefaultResourceActions.CreateResources<R>, Optional<ResourceAction.ValidationFailure>> validator) Sets the default Create operation to aDefaultResourceActions.ValidatingCreate, which is backed by the default create action, but additionally decodes the actual resource and allows for the caller to check the resource for validity.withValidatingModfy(Function<DefaultResourceActions.ModifyResources<R>, Optional<ResourceAction.ValidationFailure>> validator) Sets the default Modify operation to aDefaultResourceActions.ValidatingModify, which is backed by the default modify action, but additionally decodes the actual resource and allows for the caller to check the resource for validity.withValidatingMove(Function<DefaultResourceActions.MoveResource<R>, Optional<ResourceAction.ValidationFailure>> validator) Sets the default Move operation to aDefaultResourceActions.ValidatingMove, which is backed by the default move action, but additionally decodes the actual resource and allows for the caller to check the resource for validity.withValidatingRename(Function<DefaultResourceActions.RenameResource<R>, Optional<ResourceAction.ValidationFailure>> validator) Sets the default Rename operation to aDefaultResourceActions.ValidatingRename, which is backed by the default rename action, but additionally decodes the actual resource and allows for the caller to check the resource for validity.
-
Method Details
-
read
Sets the default Read operation to aResourceAction.Read. If null, reading of resources is disallowed. Typically, your implementation should just proxy to the DefaultDefaultResourceActions.Readto ensure proper reading of the resource from theConfigurationManager- Parameters:
read- The Read operation. May be null to disallow reading resources
-
listResources
public ResourceActionSet.Builder listResources(@Nullable ResourceAction.ListResources listResources) Sets the default ListResources operation to aResourceAction.ListResources. If null, listing resources is disallowed. Typically, your implementation should just proxy to the DefaultDefaultResourceActions.ListResourcesto ensure proper reading of the resource from theConfigurationManager- Parameters:
listResources- The ListResources operation. May be null to disallow listing resources
-
create
Sets the default Create operation to aResourceAction.Create. If null, creation of resources is disallowed. Typically, your implementation should just proxy to the DefaultDefaultResourceActions.Createto ensure proper creation and saving of the resource to theConfigurationManager- Parameters:
create- The Create operation. may be null to disallow creation of resources
-
withValidatingCreate
public <R> ResourceActionSet.Builder withValidatingCreate(@Nonnull Function<DefaultResourceActions.CreateResources<R>, Optional<ResourceAction.ValidationFailure>> validator) Sets the default Create operation to aDefaultResourceActions.ValidatingCreate, which is backed by the default create action, but additionally decodes the actual resource and allows for the caller to check the resource for validity. This does add some overhead, so it is recommended to use the default create if all you need is the information inResourceAction.CreateRequest. This method cannot be used at the same time ascreate(ResourceAction.Create)- Type Parameters:
R- The Configuration class set on theResourceTypeMetaof the resource being created.- Parameters:
validator- A function that accepts aDefaultResourceActions.CreateResourcesand returns anOptionalofResourceAction.ValidationFailureif the resource is invalid or empty if it is valid.
-
modify
Sets the default Modify operation to aResourceAction.Modify. If null, modifying resources is disallowed. Typically, your implementation should just proxy to the DefaultDefaultResourceActions.Modifyto ensure proper modification of the resource in theConfigurationManager- Parameters:
modify- The Modify operation. May be null to disallow modification of resources
-
withValidatingModfy
public <R> ResourceActionSet.Builder withValidatingModfy(@Nonnull Function<DefaultResourceActions.ModifyResources<R>, Optional<ResourceAction.ValidationFailure>> validator) Sets the default Modify operation to aDefaultResourceActions.ValidatingModify, which is backed by the default modify action, but additionally decodes the actual resource and allows for the caller to check the resource for validity. This does add some overhead, so it is recommended to use the default Modify if all you need is the information inResourceAction.ModifyRequest. This method cannot be used at the same time asmodify(ResourceAction.Modify)- Type Parameters:
R- The Configuration class set on theResourceTypeMetaof the resource being created.- Parameters:
validator- A function that accepts aDefaultResourceActions.ModifyResourcesand returns anOptionalofResourceAction.ValidationFailureif the resource is invalid or empty if it is valid.
-
delete
Sets the default Delete operation to aResourceAction.Delete. If null, deleting resources is disallowed. Typically, your implementation should just proxy to the DefaultDefaultResourceActions.Deleteto ensure proper deletion of the resource in theConfigurationManager- Parameters:
delete- The Delete operation. May be null to disallow deletion of resources
-
move
Sets the default Move operation to aResourceAction.Move. If null, moving resources is disallowed. Typically, your implementation should just proxy to the DefaultDefaultResourceActions.Moveto ensure the resource is moved to the proper location in theConfigurationManager- Parameters:
move- The Move operation. May be null to disallow moving of resources
-
withValidatingMove
public <R> ResourceActionSet.Builder withValidatingMove(@Nonnull Function<DefaultResourceActions.MoveResource<R>, Optional<ResourceAction.ValidationFailure>> validator) Sets the default Move operation to aDefaultResourceActions.ValidatingMove, which is backed by the default move action, but additionally decodes the actual resource and allows for the caller to check the resource for validity. This does add some overhead, so it is recommended to use the default Move if all you need is the information inResourceAction.Move.move(com.inductiveautomation.ignition.gateway.config.ConfigurationManager, com.inductiveautomation.ignition.common.resourcecollection.ResourceType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.inductiveautomation.ignition.common.ImmutableBytes, com.inductiveautomation.ignition.gateway.config.actions.ResourceAction.ContextObject). This method cannot be used at the same time asmove(ResourceAction.Move)- Type Parameters:
R- The Configuration class set on theResourceTypeMetaof the resource being created.- Parameters:
validator- A function that accepts aDefaultResourceActions.MoveResourceand returns anOptionalofResourceAction.ValidationFailureif the resource is invalid or empty if it is valid.
-
copy
Sets the default Copy operation to aResourceAction.Copy. If null, copying resources is disallowed. Typically, your implementation should just proxy to the DefaultDefaultResourceActions.Copyto ensure the resource is copied properly inConfigurationManager- Parameters:
copy- The Copy operation. May be null to disallow copying resources
-
withValidatingCopy
public <R> ResourceActionSet.Builder withValidatingCopy(@Nonnull Function<DefaultResourceActions.CopyResource<R>, Optional<ResourceAction.ValidationFailure>> validator) Sets the default Copy operation to aDefaultResourceActions.ValidatingCopy, which is backed by the default copy action, but additionally decodes the actual resource and allows for the caller to check the resource for validity. This does add some overhead, so it is recommended to use the default Copy if all you need is the information inResourceAction.Copy.copy(com.inductiveautomation.ignition.gateway.config.ConfigurationManager, com.inductiveautomation.ignition.common.resourcecollection.ResourceType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.inductiveautomation.ignition.common.ImmutableBytes, com.inductiveautomation.ignition.gateway.config.actions.ResourceAction.ContextObject). This method cannot be used at the same time ascopy(ResourceAction.Copy)- Type Parameters:
R- The Configuration class set on theResourceTypeMetaof the resource being created.- Parameters:
validator- A function that accepts aDefaultResourceActions.CopyResourceand returns anOptionalofResourceAction.ValidationFailureif the resource is invalid or empty if it is valid.
-
rename
Sets the default Rename operation to aResourceAction.Rename. If null, renaming resources is disallowed. Typically, your implementation should just proxy to the DefaultDefaultResourceActions.Renameto ensure the resource is renamed properly inConfigurationManager- Parameters:
rename- The Rename operation. May be null to disallow renaming resources
-
withValidatingRename
public <R> ResourceActionSet.Builder withValidatingRename(@Nonnull Function<DefaultResourceActions.RenameResource<R>, Optional<ResourceAction.ValidationFailure>> validator) Sets the default Rename operation to aDefaultResourceActions.ValidatingRename, which is backed by the default rename action, but additionally decodes the actual resource and allows for the caller to check the resource for validity. This does add some overhead, so it is recommended to use the default Rename if all you need is the information inResourceAction.Rename.rename(com.inductiveautomation.ignition.gateway.config.ConfigurationManager, com.inductiveautomation.ignition.common.resourcecollection.ResourceType, java.lang.String, java.lang.String, com.inductiveautomation.ignition.gateway.config.ReferenceHandling, java.lang.String, com.inductiveautomation.ignition.gateway.config.actions.ResourceAction.ContextObject). This method cannot be used at the same time asrename(ResourceAction.Rename)- Type Parameters:
R- The Configuration class set on theResourceTypeMetaof the resource being created.- Parameters:
validator- A function that accepts aDefaultResourceActions.CopyResourceand returns anOptionalofResourceAction.ValidationFailureif the resource is invalid or empty if it is valid.
-
build
-