Package com._1c.g5.v8.derived.context
Class BasicObjectContext
- java.lang.Object
-
- com._1c.g5.v8.derived.context.BasicObjectContext
-
- All Implemented Interfaces:
IObjectDerivedDataContext
- Direct Known Subclasses:
ExtObjectUpdateContext
,PartBasedObjectContext
public abstract class BasicObjectContext extends Object implements IObjectDerivedDataContext
Basic implementation of the DD object context.
-
-
Constructor Summary
Constructors Constructor Description BasicObjectContext(Object objectId, org.eclipse.emf.ecore.EClass eClass, String segmentId, boolean removal, Object computationCause, long baseVersion)
Creates a new instance of the context
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getBaseVersion()
Gets the base version of the context.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.boolean
isRemoval()
Checks if the current context represents removed object.void
setBaseVersion(long version)
Sets the base version of the context.void
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.-
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.derived.context.IObjectDerivedDataContext
clear, getSnapshot, mergeUpdates
-
-
-
-
Constructor Detail
-
BasicObjectContext
public BasicObjectContext(Object objectId, org.eclipse.emf.ecore.EClass eClass, String segmentId, boolean removal, Object computationCause, long baseVersion)
Creates a new instance of the context- Parameters:
objectId
- The identifier of the object (BM or language) this context corresponds to. May not benull
eClass
- The EClass of the of the top BM object this context corresponds to. May not benull
segmentId
- The identifier of DD segment this context belongs to. May not benull
computationCause
- The identifier of the context collection session. May benull
baseVersion
- The base version of the context for the operations of the context merge and conflict detection
-
-
Method Detail
-
getBaseVersion
public long getBaseVersion()
Description copied from interface:IObjectDerivedDataContext
Gets the base version of the context. The base version is used during the conflict resolution phase. In case if context computation task is started for the particular version, any updates of the context wiil result in cancelling of the computed results.- Specified by:
getBaseVersion
in interfaceIObjectDerivedDataContext
- Returns:
- The base version of the context.
-
getObjectId
public Object getObjectId()
Description copied from interface:IObjectDerivedDataContext
Gets the the object the context belongs to.- Specified by:
getObjectId
in interfaceIObjectDerivedDataContext
- Returns:
- The object, never
null
-
getBmObjectId
public long getBmObjectId()
Description copied from interface:IObjectDerivedDataContext
Gets the identifier of the object the context belongs to.- Specified by:
getBmObjectId
in interfaceIObjectDerivedDataContext
- Returns:
- The identifier of the object.
-
getComputationCause
public Object getComputationCause()
Description copied from interface:IObjectDerivedDataContext
Gets the identifier of the session the context is being collected for. Used only for sync contexts.- Specified by:
getComputationCause
in interfaceIObjectDerivedDataContext
- Returns:
- The identifier of the session.
-
getEClass
public org.eclipse.emf.ecore.EClass getEClass()
Description copied from interface:IObjectDerivedDataContext
Gets the EClass of the target object.- Specified by:
getEClass
in interfaceIObjectDerivedDataContext
- Returns:
- The target object EClass.
-
getSegmentId
public String getSegmentId()
Description copied from interface:IObjectDerivedDataContext
Gets the derived data segment identifier this context is collected for.- Specified by:
getSegmentId
in interfaceIObjectDerivedDataContext
- Returns:
- The unique identifier of the DD segment.
-
getTransactionHandle
public Object getTransactionHandle()
Description copied from interface:IObjectDerivedDataContext
Gets the associated transaction handle (if any).- Specified by:
getTransactionHandle
in interfaceIObjectDerivedDataContext
- Returns:
- The associated transaction handle (if any).
null
otherwise.
-
getVersion
public long getVersion()
Description copied from interface:IObjectDerivedDataContext
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.- Specified by:
getVersion
in interfaceIObjectDerivedDataContext
- Returns:
- The version of the context.
-
isFullRebuild
public boolean isFullRebuild()
Description copied from interface:IObjectDerivedDataContext
Checks if the full rebuild mode is set for the object.- Specified by:
isFullRebuild
in interfaceIObjectDerivedDataContext
- Returns:
- True if the full rebuild is required for the given top object.
-
isRemoval
public boolean isRemoval()
Description copied from interface:IObjectDerivedDataContext
Checks if the current context represents removed object.- Specified by:
isRemoval
in interfaceIObjectDerivedDataContext
- Returns:
- True if the context was collected for the removed object; false otherwise.
-
setBaseVersion
public void setBaseVersion(long version)
Description copied from interface:IObjectDerivedDataContext
Sets the base version of the context. Used during the merge operation.- Specified by:
setBaseVersion
in interfaceIObjectDerivedDataContext
- Parameters:
version
- The version to set.
-
setFullRebuild
public void setFullRebuild(boolean fullRebuild)
Description copied from interface:IObjectDerivedDataContext
Sets/resets the full rebuild designator for the context object DD.- Specified by:
setFullRebuild
in interfaceIObjectDerivedDataContext
- Parameters:
fullRebuild
- Full rebuild flag.
-
setTransactionHandle
public void setTransactionHandle(Object transactionHandle)
Description copied from interface:IObjectDerivedDataContext
Sets the transaction handle for this context.- Specified by:
setTransactionHandle
in interfaceIObjectDerivedDataContext
-
-