Package com._1c.g5.v8.bm.core
Class BmPlatform
- java.lang.Object
-
- com._1c.g5.v8.bm.core.BmPlatform
-
public abstract class BmPlatform extends Object
Entry point for all interactions with the BM object storage platform.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DATA_FORMAT_VERSION
Data format version
-
Constructor Summary
Constructors Constructor Description BmPlatform()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract void
activateNamespace(IBmNamespace namespace)
Activates the specified namespace.abstract void
addMonitoringEventListener(IBmMonitoringEventListener listener)
Adds a monitoring event listener.abstract void
applyNamespaceDataStoreSnapshot(IBmNamespaceDataStore store, InputStream in)
Deprecated.The method has been introduced to simplify migration of some legacy solutions to the new BM API.abstract void
assignStore(IBmNamespace namespace, IBmNamespaceDataStore store)
Assigns a store to a namespace.abstract IBmPlatformTransaction
beginNonCommittableTransaction()
Deprecated.For internal use only, will be removed someday.abstract IBmPlatformTransaction
beginReadOnlyTransaction()
Begins a read-only transaction.abstract IBmPlatformTransaction
beginReadOnlyTransaction(boolean lightweight)
Begins a read-only transaction.abstract IBmPlatformTransaction
beginReadWriteTransaction()
Begins a read-write transaction.abstract IBmPlatformTransaction
beginReadWriteTransaction(boolean trackModifications)
Begins a read-write transaction.abstract IBmPlatformTransaction
beginReadWriteTransaction(boolean trackModifications, boolean disableEvents, Object operationId, Object serviceId)
Begins a read-write transaction.abstract IBmPlatformTransaction
beginReadWriteTransaction(boolean trackModifications, Object operationId, Object serviceId)
Begins a read-write transaction.abstract IBmNamespaceDataStore
connectExternalNamespaceDataStore(String name, Path path)
Connects an external namespace data store.abstract IBmNamespace
createNamespace(String name, BmNamespaceConfiguration configuration)
Creates a namespace.abstract IBmNamespaceDataStore
createNamespaceDataStore(String name)
Creates a namespace data store.abstract IBmNamespaceDataStore
createNamespaceDataStoreFromSnapshot(String name, InputStream in)
Deprecated.The method has been introduced to simplify migration of some legacy solutions to the new BM API.abstract IBmNamespaceDataStore
createNamespaceDataStoreReadOnlyCopy(String name, IBmNamespaceDataStore originalStore)
Creates a copy of the specified store that is intended for read access only.abstract IBmNamespaceDataStore
createNamespaceDataStoreReadWriteCopy(String name, IBmNamespaceDataStore originalStore)
Creates a copy of the specified store that is intended for both read and write access.static BmPlatform
createPlatform(BmPlatformConfiguration configuration)
Creates a platform with the given configuration.abstract void
deactivateNamespace(IBmNamespace namespace)
Deactivates the specified namespace.abstract void
deleteNamespace(IBmNamespace namespace)
Deletes the specified namespace.abstract void
deleteNamespaceDataStore(IBmNamespaceDataStore store)
Deletes a store of any kind except external stores.abstract void
disconnectExternalNamespaceDataStore(IBmNamespaceDataStore store)
Disconnects an external namespace data store.abstract void
exportNamespaceDataStore(IBmNamespaceDataStore store, Path destinationPath)
Export a namespace data store.abstract void
forbidNamespaceDataStoreWriteAccess(IBmNamespaceDataStore store)
Forbids write access to the specified store.abstract Collection<IBmNamespaceDataStore>
getAllNamespaceDataStores()
Gets all namespace data stores.abstract Collection<IBmNamespace>
getAllNamespaces()
Gets all namespaces.abstract long
getApproximateStoreSize(IBmNamespaceDataStore store)
Gets approximate size of the specified store which can be used by resource management and monitoring machinery.abstract IBmPlatformTransaction
getCurrentTransaction()
Gets the transaction currently open in the calling thread.abstract IBmNamespace
getNamespace(String name)
Gets a namespace by name.abstract IBmNamespaceDataStore
getNamespaceDataStore(String name)
Gets namespace data store by name.abstract void
reduceMemoryFootprint()
Reduce (temporary) the usage of resources (memory, etc) by the engine as the part of the peak load support cycleabstract void
removeMonitoringEventListener(IBmMonitoringEventListener listener)
Removes a monitoring event listener.abstract void
saveNamespaceDataStoreSnapshot(IBmNamespaceDataStore store, OutputStream out)
Deprecated.The method has been introduced to simplify migration of some legacy solutions to the new BM API.abstract void
stop()
Stops the platform.abstract void
unassignStore(IBmNamespace namespace)
Unassigns a store from a namespace.
-
-
-
Field Detail
-
DATA_FORMAT_VERSION
public static final int DATA_FORMAT_VERSION
Data format version- See Also:
- Constant Field Values
-
-
Method Detail
-
createPlatform
public static BmPlatform createPlatform(BmPlatformConfiguration configuration)
Creates a platform with the given configuration. In case existing platform files are found they are loaded, otherwise the initialization occurs.- Parameters:
configuration
- The platform configuration. May not benull
.- Returns:
- a ready-to-use platform. Never
null
.
-
stop
public abstract void stop()
Stops the platform.
-
getNamespaceDataStore
public abstract IBmNamespaceDataStore getNamespaceDataStore(String name)
Gets namespace data store by name.- Parameters:
name
- The name to get store by. May not benull
.- Returns:
- the store with the specified name or
null
if not found.
-
createNamespaceDataStore
public abstract IBmNamespaceDataStore createNamespaceDataStore(String name)
Creates a namespace data store.In case a store of any kind with the specified name already exists an exception is thrown.
- Parameters:
name
- The name of the store. May not benull
.- Returns:
- the handle of the store. Never
null
.
-
connectExternalNamespaceDataStore
public abstract IBmNamespaceDataStore connectExternalNamespaceDataStore(String name, Path path)
Connects an external namespace data store.In case a store of any kind with the specified name already exists an exception is thrown.
- Parameters:
name
- The name of the store. May not benull
.path
- The external data store path. May not benull
.- Returns:
- the handle of the store. Never
null
.
-
disconnectExternalNamespaceDataStore
public abstract void disconnectExternalNamespaceDataStore(IBmNamespaceDataStore store)
Disconnects an external namespace data store. If there are copies created from the store an exception is thrown.- Parameters:
store
- The external store to disconnect. May not benull
.
-
createNamespaceDataStoreReadOnlyCopy
public abstract IBmNamespaceDataStore createNamespaceDataStoreReadOnlyCopy(String name, IBmNamespaceDataStore originalStore)
Creates a copy of the specified store that is intended for read access only. Right after its creation the store contains exactly the same data as the original store, but any changes to the original store are not seen in the copy.In case a store of any kind with the specified name already exists an exception is thrown.
- Parameters:
name
- The name of the store to create. May not benull
.originalStore
- The original store. May not benull
.- Returns:
- the handle of the store. Never
null
.
-
createNamespaceDataStoreReadWriteCopy
public abstract IBmNamespaceDataStore createNamespaceDataStoreReadWriteCopy(String name, IBmNamespaceDataStore originalStore)
Creates a copy of the specified store that is intended for both read and write access. Right after its creation the store contains exactly the same data as the original store, but any changes to the original store are not seen in the copy and vice versa.In case a store of any kind with the specified name already exists an exception is thrown.
- Parameters:
name
- The name of the store to create. May not benull
.originalStore
- The original store. May not benull
.- Returns:
- the handle of the store. Never
null
.
-
forbidNamespaceDataStoreWriteAccess
public abstract void forbidNamespaceDataStoreWriteAccess(IBmNamespaceDataStore store)
Forbids write access to the specified store.- Parameters:
store
- The store to forbid write access to. May not benull
.
-
exportNamespaceDataStore
public abstract void exportNamespaceDataStore(IBmNamespaceDataStore store, Path destinationPath)
Export a namespace data store.- Parameters:
store
- The store to export. May not benull
.destinationPath
- The destination path. May not benull
.
-
saveNamespaceDataStoreSnapshot
@Deprecated(since="8.0.0") public abstract void saveNamespaceDataStoreSnapshot(IBmNamespaceDataStore store, OutputStream out)
Deprecated.The method has been introduced to simplify migration of some legacy solutions to the new BM API.Saves namespace data store snapshot.- Parameters:
store
- The store. May not benull
.out
- The output stream to write snapshot to. May not benull
.
-
applyNamespaceDataStoreSnapshot
@Deprecated(since="8.0.0") public abstract void applyNamespaceDataStoreSnapshot(IBmNamespaceDataStore store, InputStream in)
Deprecated.The method has been introduced to simplify migration of some legacy solutions to the new BM API.Applies namespace data store snapshot.- Parameters:
store
- The store. May not benull
.in
- The input stream to read snapshot from. May not benull
.
-
createNamespaceDataStoreFromSnapshot
@Deprecated(since="8.0.0") public abstract IBmNamespaceDataStore createNamespaceDataStoreFromSnapshot(String name, InputStream in)
Deprecated.The method has been introduced to simplify migration of some legacy solutions to the new BM API.Creates namespace data store from snapshot.- Parameters:
name
- The name of the store. May not benull
.in
- The input stream to read snapshot from. May not benull
.
-
deleteNamespaceDataStore
public abstract void deleteNamespaceDataStore(IBmNamespaceDataStore store)
Deletes a store of any kind except external stores.- Parameters:
store
- The store to delete. May not benull
.
-
createNamespace
public abstract IBmNamespace createNamespace(String name, BmNamespaceConfiguration configuration)
Creates a namespace.In case a namespace with the specified name already exists an exception is thrown.
- Parameters:
name
- The name of the namespace. May not benull
.configuration
- The configuration of the namespace. May not benull
.- Returns:
- the created namespace handle, never
null
.
-
assignStore
public abstract void assignStore(IBmNamespace namespace, IBmNamespaceDataStore store)
Assigns a store to a namespace.- Parameters:
namespace
- The namespace. May not benull
.store
- The store. May not benull
.
-
unassignStore
public abstract void unassignStore(IBmNamespace namespace)
Unassigns a store from a namespace.- Parameters:
namespace
- The namespace. May not benull
.
-
activateNamespace
public abstract void activateNamespace(IBmNamespace namespace)
Activates the specified namespace. Fails with an exception if the namespace is already active. By default all namespaces are active.- Parameters:
namespace
- The namespace to activate. May not benull
.
-
deactivateNamespace
public abstract void deactivateNamespace(IBmNamespace namespace)
Deactivates the specified namespace. Fails with an exception if the namespace is already deactivated. All read and write request to a deactivated namespace will fail with an exception.- Parameters:
namespace
- The namespace to deactivate. May not benull
.
-
deleteNamespace
public abstract void deleteNamespace(IBmNamespace namespace)
Deletes the specified namespace. Fails with an exception if the namespace is deactivated.- Parameters:
namespace
- The namespace to delete. May not benull
.
-
getNamespace
public abstract IBmNamespace getNamespace(String name)
Gets a namespace by name.- Parameters:
name
- The name of the namespace. May not benull
.- Returns:
- the handle of the requested namespace or
null
in case it is not found.
-
getAllNamespaces
public abstract Collection<IBmNamespace> getAllNamespaces()
Gets all namespaces.- Returns:
- a collection containing all the platform's namespaces. Never
null
.
-
getAllNamespaceDataStores
public abstract Collection<IBmNamespaceDataStore> getAllNamespaceDataStores()
Gets all namespace data stores.- Returns:
- a collection containing all the platform's namespace data stores. Never
null
.
-
addMonitoringEventListener
public abstract void addMonitoringEventListener(IBmMonitoringEventListener listener)
Adds a monitoring event listener.- Parameters:
listener
- The listener to add. May not benull
.
-
removeMonitoringEventListener
public abstract void removeMonitoringEventListener(IBmMonitoringEventListener listener)
Removes a monitoring event listener.- Parameters:
listener
- The listener to remove. May not benull
.
-
beginReadOnlyTransaction
public abstract IBmPlatformTransaction beginReadOnlyTransaction()
Begins a read-only transaction.- Returns:
- the created transaction instance, never
null
.
-
beginReadOnlyTransaction
public abstract IBmPlatformTransaction beginReadOnlyTransaction(boolean lightweight)
Begins a read-only transaction. In contrast to its zero-argument counterpart this method allows to create a lightweight transaction. Lightweight transactions are able to evict their internal data to avoid excessive memory usage.- Parameters:
lightweight
- The flag indicating whether a lighweight transaction must be created.- Returns:
- the created transaction instance, never
null
.
-
beginReadWriteTransaction
public abstract IBmPlatformTransaction beginReadWriteTransaction()
Begins a read-write transaction.- Returns:
- the created transaction instance, never
null
.
-
beginReadWriteTransaction
public abstract IBmPlatformTransaction 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 indicating whether the modifications performed in this transaction must be tracked.- Returns:
- the created transaction instance, never
null
.
-
beginReadWriteTransaction
public abstract IBmPlatformTransaction 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 indicating 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
public abstract IBmPlatformTransaction 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 indicating 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 public abstract IBmPlatformTransaction beginNonCommittableTransaction()
Deprecated.For internal use only, will be removed someday.Begins a non-commitable read-write transaction. This method is not a part of the public API and should not be used by clients.- Returns:
- the created transaction instance, never
null
.
-
getCurrentTransaction
public abstract IBmPlatformTransaction getCurrentTransaction()
Gets the transaction currently open in the calling thread.- Returns:
- the transaction or
null
if no transaction is open in the thread.
-
reduceMemoryFootprint
public abstract void reduceMemoryFootprint()
Reduce (temporary) the usage of resources (memory, etc) by the engine as the part of the peak load support cycle
-
getApproximateStoreSize
public abstract long getApproximateStoreSize(IBmNamespaceDataStore store)
Gets approximate size of the specified store which can be used by resource management and monitoring machinery.- Parameters:
store
- The store to get approximate size of. May not benull
.- Returns:
- approximate size of the store in bytes.
-
-