Class DefaultResourceReferenceDelegate<R>
java.lang.Object
com.inductiveautomation.ignition.gateway.config.DefaultResourceReferenceDelegate<R>
- All Implemented Interfaces:
ResourceReferenceDelegate
- Direct Known Subclasses:
ExtensionPointReferenceDelegate
public class DefaultResourceReferenceDelegate<R>
extends Object
implements ResourceReferenceDelegate
Encapsulates the logic of finding references to a target resource in a given resource. To do this, it uses a
collection of
ReferenceFinder
objects that can detect the presence of a reference in a decoded resource.
This class will then handle the logic of decoding relevant resources, collecting any references, turning them into
PropertyReference
objects which contain a ReferenceUpdater
which knows how to re-encode the resource
if the reference is later updated.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JsonResourceCodec<R>
protected final com.google.common.collect.Multimap<ResourceType,
ReferenceFinder<R>> protected final ResourceType
Fields inherited from interface com.inductiveautomation.ignition.gateway.config.ResourceReferenceDelegate
NONE
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultResourceReferenceDelegate
(ResourceType resourceType, JsonResourceCodec<R> codec, com.google.common.collect.Multimap<ResourceType, ReferenceFinder<R>> referenceFinders) -
Method Summary
Modifier and TypeMethodDescriptionprotected Stream<PropertyReference>
findReferences
(Collection<ReferenceFinder<R>> finders, DecodedResource<R> resource, ResourcePath targetResource) protected Collection<ReferenceFinder<R>>
getReferences
(ConfigurationManager manager, ResourcePath targetResource) Finds any properties of any instance(s) of this resource type that reference the given resource.
-
Field Details
-
resourceType
-
codec
-
referenceFinders
protected final com.google.common.collect.Multimap<ResourceType,ReferenceFinder<R>> referenceFinders
-
-
Constructor Details
-
DefaultResourceReferenceDelegate
public DefaultResourceReferenceDelegate(ResourceType resourceType, JsonResourceCodec<R> codec, com.google.common.collect.Multimap<ResourceType, ReferenceFinder<R>> referenceFinders)
-
-
Method Details
-
getReferences
public Collection<PropertyReference> getReferences(ConfigurationManager manager, ResourcePath targetResource) Description copied from interface:ResourceReferenceDelegate
Finds any properties of any instance(s) of this resource type that reference the given resource.- Specified by:
getReferences
in interfaceResourceReferenceDelegate
- Returns:
- A collection of property references that reference the given resource. These references also include
the capability to generate a
ChangeOperation
needed to update the reference in the case of a rename operation. - See Also:
-
getReferenceFinders
-
findReferences
protected Stream<PropertyReference> findReferences(Collection<ReferenceFinder<R>> finders, DecodedResource<R> resource, ResourcePath targetResource)
-