Package com._1c.g5.v8.dt.core.provider
Class TransactionalBmContentImporter
- java.lang.Object
-
- com._1c.g5.v8.dt.core.provider.BmContentImportSupport
-
- com._1c.g5.v8.dt.core.provider.TransactionalBmContentImporter
-
- All Implemented Interfaces:
IResourceContentImporter
- Direct Known Subclasses:
BaseBmBlobImporter
,BinaryResourceContentImporter
,StandardBmObjectImporter
public abstract class TransactionalBmContentImporter extends BmContentImportSupport implements IResourceContentImporter
Base importer implementation for simple scenarios with all data being imported as a single BM transaction, including pre/post-processing
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com._1c.g5.v8.dt.core.provider.BmContentImportSupport
BmContentImportSupport.ILoadOptionsProvider, BmContentImportSupport.LoadedData, BmContentImportSupport.NonCloseableHashingInputStream
-
Nested classes/interfaces inherited from interface com._1c.g5.v8.dt.core.provider.IResourceContentImporter
IResourceContentImporter.IMergeStrategy
-
-
Field Summary
-
Fields inherited from interface com._1c.g5.v8.dt.core.provider.IResourceContentImporter
PLATFORM_VERSION
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TransactionalBmContentImporter(IBmModelManager bmModelManager)
Constructs an instance
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description byte[]
computeSignature(InputStream content)
Computes signature.byte[]
handleResourceCreationOrModification(IBmNamespace namespace, IDtProject project, org.eclipse.core.runtime.IPath path, Supplier<InputStream> contentSupplier, boolean fullOverride, boolean executeInGlobalContext)
Handles resource creation or modification.protected abstract byte[]
handleResourceCreationOrModification(IBmPlatformTransaction transaction, IBmNamespace namespace, IDtProject project, org.eclipse.core.runtime.IPath path, InputStream content, boolean fullOverride)
Handles a data import process for an imported resourcevoid
handleResourceDeletion(IBmNamespace namespace, IDtProject project, org.eclipse.core.runtime.IPath path, boolean executeInGlobalContext)
Handles resource deletion.protected abstract void
handleResourceDeletion(IBmPlatformTransaction transaction, IBmNamespace namespace, IDtProject project, org.eclipse.core.runtime.IPath path)
Handles a data removal process for a removed resource-
Methods inherited from class com._1c.g5.v8.dt.core.provider.BmContentImportSupport
computeSha256Hash, doResourceLoad, executeTaskInContextIfNecessary, forceDerivedDataRebuild, getRuntimeVersion, loadData, resolveFqn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.v8.dt.core.provider.IResourceContentImporter
getOrder, supports
-
-
-
-
Constructor Detail
-
TransactionalBmContentImporter
protected TransactionalBmContentImporter(IBmModelManager bmModelManager)
Constructs an instance- Parameters:
bmModelManager
- Reference to theIBmModelManager
service. Cannot benull
-
-
Method Detail
-
computeSignature
public final byte[] computeSignature(InputStream content)
Description copied from interface:IResourceContentImporter
Computes signature.- Specified by:
computeSignature
in interfaceIResourceContentImporter
- Parameters:
content
- The imported content stream. May not benull
- Returns:
- A signature of the content. May be empty or
null
-
handleResourceCreationOrModification
public final byte[] handleResourceCreationOrModification(IBmNamespace namespace, IDtProject project, org.eclipse.core.runtime.IPath path, Supplier<InputStream> contentSupplier, boolean fullOverride, boolean executeInGlobalContext)
Description copied from interface:IResourceContentImporter
Handles resource creation or modification.- Specified by:
handleResourceCreationOrModification
in interfaceIResourceContentImporter
- Parameters:
namespace
- The targetIBmNamespace
. May not benull
project
- The targetIDtProject
. May not benull
path
- The imported resource path. May not benull
contentSupplier
- The imported content supplier. May not benull
. Implementations should support any number of context requests to support the re-import process in case of BM deadlocksfullOverride
- The full override mode switch. The full override mode replaces content of an old object completelly without mergeexecuteInGlobalContext
- The global editing context execution flag- Returns:
- A signature of the imported content. May be
null
or empty
-
handleResourceDeletion
public final void handleResourceDeletion(IBmNamespace namespace, IDtProject project, org.eclipse.core.runtime.IPath path, boolean executeInGlobalContext)
Description copied from interface:IResourceContentImporter
Handles resource deletion.- Specified by:
handleResourceDeletion
in interfaceIResourceContentImporter
- Parameters:
namespace
- The targetIBmNamespace
. May not benull
project
- The targetIDtProject
. May not benull
path
- The imported resource path. May not benull
executeInGlobalContext
- The global editing context execution flag
-
handleResourceCreationOrModification
protected abstract byte[] handleResourceCreationOrModification(IBmPlatformTransaction transaction, IBmNamespace namespace, IDtProject project, org.eclipse.core.runtime.IPath path, InputStream content, boolean fullOverride)
Handles a data import process for an imported resource- Parameters:
transaction
- The data import BM transaction. Nevernull
namespace
- The target BM namespace for an import. Nevernull
project
- The targetIDtProject
. Nevernull
path
- The imported resource path. May not benull
content
- The imported content stream. May not benull
fullOverride
- Data full override import mode- Returns:
- Signature of imported data. Never
null
-
handleResourceDeletion
protected abstract void handleResourceDeletion(IBmPlatformTransaction transaction, IBmNamespace namespace, IDtProject project, org.eclipse.core.runtime.IPath path)
Handles a data removal process for a removed resource- Parameters:
transaction
- The data import BM transaction. Nevernull
namespace
- The target BM namespace for an import. Nevernull
project
- TargetIDtProject
. Nevernull
path
- The removed resource path. May not benull
-
-