Class StandardSnapshotParticipant
java.lang.Object
com.e1c.g5.v8.snapshot.participation.AbstractSnapshotParticipant
com.e1c.g5.v8.snapshot.participation.StandardSnapshotParticipant
- All Implemented Interfaces:
ISnapshotParticipant
,org.eclipse.core.runtime.IExecutableExtension
- Direct Known Subclasses:
FormModelSnapshotParticipant
public class StandardSnapshotParticipant
extends AbstractSnapshotParticipant
implements org.eclipse.core.runtime.IExecutableExtension
Standard snapshot participant assumes that the plugin stores metadata in its
To utilize
state location
under the following structure:$storeName/$projectName/*
To utilize
StandardSnapshotParticipant
the plugin declares its stores in the extension declaration in its
plugin.xml
. For more information see com.e1c.g5.v8.snapshot.participants
extension point
schema.
Standard snapshot participant does not contribute any metadata, only files.
Example:
Consider a plugin maintaining two metadata stores store_a
and store_b
. Data for different
projects is kept separately in each store. Files with .tmp
extension in store_b
must not be included
in snapshots. Given that there is two project P1
and P2
in the workspace, directory structure
in the plugin state location is the following:
store_a/P1/ store_a/P2/ store_b/P1/ store_b/P2/To participate in snapshot creation/restoration process such plugin may declare the corresponding extension using standard snapshot participant.
<extension point="com.e1c.g5.v8.snapshot.participants">
<stores id="id_required">
<store name="first" />
<store name="second">
<except pattern=".*\.tmp" />
</store>
</stores>
</extension>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(org.eclipse.core.resources.IProject project, ISnapshotConfigurator configurator) Requests the participant to configure snapshot.int
Gets format version of the snapshot participant.void
setInitializationData
(org.eclipse.core.runtime.IConfigurationElement config, String propertyName, Object data) Methods inherited from class com.e1c.g5.v8.snapshot.participation.AbstractSnapshotParticipant
contributeMetadata, restoreMetadata
-
Constructor Details
-
StandardSnapshotParticipant
public StandardSnapshotParticipant()
-
-
Method Details
-
setInitializationData
public void setInitializationData(org.eclipse.core.runtime.IConfigurationElement config, String propertyName, Object data) throws org.eclipse.core.runtime.CoreException - Specified by:
setInitializationData
in interfaceorg.eclipse.core.runtime.IExecutableExtension
- Throws:
org.eclipse.core.runtime.CoreException
-
configure
public void configure(org.eclipse.core.resources.IProject project, ISnapshotConfigurator configurator) Description copied from interface:ISnapshotParticipant
Requests the participant to configure snapshot. Called some time before snapshot creation and restoration.- Specified by:
configure
in interfaceISnapshotParticipant
- Parameters:
project
- the project for which snapshot is going to be created, cannot benull
configurator
- the configurator to configure snapshot, cannot benull
-
getFormatVersion
public int getFormatVersion()Description copied from interface:ISnapshotParticipant
Gets format version of the snapshot participant. Whenever the format version of a participant does not match the format version stored in a snapshot for this participant, the snapshot is considered invalid and cannot be restored.Snapshot participants are encouraged to smoothly migrate their data. The format version must be increased only if migration is impossible or too heavy.
- Specified by:
getFormatVersion
in interfaceISnapshotParticipant
- Returns:
- the format version of the participant
-