Interface IObjectDerivedDataContext

  • All Known Implementing Classes:
    BasicObjectContext, ExtObjectUpdateContext, FormExtContext, ModelUpdaterContext, 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 Detail

      • clear

        void clear()
        Clears the context. Implemenentations aren't required to be safe, the thread safety during the snapshot creation is supported by the DD context management facilities (due to complexity and performance reasons).
      • getBaseVersion

        long getBaseVersion()
        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.
        Returns:
        The base version of the context.
      • 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.
      • getSnapshot

        IObjectDerivedDataContext getSnapshot()
        Gets the snapshot of the context. Implemenentations aren't required to be safe, the thread safety during the snapshot creation is supported by the DD context management facilities (due to complexity and performance reasons).
        Returns:
        The current snapshot of the context state.
      • 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.
      • 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.
      • isRemoval

        boolean isRemoval()
        Checks if the current context represents removed object.
        Returns:
        True if the context was collected for the removed object; false otherwise.
      • 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 be null.
      • setBaseVersion

        void setBaseVersion​(long version)
        Sets the base version of the context. Used during the merge operation.
        Parameters:
        version - The version to set.
      • 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.