Interface IComparisonDataSource
- All Known Subinterfaces:
IActiveComparisonDataSource
- All Known Implementing Classes:
ActiveDtProjectDataSource
,DtProjectDataSource
,LibraryComparisonDataSource
,OverlayComparisonDataSource
public interface IComparisonDataSource
The data source of a side of a comparison process.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionBegins the data source operation transaction.boolean
fileExists
(Path path) Checks whether a file for the specified path exists.Gets the BM model associated with the sourcegetCollectionSymlinks
(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.Returns the distribution support information for this data source.Gets theIDtProject
instance associated with this data source and related to the project being represented by this sourcegetFileListRecursively
(Path path) Returns the file list for given folder path and all its subfolders.getFileStream
(Path path) Returns a file stream for the specified path.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.Gets the path for the given symlink andEClass
Class contextReturns project name for this data source.Returns the stored project nature.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.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.getSymlinksOfTopObjects
(org.eclipse.xtext.scoping.IScopeProvider scopeProvider, List<org.eclipse.emf.ecore.EClass> eClasses) Gets all top level object symlinks for a given set ofEClass
'es.Gets the target runtime version for the project behind this sourceorg.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
Gets top-level object Id by FQN.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.
-
Field Details
-
PROJECT_SOURCE_FOLDER
Standard folder of EDT project sources- See Also:
-
PROJECT_FILE
Standard name of the Eclipse project descriptor file- See Also:
-
-
Method Details
-
prepareTopObjectInfos
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 benull
-
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, notnull
; an exception will be thrown for an invalid or a non-top object argumenteClass
- TheEClass
that defines the context of the symlink resolution, may benull
- 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, notnull
reference
- the reference feature, notnull
eObject
- the referenced object, notnull
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, notnull
reference
- the referencing feature, notnull
, must be single referenceeObject
- the referenced object, notnull
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, notnull
collectionReference
- the referencing feature, notnull
, must be multi-referencescopeProvider
- the scope provider- Returns:
- a list of symbolic links, never
null
-
getFileStream
Returns a file stream for the specified path.- Parameters:
path
- the string with the path- Returns:
- the input stream
-
topObjectExists
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 ofEClass
'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 benull
eClasses
- the given set ofEClass
'es, may benull
- Returns:
- all top level object symlinks for a given set of
EClass
'es, nevernull
-
beginTransaction
IComparisonDataSourceTransaction beginTransaction()Begins the data source operation transaction.- Returns:
- The newly started transaction. Cannot be
null
-
getFileListRecursively
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 benull
- Returns:
- the list of relative file paths, never
null
-
getProjectNature
String getProjectNature()Returns the stored project nature.- Returns:
- the stored project nature, may be
ICoreConstants.V8_CONFIGURATION_NATURE
orICoreConstants.V8_EXTENSION_NATURE
orICoreConstants.V8_EXTERNAL_OBJECTS_NATURE
ornull
if the data source does not store V8 project
-
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
Checks whether a file for the specified path exists.- Parameters:
path
- the specified path to check the existence for, cannot benull
- 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
Gets the path for the given symlink andEClass
Class 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 benull
-
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 benull
-
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 benull
-
isOverlayOf
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 theIDtProject
instance associated with this data source and related to the project being represented by this source- Returns:
- The
IDtProject
instance. May not benull
-
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
Gets top-level object Id by FQN.- Parameters:
fqn
- the FQN to get Id by, may not benull
- Returns:
- the Id or
-1L
if there is no object with the specified FQN
-