Package com._1c.g5.v8.derived.context
Interface IObjectDerivedDataContext
-
- All Known Implementing Classes:
BasicObjectContext
,ExtObjectUpdateContext
,FormExtContext
,ModelUpdaterContext
,OperationContext
,PartBasedObjectContext
public interface IObjectDerivedDataContext
Derived data context for the object of the BM model stores the (transient) context being accumulated while processing DD-enabling business scenarios.
The context object is stored in memory only and it shouldn't be restored from some external persistent store explicitly. In case of emergency restart the new context with "rebuild all" strategy enabled should be created by the DD calculation mechanics.
The context and corresponding object are bound with internal BM id, as there are no scenarios when we have id changes in model and need to add DD incrementally. Full object DD rebuild is required in this case.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description long
getBmObjectId()
Gets the identifier of the object the context belongs to.Object
getComputationCause()
Gets the identifier of the session the context is being collected for.org.eclipse.emf.ecore.EClass
getEClass()
Gets the EClass of the target object.Object
getObjectId()
Gets the the object the context belongs to.String
getSegmentId()
Gets the derived data segment identifier this context is collected for.Object
getTransactionHandle()
Gets the associated transaction handle (if any).long
getVersion()
Gets the current version of the context.boolean
isFullRebuild()
Checks if the full rebuild mode is set for the object.default void
loadData(IContextDataInput dataInput)
Loads previously stored data into this contextboolean
mergeUpdates(IObjectDerivedDataContext context)
Merges updates into the context.default void
saveData(IContextDataOutput dataOutput)
Saves data of this context to an external storagevoid
setFullRebuild(boolean fullRebuild)
Sets/resets the full rebuild designator for the context object DD.void
setTransactionHandle(Object transactionHandle)
Sets the transaction handle for this context.void
setVersion(long version)
Sets an external version designator of the context.
-
-
-
Method Detail
-
getObjectId
Object getObjectId()
Gets the the object the context belongs to.- Returns:
- The object, never
null
-
getBmObjectId
long getBmObjectId()
Gets the identifier of the object the context belongs to.- Returns:
- The identifier of the object.
-
getComputationCause
Object getComputationCause()
Gets the identifier of the session the context is being collected for. Used only for sync contexts.- Returns:
- The identifier of the session.
-
getEClass
org.eclipse.emf.ecore.EClass getEClass()
Gets the EClass of the target object.- Returns:
- The target object EClass.
-
getSegmentId
String getSegmentId()
Gets the derived data segment identifier this context is collected for.- Returns:
- The unique identifier of the DD segment.
-
getTransactionHandle
Object getTransactionHandle()
Gets the associated transaction handle (if any).- Returns:
- The associated transaction handle (if any).
null
otherwise.
-
getVersion
long getVersion()
Gets the current version of the context. The version is defined during the snapshotting of the context. The verison is used during the context merge process to update the base version.- Returns:
- The version of the context.
-
setVersion
void setVersion(long version)
Sets an external version designator of the context. Called by the DD framework and should not be used by clients directly- Parameters:
version
- A version to set
-
isFullRebuild
boolean isFullRebuild()
Checks if the full rebuild mode is set for the object.- Returns:
- True if the full rebuild is required for the given top object.
-
mergeUpdates
boolean mergeUpdates(IObjectDerivedDataContext context)
Merges updates into the context. The base version of this context is being updated according to the verison of the provided context- Parameters:
context
- The source of updates. Cannot benull
.
-
setFullRebuild
void setFullRebuild(boolean fullRebuild)
Sets/resets the full rebuild designator for the context object DD.- Parameters:
fullRebuild
- Full rebuild flag.
-
setTransactionHandle
void setTransactionHandle(Object transactionHandle)
Sets the transaction handle for this context.- Parameters:
The
- transaction handle being associated with the context.
-
saveData
default void saveData(IContextDataOutput dataOutput) throws IOException
Saves data of this context to an external storage- Parameters:
dataOutput
- The output stream to write data into. May not benull
- Throws:
IOException
-
loadData
default void loadData(IContextDataInput dataInput) throws IOException
Loads previously stored data into this context- Parameters:
segmentData
- The data being stored earlier. May not benull
- Throws:
IOException
-
-