Interface IComparisonDataSource

  • All Known Subinterfaces:
    IActiveComparisonDataSource

    public interface IComparisonDataSource
    The data source of a side of a comparison process.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      IComparisonDataSourceTransaction beginTransaction()
      Begins the data source operation transaction.
      boolean fileExists​(Path path)
      Checks whether a file for the specified path exists.
      IBmModel getBmModel()
      Gets the BM model associated with the source
      List<String> getCollectionSymlinks​(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference collectionReference, org.eclipse.xtext.scoping.IScopeProvider scopeProvider)
      Returns a list of symbolic links for objects owned by this data source and referenced by the specified multi-reference from the specified context object.
      DistributionDescription getDistributionDescription()
      Returns the distribution support information for this data source.
      IDtProject getDtProject()
      Gets the IDtProject instance associated with this data source and related to the project being represented by this source
      List<Path> getFileListRecursively​(Path path)
      Returns the file list for given folder path and all its subfolders.
      InputStream getFileStream​(Path path)
      Returns a file stream for the specified path.
      IModelEditingSupport getModelEditingSupport()
      Returns the model editing support provider for this data source.
      org.eclipse.emf.ecore.EObject getObjectById​(long id)
      Returns an object by the specified Id.
      String getPath​(String symlink, org.eclipse.emf.ecore.EClass eClass)
      Gets the path for the given symlink and EClassClass context
      String getProjectName()
      Returns project name for this data source.
      String getProjectNature()
      Returns the stored project nature.
      String getSymlink​(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EObject eObject, org.eclipse.xtext.scoping.IScopeProvider scopeProvider)
      Returns a symbolic link for an object owned by this data source.
      String getSymlink​(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, org.eclipse.xtext.scoping.IScopeProvider scopeProvider)
      Returns a symbolic link for an object owned by this data source, as defined by a single reference from a context object.
      Map<org.eclipse.emf.ecore.EClass,​List<String>> getSymlinksOfTopObjects​(org.eclipse.xtext.scoping.IScopeProvider scopeProvider, List<org.eclipse.emf.ecore.EClass> eClasses)
      Gets all top level object symlinks for a given set of EClass'es.
      Version getTargetRuntimeVersion()
      Gets the target runtime version for the project behind this source
      org.eclipse.emf.ecore.EObject getTopLevelObject​(String symlink, org.eclipse.emf.ecore.EClass eClass)
      Returns a top-level MD object by the specified symbolic link.
      long getTopObjectIdByFqn​(String fqn)
      Gets top-level object Id by FQN.
      DataSourceType getType()
      Gets the type of the data source.
      boolean isOverlayOf​(IComparisonDataSource comparisonDataSource)
      Checks if this data source overlays the provided source.
      void prepareTopObjectInfos​(List<TopObjectInfo> topObjectInfos)
      Prepares information for the specified top objects.
      void startIfNecessary​(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
      Starts the data source in the flow of the comparison session creation.
      void stop()
      Stops the data source in the flow of the comprison session closure.
      void synchronize​(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
      Synchronizes the data source with external changes being made to this source.
      boolean topObjectExists​(String symlink, org.eclipse.emf.ecore.EClass eClass)
      Checks if the referenced top object exists in the data source.
    • Method Detail

      • prepareTopObjectInfos

        void prepareTopObjectInfos​(List<TopObjectInfo> topObjectInfos)
        Prepares information for the specified top objects. Deletes top object info if the referenced top object doesn't exist in the data source.
        Parameters:
        topObjectInfos - the list of top object information containers, cannot be null
      • getTopLevelObject

        org.eclipse.emf.ecore.EObject getTopLevelObject​(String symlink,
                                                        org.eclipse.emf.ecore.EClass eClass)
        Returns a top-level MD object by the specified symbolic link.
        Parameters:
        symlink - the symbolic link (FQN) of the MD object, not null; an exception will be thrown for an invalid or a non-top object argument
        eClass - The EClass that defines the context of the symlink resolution, may be null
        Returns:
        the object, never null
      • getSymlink

        String getSymlink​(org.eclipse.emf.ecore.EObject context,
                          org.eclipse.emf.ecore.EReference reference,
                          org.eclipse.emf.ecore.EObject eObject,
                          org.eclipse.xtext.scoping.IScopeProvider scopeProvider)
        Returns a symbolic link for an object owned by this data source.
        Parameters:
        context - the referencing object, not null
        reference - the reference feature, not null
        eObject - the referenced object, not null
        scopeProvider - the scope provider
        Returns:
        the symbolic link, never null
      • getSymlink

        String getSymlink​(org.eclipse.emf.ecore.EObject context,
                          org.eclipse.emf.ecore.EReference reference,
                          org.eclipse.xtext.scoping.IScopeProvider scopeProvider)
        Returns a symbolic link for an object owned by this data source, as defined by a single reference from a context object.
        Parameters:
        context - the referencing object, not null
        reference - the referencing feature, not null, must be single reference
        eObject - the referenced object, not null
        scopeProvider - the scope provider
        Returns:
        the symbolic link, never null
      • getCollectionSymlinks

        List<String> getCollectionSymlinks​(org.eclipse.emf.ecore.EObject context,
                                           org.eclipse.emf.ecore.EReference collectionReference,
                                           org.eclipse.xtext.scoping.IScopeProvider scopeProvider)
        Returns a list of symbolic links for objects owned by this data source and referenced by the specified multi-reference from the specified context object.
        Parameters:
        context - the referencing object, not null
        collectionReference - the referencing feature, not null, must be multi-reference
        scopeProvider - the scope provider
        Returns:
        a list of symbolic links, never null
      • getFileStream

        InputStream getFileStream​(Path path)
        Returns a file stream for the specified path.
        Parameters:
        path - the string with the path
        Returns:
        the input stream
      • topObjectExists

        boolean topObjectExists​(String symlink,
                                org.eclipse.emf.ecore.EClass eClass)
        Checks if the referenced top object exists in the data source. The implementation of this method should be as quick as possible.
        Parameters:
        symlink - The symlink to check existence for.
        eClass - The eClass of expected object.
        Returns:
        True if the data source is able to retrieve referenced object; false otherwise.
      • getTargetRuntimeVersion

        Version getTargetRuntimeVersion()
        Gets the target runtime version for the project behind this source
        Returns:
        The version of the target 1C runtime. Cannot be null
      • getSymlinksOfTopObjects

        Map<org.eclipse.emf.ecore.EClass,​List<String>> getSymlinksOfTopObjects​(org.eclipse.xtext.scoping.IScopeProvider scopeProvider,
                                                                                     List<org.eclipse.emf.ecore.EClass> eClasses)
        Gets all top level object symlinks for a given set of EClass'es. If this data source is associated with Configuration-aware project, the order of the returned instances will be the same as in the corresponding collection of the Configuration.
        Parameters:
        scopeProvider - the scope provider for symbolic links, cannot be null
        eClasses - the given set of EClass'es, may be null
        Returns:
        all top level object symlinks for a given set of EClass'es, never null
      • beginTransaction

        IComparisonDataSourceTransaction beginTransaction()
        Begins the data source operation transaction.
        Returns:
        The newly started transaction. Cannot be null
      • getFileListRecursively

        List<Path> getFileListRecursively​(Path path)
        Returns the file list for given folder path and all its subfolders.
        Parameters:
        path - the relative folder path to get the file list for, can not be null
        Returns:
        the list of relative file paths, never null
      • getProjectName

        String getProjectName()
        Returns project name for this data source.
        Returns:
        the project name, never null
      • getModelEditingSupport

        IModelEditingSupport getModelEditingSupport()
        Returns the model editing support provider for this data source.
        Returns:
        the model editing support provider or null if no provider for this data source was specified
      • getDistributionDescription

        DistributionDescription getDistributionDescription()
        Returns the distribution support information for this data source.
        Returns:
        the distribution support information or null if no information for this data source was specified
      • fileExists

        boolean fileExists​(Path path)
        Checks whether a file for the specified path exists.
        Parameters:
        path - the specified path to check the existence for, cannot be null
        Returns:
        true if the file exists, false otherwise
      • getType

        DataSourceType getType()
        Gets the type of the data source.
        Returns:
        The type of the data source. May not be null
      • getPath

        String getPath​(String symlink,
                       org.eclipse.emf.ecore.EClass eClass)
        Gets the path for the given symlink and EClassClass context
        Parameters:
        symlink - The symlink to check existence for.
        eClass - The eClass of expected object.
        Returns:
        The String representation of the path within the source. May be null
      • startIfNecessary

        void startIfNecessary​(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
        Starts the data source in the flow of the comparison session creation. Implementation should take care about multiple attempts of start request being submitted to the data source
        Parameters:
        progressMonitor - Progress monitor of a start sequence. May not be null
      • stop

        void stop()
        Stops the data source in the flow of the comprison session closure. Should be failure-proof to not hinder othe sources sequential stops
      • synchronize

        void synchronize​(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
        Synchronizes the data source with external changes being made to this source. Until this method call the data source should store any change tasks without applying
        Parameters:
        progressMonitor - Progress monitor of a update/synchronization sequence. May not be null
      • isOverlayOf

        boolean isOverlayOf​(IComparisonDataSource comparisonDataSource)
        Checks if this data source overlays the provided source. Used to syncrhonize the data in case of underlying data source data changes
        Returns:
      • getBmModel

        IBmModel getBmModel()
        Gets the BM model associated with the source
        Returns:
        The BM model instance. May not be null
      • getDtProject

        IDtProject getDtProject()
        Gets the IDtProject instance associated with this data source and related to the project being represented by this source
        Returns:
        The IDtProject instance. May not be null
      • getObjectById

        org.eclipse.emf.ecore.EObject getObjectById​(long id)
        Returns an object by the specified Id.
        Parameters:
        id - the Id
        Returns:
        the object found or null
      • getTopObjectIdByFqn

        long getTopObjectIdByFqn​(String fqn)
        Gets top-level object Id by FQN.
        Parameters:
        fqn - the FQN to get Id by, may not be null
        Returns:
        the Id or -1L if there is no object with the specified FQN