Interface IComparisonDataSource
-
- All Known Subinterfaces:
IActiveComparisonDataSource
public interface IComparisonDataSourceThe data source of a side of a comparison process.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROJECT_FILEStandard name of the Eclipse project descriptor filestatic StringPROJECT_SOURCE_FOLDERStandard folder of EDT project sources
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IComparisonDataSourceTransactionbeginTransaction()Begins the data source operation transaction.booleanfileExists(Path path)Checks whether a file for the specified path exists.IBmModelgetBmModel()Gets the BM model associated with the sourceList<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.DistributionDescriptiongetDistributionDescription()Returns the distribution support information for this data source.IDtProjectgetDtProject()Gets theIDtProjectinstance associated with this data source and related to the project being represented by this sourceList<Path>getFileListRecursively(Path path)Returns the file list for given folder path and all its subfolders.InputStreamgetFileStream(Path path)Returns a file stream for the specified path.IModelEditingSupportgetModelEditingSupport()Returns the model editing support provider for this data source.org.eclipse.emf.ecore.EObjectgetObjectById(long id)Returns an object by the specified Id.StringgetPath(String symlink, org.eclipse.emf.ecore.EClass eClass)Gets the path for the given symlink andEClassClass contextStringgetProjectName()Returns project name for this data source.StringgetProjectNature()Returns the stored project nature.StringgetSymlink(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.StringgetSymlink(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 ofEClass'es.VersiongetTargetRuntimeVersion()Gets the target runtime version for the project behind this sourceorg.eclipse.emf.ecore.EObjectgetTopLevelObject(String symlink, org.eclipse.emf.ecore.EClass eClass)Returns a top-level MD object by the specified symbolic link.longgetTopObjectIdByFqn(String fqn)Gets top-level object Id by FQN.DataSourceTypegetType()Gets the type of the data source.booleanisOverlayOf(IComparisonDataSource comparisonDataSource)Checks if this data source overlays the provided source.voidprepareTopObjectInfos(List<TopObjectInfo> topObjectInfos)Prepares information for the specified top objects.voidstartIfNecessary(org.eclipse.core.runtime.IProgressMonitor progressMonitor)Starts the data source in the flow of the comparison session creation.voidstop()Stops the data source in the flow of the comprison session closure.voidsynchronize(org.eclipse.core.runtime.IProgressMonitor progressMonitor)Synchronizes the data source with external changes being made to this source.booleantopObjectExists(String symlink, org.eclipse.emf.ecore.EClass eClass)Checks if the referenced top object exists in the data source.
-
-
-
Field Detail
-
PROJECT_SOURCE_FOLDER
static final String PROJECT_SOURCE_FOLDER
Standard folder of EDT project sources- See Also:
- Constant Field Values
-
PROJECT_FILE
static final String PROJECT_FILE
Standard name of the Eclipse project descriptor file- See Also:
- Constant Field Values
-
-
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 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- TheEClassthat 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, notnullreference- the reference feature, notnulleObject- the referenced object, notnullscopeProvider- 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, notnullreference- the referencing feature, notnull, must be single referenceeObject- the referenced object, notnullscopeProvider- 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, notnullcollectionReference- the referencing feature, notnull, must be multi-referencescopeProvider- 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 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 benulleClasses- 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
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 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_NATUREorICoreConstants.V8_EXTENSION_NATUREorICoreConstants.V8_EXTERNAL_OBJECTS_NATUREornullif 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
nullif 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
nullif 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 benull- Returns:
trueif the file exists,falseotherwise
-
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 andEClassClass context- Parameters:
symlink- The symlink to check existence for.eClass- The eClass of expected object.- Returns:
- The
Stringrepresentation 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
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 theIDtProjectinstance associated with this data source and related to the project being represented by this source- Returns:
- The
IDtProjectinstance. 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
long getTopObjectIdByFqn(String fqn)
Gets top-level object Id by FQN.- Parameters:
fqn- the FQN to get Id by, may not benull- Returns:
- the Id or
-1Lif there is no object with the specified FQN
-
-