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
public class StandardSnapshotParticipant extends AbstractSnapshotParticipant implements org.eclipse.core.runtime.IExecutableExtension
Standard snapshot participant assumes that the plugin stores metadata in itsstate location
under the following structure:
$storeName/$projectName/*
To utilizeStandardSnapshotParticipant
the plugin declares its stores in the extension declaration in itsplugin.xml
. For more information seecom.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
andstore_b
. Data for different projects is kept separately in each store. Files with.tmp
extension instore_b
must not be included in snapshots. Given that there is two projectP1
andP2
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 Constructor Description StandardSnapshotParticipant()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(org.eclipse.core.resources.IProject project, ISnapshotConfigurator configurator)
Requests the participant to configure snapshot.int
getFormatVersion()
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
-
-
-
-
Method Detail
-
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
-
-