Class 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 its 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 Detail

      • StandardSnapshotParticipant

        public StandardSnapshotParticipant()
    • 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 interface org.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 interface ISnapshotParticipant
        Parameters:
        project - the project for which snapshot is going to be created, cannot be null
        configurator - the configurator to configure snapshot, cannot be null
      • 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 interface ISnapshotParticipant
        Returns:
        the format version of the participant