Class ChangeOperation
java.lang.Object
com.inductiveautomation.ignition.common.project.ChangeOperation
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- ChangeOperation.ManifestChangeOperation,- ChangeOperation.ResourceChangeOperation
Modifications to projects are defined as a series of ChangeOperations. The following operations can be performed:
 
- Create - a new resource is added.
- Delete - a resource is deleted
- Modify - a resource is modified.
- Manifest - the project manifest has been modified. The manifest is a description of the project- its name, parent, etc.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic enumstatic class
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Comparator<ChangeOperation>Comparator that orders ChangeOperations in the correct order to submit to a push
- 
Method SummaryModifier and TypeMethodDescriptionstatic Set<ProjectResourceId>changeOpsToIdSet(List<ChangeOperation> changes) Grabs all the project resource ids for the given changes and returns them as a set.abstract Stringstatic ProjectResourcestatic ProjectResourceIdnewCreateOp(ProjectResource resource) Create a newChangeOperation.CreateResourceOperationfor newly createdresource.newDeleteOp(ResourceSignature resourceSignature) Create a newChangeOperation.DeleteResourceOperationfor the resource identified byresourceSignature.newManifestChangeOp(String projectName, ProjectManifest manifest) Create a newChangeOperation.ManifestChangeOperationfor the project identified byprojectName.newManifestChangeOp(String projectName, ProjectManifest manifest, int baseHashCode) Create a newChangeOperation.ManifestChangeOperationfor the project identified byprojectName.newModifyOp(ProjectResource resource, ResourceSignature baseSignature) Create a newChangeOperation.ModifyResourceOperationfor aresourcethat has been modified.
- 
Field Details- 
CHANGE_SORTComparator that orders ChangeOperations in the correct order to submit to a push
 
- 
- 
Method Details- 
getOperationType- Returns:
- the ChangeOperation.OperationType.
 
- 
getProjectName- Returns:
- the name of the project the target of this operation belongs to.
 
- 
newCreateOpCreate a newChangeOperation.CreateResourceOperationfor newly createdresource.- Parameters:
- resource- the- ProjectResourcethat was created. Not null.
- Returns:
- a ChangeOperation.CreateResourceOperationforresource. Not null.
 
- 
newModifyOppublic static ChangeOperation.ModifyResourceOperation newModifyOp(ProjectResource resource, ResourceSignature baseSignature) Create a newChangeOperation.ModifyResourceOperationfor aresourcethat has been modified.Modify operations are expressed relative to a base ResourceSignature.- Parameters:
- resource- the modified- ProjectResource.
- baseSignature- the base- ResourceSignature.
- Returns:
- a ChangeOperation.ModifyResourceOperationforresource.
 
- 
newDeleteOppublic static ChangeOperation.DeleteResourceOperation newDeleteOp(ResourceSignature resourceSignature) Create a newChangeOperation.DeleteResourceOperationfor the resource identified byresourceSignature.- Parameters:
- resourceSignature- the- ResourceSignature.
- Returns:
- a ChangeOperation.DeleteResourceOperationforresourceId.
 
- 
newManifestChangeOppublic static ChangeOperation.ManifestChangeOperation newManifestChangeOp(String projectName, ProjectManifest manifest) Create a newChangeOperation.ManifestChangeOperationfor the project identified byprojectName.- Parameters:
- projectName- the name of the project with an updated manifest.
- Returns:
- a ChangeOperation.ManifestChangeOperationforprojectName.
 
- 
newManifestChangeOppublic static ChangeOperation.ManifestChangeOperation newManifestChangeOp(String projectName, ProjectManifest manifest, int baseHashCode) Create a newChangeOperation.ManifestChangeOperationfor the project identified byprojectName.- Parameters:
- projectName- the name of the project with an updated manifest.
- manifest- the updated- ProjectManifest.
- baseHashCode- the hashcode of the original- ProjectManifest(i.e. the unmodified manifest from the snapshot)
- Returns:
- a ChangeOperation.ManifestChangeOperationforprojectName.
 
- 
getResourceIdFromChange- Returns:
- the ProjectResourceIdofopif it is aChangeOperation.ResourceChangeOperation, otherwisenull.
 
- 
getResourceFromChange- Returns:
- the resource from the op if it is a ChangeOperation.CreateResourceOperationorChangeOperation.ModifyResourceOperation, otherwise null
 
- 
changeOpsToIdSetGrabs all the project resource ids for the given changes and returns them as a set.
 
-