Package com._1c.g5.v8.bm.core
Interface IBmEngine
-
public interface IBmEngine
Former entry point for all interactions with the BM object storage engine. The interface is preserved to simplify migration of the existing solutions to the new API (
BmPlatform
).Note that each engine is bound to a particular namespace and all the data requests will be directed to that namespace.
Engines are obtained via
IBmNamespace.asEngine()
call.- See Also:
BmPlatform
,IBmNamespace
,IBmNamespace.asEngine()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description IBmNamespace
asNamespace()
Gets the namespace this engine is bound to.IBmTransaction
beginNonCommittableTransaction()
Deprecated.For internal use only, will be removed somedayIBmTransaction
beginReadOnlyTransaction()
Begins a read-only transaction.IBmTransaction
beginReadOnlyTransaction(boolean lightweight)
Begins a read-only transaction.IBmTransaction
beginReadWriteTransaction()
Begins a read-write transaction.IBmTransaction
beginReadWriteTransaction(boolean trackModifications)
Begins a read-write transaction.IBmTransaction
beginReadWriteTransaction(boolean trackModifications, boolean disableEvents, Object operationId, Object serviceId)
Begins a read-write transaction.IBmTransaction
beginReadWriteTransaction(boolean trackModifications, Object operationId, Object serviceId)
Begins a read-write transaction.List<IBmCrossReference>
getBackReferences(IBmObject object)
Gets a list of references to the specified object from objects residing in the namespace this engine is bound to.IBmTransaction
getCurrentTransaction()
Gets the transaction currently open in the calling thread.org.eclipse.emf.ecore.EClass
getEClassByIndex(int index)
Deprecated.theEClass
<=>int
mapping has been introduced for internal use only.int
getEClassIndex(org.eclipse.emf.ecore.EClass eClass)
Deprecated.theEClass
<=>int
mapping has been introduced for internal use only.org.eclipse.emf.ecore.resource.Resource
getExternalResource(org.eclipse.emf.common.util.URI uri)
Deprecated.This method has been introduced only to support legacy solutions which for some reason use BM to resolve platform, BSL and other resources.Collection<IBmExternalUriResolver>
getExternalUriResolvers()
Deprecated.BM holds a collection of external URI resolvers for internal use (particularly to perform seamless resolution of references to objects stored outside BM like platform objects, BSL, Moxel and so on) and not for providing the collection to BM users.String
getId()
Gets the identifier of the engine (the name of the underlying namespace).IBmObject
getObjectById(long id)
Gets object by ID in the namespace this engine is bound to.int
getObjectResourceId(long id)
Get the ID of the resource the object with the given ID belongs to.org.eclipse.emf.ecore.resource.ResourceSet
getProxyResourceSet(boolean onlyBmResources)
Deprecated.IBmResourceSet
getResourceSet()
Deprecated.BM resource set has been introduced for internal use to provide partial EMF support and is not supposed to be used directly by clients.IBmObject
getTopObjectByFqn(String fqn)
Gets top object by FQN in the namespace this engine is bound to.IBmObject
getTopObjectByResourceId(int resourceId)
Gets top object by resource ID in the namespace this engine is bound to.long
getTopObjectId(long id)
Gets top object ID by the specified object ID.boolean
isActive()
Checks if the engine (the underlying namespace) is active.boolean
isTopObjectId(long id)
Checks if the specified ID belongs to a top object.org.eclipse.emf.ecore.EObject
resolve(org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.EClass targetEClass)
Deprecated.This method has been introduced only to support legacy solutions which for some reason use BM to resolve platform, BSL and other resources.
-
-
-
Method Detail
-
isActive
boolean isActive()
Checks if the engine (the underlying namespace) is active.- Returns:
true
if the engine is active,false
otherwise.
-
getId
String getId()
Gets the identifier of the engine (the name of the underlying namespace).- Returns:
- the identifier of the engine, never
null
.
-
getCurrentTransaction
IBmTransaction getCurrentTransaction()
Gets the transaction currently open in the calling thread.- Returns:
- the transaction or
null
if no transaction is open in the thread.
-
beginReadOnlyTransaction
IBmTransaction beginReadOnlyTransaction()
Begins a read-only transaction.- Returns:
- the created transaction instance, never
null
.
-
beginReadOnlyTransaction
IBmTransaction beginReadOnlyTransaction(boolean lightweight)
Begins a read-only transaction. In contrast to its zero-argument counterpart this method allows to create a lightweight transaction.- Parameters:
lightweight
- Iftrue
begins a lightweight transaction that purges its internal cache of read objects.- Returns:
- the created transaction instance, never
null
.
-
beginReadWriteTransaction
IBmTransaction beginReadWriteTransaction()
Begins a read-write transaction.- Returns:
- the created transaction instance, never
null
.
-
beginReadWriteTransaction
IBmTransaction beginReadWriteTransaction(boolean trackModifications)
Begins a read-write transaction. In contrast to its zero-argument counterpart this method allows to say the transaction to track modifications. In this case the transaction commit result will contain information about the modified resources and so on.- Parameters:
trackModifications
- The flag showing whether the modifications performed in this transaction must be tracked.- Returns:
- the created transaction instance, never
null
.
-
beginReadWriteTransaction
IBmTransaction beginReadWriteTransaction(boolean trackModifications, Object operationId, Object serviceId)
Begins a read-write transaction. In contrast to its one-argument counterpart this method allows to specify the operation and service ID that can later be used e.g. to classify events. In this case the transaction commit result will contain information about the modified resources and so on.- Parameters:
trackModifications
- The flag showing whether the modifications performed in this transaction must be tracked.operationId
- The ID of the operation executed in this transaction. May benull
.serviceId
- The ID of the service executing the operation. May benull
.- Returns:
- the created transaction instance, never
null
.
-
beginReadWriteTransaction
IBmTransaction beginReadWriteTransaction(boolean trackModifications, boolean disableEvents, Object operationId, Object serviceId)
Begins a read-write transaction. In contrast to its one-argument counterpart this method allows to specify the operation and service ID that can later be used e.g. to classify events. In this case the transaction commit result will contain information about the modified resources and so on.- Parameters:
trackModifications
- The flag showing whether the modifications performed in this transaction must be tracked.disableEvents
- The flag that disables sending of modification events during the commit of the transactionoperationId
- The ID of the operation executed in this transaction. May benull
.serviceId
- The ID of the service executing the operation. May benull
.- Returns:
- the created transaction instance, never
null
.
-
beginNonCommittableTransaction
@Deprecated IBmTransaction beginNonCommittableTransaction()
Deprecated.For internal use only, will be removed somedayBegins a non-commitable read-write transaction. This method isn't the part of the public API and shouldn't be used by clients- Returns:
- the created transaction instance, never
null
.
-
getObjectById
IBmObject getObjectById(long id)
Gets object by ID in the namespace this engine is bound to.- Parameters:
id
- The ID to get object by.- Returns:
- the object with the specified ID if exists, otherwise
null
.
-
getTopObjectByFqn
IBmObject getTopObjectByFqn(String fqn)
Gets top object by FQN in the namespace this engine is bound to.- Parameters:
fqn
- The FQN to get object by. May not benull
.- Returns:
- the top object with the specified FQN if exists, otherwise
null
.
-
getTopObjectByResourceId
IBmObject getTopObjectByResourceId(int resourceId)
Gets top object by resource ID in the namespace this engine is bound to.- Parameters:
resourceId
- The resource ID to get object by.- Returns:
- the top object belonging to the resource specified by ID if exists, otherwise
null
.
-
getTopObjectId
long getTopObjectId(long id)
Gets top object ID by the specified object ID.- Parameters:
id
- The object ID- Returns:
- the ID of the top object
- Since:
- 5.2.0
-
isTopObjectId
boolean isTopObjectId(long id)
Checks if the specified ID belongs to a top object.- Parameters:
id
- The ID to run the check against.- Returns:
true
if the specified ID belongs to a top object, otherwisefalse
l
-
getObjectResourceId
int getObjectResourceId(long id)
Get the ID of the resource the object with the given ID belongs to.- Parameters:
id
- The object ID.- Returns:
- the ID of the resource.
-
getExternalResource
@Deprecated org.eclipse.emf.ecore.resource.Resource getExternalResource(org.eclipse.emf.common.util.URI uri)
Deprecated.This method has been introduced only to support legacy solutions which for some reason use BM to resolve platform, BSL and other resources.Gets external resource by URI.- Parameters:
uri
- The URI to get resource by. May not benull
.- Returns:
- the external resource with the specified URI if exists, otherwise
null
.
-
resolve
@Deprecated org.eclipse.emf.ecore.EObject resolve(org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.EClass targetEClass)
Deprecated.This method has been introduced only to support legacy solutions which for some reason use BM to resolve platform, BSL and other resources.Resolves external object by URI.- Parameters:
uri
- The URI to get object by. May not benull
.targetEClass
- The type of the target object. It does not participate in resolving process but if specified is used to create a proxy instance in case resolution fails. May benull
.- Returns:
- if object is resolved it is returnted. If object is not resolve and the second argument is specified a
proxy is returned. Otherwise
null
is returned.
-
getExternalUriResolvers
@Deprecated Collection<IBmExternalUriResolver> getExternalUriResolvers()
Deprecated.BM holds a collection of external URI resolvers for internal use (particularly to perform seamless resolution of references to objects stored outside BM like platform objects, BSL, Moxel and so on) and not for providing the collection to BM users. However the current implementation of the BSL mechanism uses this method to gain access to the contributed instance of XtextBmLinkProvider. When this solution will be improved this method will be removed.Gets registered external URI resolvers.- Returns:
- the collection of the registered external URI resolvers, never
null
.
-
getResourceSet
@Deprecated IBmResourceSet getResourceSet()
Deprecated.BM resource set has been introduced for internal use to provide partial EMF support and is not supposed to be used directly by clients.Gets BM resource set.- Returns:
- the BM resources set, never
null
.
-
getBackReferences
List<IBmCrossReference> getBackReferences(IBmObject object)
Gets a list of references to the specified object from objects residing in the namespace this engine is bound to.- Parameters:
object
- The object to get the list of references to. May not benull
.- Returns:
- the list of references, never
null
.
-
getEClassByIndex
@Deprecated org.eclipse.emf.ecore.EClass getEClassByIndex(int index)
Deprecated.theEClass
<=>int
mapping has been introduced for internal use only.GetsEClass
by its index.- Parameters:
index
- The index to getEClass
by.- Returns:
- the
EClass
identified by the specified index if exists, otherwisenull
.
-
getEClassIndex
@Deprecated int getEClassIndex(org.eclipse.emf.ecore.EClass eClass)
Deprecated.theEClass
<=>int
mapping has been introduced for internal use only.Gets index assigned to the specifiedEClass
.- Parameters:
eClass
- theEClass
to get index for. May not benull
.- Returns:
- the index assigned to the
EClass
.
-
getProxyResourceSet
@Deprecated org.eclipse.emf.ecore.resource.ResourceSet getProxyResourceSet(boolean onlyBmResources)
Deprecated.Gets a newly created copy of the BM resource set.- Parameters:
onlyBmResources
- Flag showing whether the resource set includes only BM resources.- Returns:
- the created resource set.
-
asNamespace
IBmNamespace asNamespace()
Gets the namespace this engine is bound to.- Returns:
- the namespace this engine is bound to. Never
null
.
-
-