Class DefaultResourceReferenceDelegate<R>
java.lang.Object
com.inductiveautomation.ignition.gateway.config.DefaultResourceReferenceDelegate<R>
- All Implemented Interfaces:
ResourceReferenceDelegate<R>
- Direct Known Subclasses:
ExtensionPointReferenceDelegate
public class DefaultResourceReferenceDelegate<R>
extends Object
implements ResourceReferenceDelegate<R>
Holds a collection of
ReferenceProperty
objects for a given resource type.
This class handles the logic of decoding relevant resources, collecting any references, turning them into
Reference
objects which contain a ReferenceUpdater
which can 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 List<ReferenceProperty<R>>
protected final ResourceType
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultResourceReferenceDelegate
(ResourceType resourceType, JsonResourceCodec<R> codec, List<ReferenceProperty<R>> properties) -
Method Summary
Modifier and TypeMethodDescriptionfindReferences
(Collection<ReferenceProperty<R>> properties, DecodedResource<R> resource, ResourcePath targetResource) protected Collection<ReferenceProperty<R>>
Get the relevant reference properties with the given target typegetReferences
(ConfigurationManager manager, ResourcePath targetResource) Finds any properties of any instance(s) of this resource type that reference the given resource.
-
Field Details
-
resourceType
-
codec
-
properties
-
-
Constructor Details
-
DefaultResourceReferenceDelegate
public DefaultResourceReferenceDelegate(ResourceType resourceType, JsonResourceCodec<R> codec, List<ReferenceProperty<R>> properties)
-
-
Method Details
-
getReferences
public Collection<Reference> 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<R>
- 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:
-
getReferenceProperties
- Specified by:
getReferenceProperties
in interfaceResourceReferenceDelegate<R>
- Returns:
- A collection of all reference properties for the resource type represented by this delegate.
-
getReferencePropsForTarget
Get the relevant reference properties with the given target type -
findReferences
protected Stream<Reference> findReferences(Collection<ReferenceProperty<R>> properties, DecodedResource<R> resource, ResourcePath targetResource)
-