Class NamedResourceHandler.Builder<R>
java.lang.Object
com.inductiveautomation.ignition.gateway.config.NamedResourceHandler.Builder<R>
- Enclosing class:
- NamedResourceHandler<R>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
caseSensitive
(boolean caseSensitive) Set whether the name handling inNamedResourceHandler.findResource(String)
is considered case-sensitive (true) or not.configurationManager
(ConfigurationManager manager) The configuration manager that will be used to store the resources.context
(GatewayContext context) Supplies the GatewayContext to the builder, which will be used to get the configuration manager and redundancy manager.filter
(Predicate<DecodedResource<R>> filter) Set a filter to determine which resources should be included in the handler's list of resources.onInitialOrUpdate
(Consumer<List<DecodedResource<R>>> onChange) Convenience method to set the same consumer for both startup and update events.onInitialResources
(Consumer<List<DecodedResource<R>>> onStartup) Called once at startup with the resource that are already present in the configuration collection.onResourceAdded
(Consumer<DecodedResource<R>> onResourceAdded) Called once per each resource that is added.onResourceRemoved
(Consumer<DecodedResource<R>> onResourceRemoved) Called for resources that are removed (or updated and then fail to parse).onResourcesUpdated
(Consumer<List<DecodedResource<R>>> onResourcesUpdated) Called once per change set, with the new list of all resources.onResourceUpdated
(Consumer<ModifiedResource<R>> onResourceUpdated) Called once per each resource that is updated.redundancyManager
(RedundancyManager redundancyManager) Sets the redundancy manager used to detect the NodeRole of the gateway.
-
Constructor Details
-
Builder
-
-
Method Details
-
context
Supplies the GatewayContext to the builder, which will be used to get the configuration manager and redundancy manager. If you call this, you don't need to callconfigurationManager(ConfigurationManager)
orredundancyManager(RedundancyManager)
. -
configurationManager
The configuration manager that will be used to store the resources.Calling either this or
context(GatewayContext)
is required.- See Also:
-
redundancyManager
Sets the redundancy manager used to detect the NodeRole of the gateway. This is used to automatically choose which configuration version to use for resources which specify backup configuration.This is optional - if you don't set this, your resource type will always use the primary configuration.
- See Also:
-
caseSensitive
Set whether the name handling inNamedResourceHandler.findResource(String)
is considered case-sensitive (true) or not. By default, this is true. -
filter
Set a filter to determine which resources should be included in the handler's list of resources. By default, the filter will exclude resources that are not enabled. -
onInitialResources
public NamedResourceHandler.Builder<R> onInitialResources(Consumer<List<DecodedResource<R>>> onStartup) Called once at startup with the resource that are already present in the configuration collection. -
onResourceAdded
public NamedResourceHandler.Builder<R> onResourceAdded(Consumer<DecodedResource<R>> onResourceAdded) Called once per each resource that is added. -
onResourceUpdated
public NamedResourceHandler.Builder<R> onResourceUpdated(Consumer<ModifiedResource<R>> onResourceUpdated) Called once per each resource that is updated. -
onResourceRemoved
public NamedResourceHandler.Builder<R> onResourceRemoved(Consumer<DecodedResource<R>> onResourceRemoved) Called for resources that are removed (or updated and then fail to parse). -
onResourcesUpdated
public NamedResourceHandler.Builder<R> onResourcesUpdated(Consumer<List<DecodedResource<R>>> onResourcesUpdated) Called once per change set, with the new list of all resources. -
onInitialOrUpdate
public NamedResourceHandler.Builder<R> onInitialOrUpdate(Consumer<List<DecodedResource<R>>> onChange) Convenience method to set the same consumer for both startup and update events. -
build
-