Class RuntimeProject
java.lang.Object
com.inductiveautomation.ignition.common.project.AbstractProject
com.inductiveautomation.ignition.common.project.RuntimeProject
- All Implemented Interfaces:
Project
,Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
An EffectiveProjectSnapshot is aProjectSnapshot
of a project and its effective resource set plus additional information about what its hierarchy was at the time the snapshot was made.static class
static class
-
Field Summary
Fields inherited from interface com.inductiveautomation.ignition.common.project.Project
GLOBAL_PROJECT_NAME, PIPELINE_PROJECT_NAME, PROJECT_NAME_PATTERN, SFC_PROJECT_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionRuntimeProject
(List<NamedManifest> projects, Map<ProjectResourceId, ProjectResource> resources) -
Method Summary
Modifier and TypeMethodDescriptionapplyChange
(List<ProjectDiff.AbsoluteDiff> diffs) browse
(ResourcePath path) static RuntimeProject
createAndValidate
(List<NamedManifest> projects, Map<ProjectResourceId, ProjectResource> resources) diff
(RuntimeProject.EffectiveProjectSnapshot effectiveSnapshot) Get aProjectDiff
generated by diffing anRuntimeProject.EffectiveProjectSnapshot
fromgetEffectiveSnapshot()
with the current *effective* state of the project.Get a List of all resources in this project and all parent projects.Get theProjectManifest
for this Project.getName()
Gets the snapshots from the effective project, in order of project inheritance (leaf project last)getResource
(ResourcePath path) Finds the resource at the given path, using an effective view of the resources in this project chain.validate()
Validate thisRuntimeProject
by following inheritable project projects until a root is found.Validate thisRuntimeProject
by following inheritable parent projects until a root is found.Methods inherited from class com.inductiveautomation.ignition.common.project.AbstractProject
addProjectResourceListener, getEffectiveResources, getListeners, getResources, getResourcesOfType, hasResourcesOfType, removeProjectResourceListener, updateEffectiveState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.common.project.Project
getDescription, getParent, getResource, getSingletonResource, getTitle, isEnabled, isInheritable, isRunnable
-
Constructor Details
-
RuntimeProject
public RuntimeProject(@Nonnull List<NamedManifest> projects, @Nonnull Map<ProjectResourceId, ProjectResource> resources)
-
-
Method Details
-
createAndValidate
public static RuntimeProject createAndValidate(@Nonnull List<NamedManifest> projects, @Nonnull Map<ProjectResourceId, ProjectResource> resources) throws ProjectInvalidException- Parameters:
projects
- the list ofNamedManifest
s that comprise the project hierarchy.resources
- theProjectResource
s for this project.- Returns:
- a validated
RuntimeProject
. - Throws:
ProjectInvalidException
- if validation fails.- See Also:
-
validate
Validate thisRuntimeProject
by following inheritable project projects until a root is found.- Returns:
- an
Optional
containing thisRuntimeProject
instance if it was validated.
-
validateOrThrow
Validate thisRuntimeProject
by following inheritable parent projects until a root is found.- Returns:
- this
RuntimeProject
instance. - Throws:
ProjectInvalidException
- if the project hierarchy is invalid.
-
getName
- Returns:
- the name of this Project.
-
getManifest
Description copied from interface:Project
Get theProjectManifest
for this Project.- Returns:
- the
ProjectManifest
for this Project.
-
getProjectInheritanceStructure
- Returns:
- A list of all of the projects and their manifests that comprise the inheritance chain of this project. This list is ordered in ascending inheritance order, from leaf project first to super-most project last.
-
getAllResources
Description copied from interface:Project
Get a List of all resources in this project and all parent projects.This includes resources belonging to parent projects in the inheritance chain if this is a "stack" of projects. This means that there may be multiple resources for any given
ResourcePath
.This project instance may not contain all resources that exist for the project on disk, depending on the
ResourceFilter
used to load it.- Returns:
- all the resources belonging to this project instance, including resources from parent projects.
-
getResource
Description copied from interface:Project
Finds the resource at the given path, using an effective view of the resources in this project chain.- Parameters:
path
- Not null- Returns:
- The matching project resource or empty if not found.
-
browse
- Parameters:
path
- the resourcePath of the folder to browse- Returns:
- an empty optional if the given path was not found or is not browseable, otherwise its direct children
-
getProjectSnapshots
Description copied from interface:Project
Gets the snapshots from the effective project, in order of project inheritance (leaf project last)- Returns:
- A list of ProjectSnapshots, one per project represented in the effective project.
-
applyChange
-
getEffectiveSnapshot
Get anRuntimeProject.EffectiveProjectSnapshot
.This snapshot can be used with
diff(EffectiveProjectSnapshot)
at some later time to obtain aProjectDiff
describing what has changed.- Returns:
- an effective
RuntimeProject.EffectiveProjectSnapshot
.
-
diff
public ProjectDiff.EffectiveDiff diff(RuntimeProject.EffectiveProjectSnapshot effectiveSnapshot) throws RuntimeProject.DiffException Get aProjectDiff
generated by diffing anRuntimeProject.EffectiveProjectSnapshot
fromgetEffectiveSnapshot()
with the current *effective* state of the project.- Parameters:
effectiveSnapshot
- anRuntimeProject.EffectiveProjectSnapshot
fromgetEffectiveSnapshot()
.- Returns:
- a
ProjectDiff
. - Throws:
RuntimeProject.DiffException
- if the diff cannot be completed because the project hierarchy changed since the snapshot was taken.
-