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 locationunder the following structure:
$storeName/$projectName/*
To utilizeStandardSnapshotParticipantthe plugin declares its stores in the extension declaration in itsplugin.xml. For more information seecom.e1c.g5.v8.snapshot.participantsextension point schema.Standard snapshot participant does not contribute any metadata, only files.
Example:
Consider a plugin maintaining two metadata stores
store_aandstore_b. Data for different projects is kept separately in each store. Files with.tmpextension instore_bmust not be included in snapshots. Given that there is two projectP1andP2in 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 voidconfigure(org.eclipse.core.resources.IProject project, ISnapshotConfigurator configurator)Requests the participant to configure snapshot.intgetFormatVersion()Gets format version of the snapshot participant.voidsetInitializationData(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:
setInitializationDatain 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:ISnapshotParticipantRequests the participant to configure snapshot. Called some time before snapshot creation and restoration.- Specified by:
configurein interfaceISnapshotParticipant- Parameters:
project- the project for which snapshot is going to be created, cannot benullconfigurator- the configurator to configure snapshot, cannot benull
-
getFormatVersion
public int getFormatVersion()
Description copied from interface:ISnapshotParticipantGets 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:
getFormatVersionin interfaceISnapshotParticipant- Returns:
- the format version of the participant
-
-