The <snapshot> element is a child of the <snapshotList> element and defines a sequence of steps to be executed in order to capture the installed state this component. When a <createSnapshot> or <addSnapshot> step names this snapshot block, the steps within the <prepare> block are executed in order, then files named with the <capture> block are captured within the capture area of the target machine, and finally steps within the <cleanup> block are executed in order.
A snapshot block is also used to compare the current state of a component against its state at the time of installation. In particular, the <prepare> steps are re-executed at the target machine, then files captured at install time are compared against the current state of the files, and the <cleanup> steps are re-executed.
Name |
Type |
Required |
Configurable |
Description |
---|---|---|---|---|
name |
entityName |
Yes |
No |
The name of the snapshot block. The name must be unique among all snapshot blocks in the containing <snapshotList>. |
description |
String |
No |
No |
A description of the snapshot block. Useful for documentation purposes. |
The "access" attribute of the <snapshot> element specifies the accessibility of the snapshot block.
If PUBLIC, access is not restricted in any way.
If PROTECTED, access is limited to derived components and entities in the same path.
If PATH, access is limited to entities in the same path.
If PRIVATE, access is limited to this component.
The "modifier" attribute of the <snapshot> element specifies the override requirements for the snapshot block.
If ABSTRACT, the block may not include a body. The body must be specified by non-abstract derived components. Snapshot blocks may only be declared abstract if the component is also declared abstract. Abstract blocks may not be private. Non-abstract blocks must declare a body.
If FINAL, the snapshot block may not be overridden by derived components.
If unspecified, then derived components can choose whether or not to override the block.
Name |
How Many? |
Description |
---|---|---|
paramList |
0 or 1 |
A list of parameters for use within the prepare, capture and cleanup blocks of this snapshot. |
varList |
0 or 1 |
A list of local variables for use within the prepare, capture and cleanup blocks of this snapshot. |
prepare |
0 or 1 |
Contains steps to be executed in preparation for the file capture or comparison. |
capture |
0 or 1 |
Contains a list of files and directories to be captured as part of this snapshot |
cleanup |
0 or 1 |
Contains steps to be executed after the capture or comparison has completed. |
If this snapshot is to be called from a <createSnapshot> step, then it may not declare any required parameters in its <paramList> element.
The varList, prepare, capture and cleanup elements collectively define the body of the snapshot. The body is not included if the snapshot block is declared abstract.
By default, a derived component inherits all accessible snapshot blocks of its base component. Semantics for overriding a snapshot block are the same as those for overriding an install block.
There is no way to call the base component snapshot block"s prepare block from a derived component snapshot block"s prepare block. Same goes for cleanup. To do this, the base component must factor its prepare/cleanup steps into a control block that may be called by the derived component.