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
ResourceReference 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 TypeMethodDescriptionprotected Stream<ResourceReferences<R>> findResourceReferences(Collection<ReferenceProperty<R>> properties, DecodedResource<R> resource, ResourcePath targetResource) protected Collection<ReferenceProperty<R>> Get the relevant reference properties with the given target typegetResourceReferences(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
-
getResourceReferences
public Collection<ResourceReferences<R>> getResourceReferences(ConfigurationManager manager, ResourcePath targetResource) Description copied from interface:ResourceReferenceDelegateFinds any properties of any instance(s) of this resource type that reference the given resource.This is called for every registered resource type whenever a resource is renamed or deleted. Resource types that never reference other resources should use
ResourceReferenceDelegate.none().- Specified by:
getResourceReferencesin interfaceResourceReferenceDelegate<R>- Parameters:
manager- the configuration manager used to look up the resources of this type.targetResource- the path of the resource that is being renamed or deleted.- Returns:
- the references to the given resource, grouped by the resource that holds them. Each
group can produce the
ChangeOperations needed to update its resource in the case of a rename operation. - See Also:
-
getReferenceProperties
- Specified by:
getReferencePropertiesin 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 -
findResourceReferences
protected Stream<ResourceReferences<R>> findResourceReferences(Collection<ReferenceProperty<R>> properties, DecodedResource<R> resource, ResourcePath targetResource)
-