gnieh.sohva.strategy

StructuralMergeStrategy

object StructuralMergeStrategy extends Strategy

This strategy applies a simple structural merge algorithm between variation from a base document to the last one in the database and from the base to the current revision of the document to merge

In our case, the base document is taken as common ancestor and we create patches that models these changes:

The rules to apply when merging paths are the following:

`BD` `BC` `DC`
Not Changed Not Changed Not Changed
Not Changed Changed Changed
Not Changed Deleted Deleted
Changed Not Changed Changed
Changed Changed Changed (`BC`)
Changed Deleted Deleted
Deleted Not Changed Deleted
Deleted Changed Deleted
Deleted Deleted Deleted
Added Not Changed Added
Added Added Added (`BC`)
Not Changed Added Added

As a special case, if the document was deleted inbetween, the current document is saved "as is" in the database (without revision)

Linear Supertypes
Strategy, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. StructuralMergeStrategy
  2. Strategy
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object ArrayIdx

  7. def addedIn(ops: List[Operation], p: Pointer): Boolean

    Indicates whether the pointer is added in the list of operations

  8. def apply(baseDoc: Option[JValue], dbDoc: Option[JValue], currentJson: JValue): Option[JValue]

    Applies the resolving strategy between the last known revision baseDoc (or None if the document did not exist before to the client knowledge), the last revision in the database lastDoc (or None if the document was deleted) and the document the client wants to save currentDoc.

    Applies the resolving strategy between the last known revision baseDoc (or None if the document did not exist before to the client knowledge), the last revision in the database lastDoc (or None if the document was deleted) and the document the client wants to save currentDoc. If no automatic merge could be found, then returns None, which results in a conflict exception. When JNothing is returned no further try is performed and the saving is considered succesful by keeping the current version in the database.

    Definition Classes
    StructuralMergeStrategyStrategy
  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. def modifiesChild(op: Operation, p: Pointer): Boolean

    Indicates whether the operation modifies the pointer or one of its children

  18. def modifiesParent(ops: List[Operation], p: Pointer): Boolean

    Indicates whether an operation exists in the list that modifies the pointer or one of its parents

  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. def shift(ops: List[Operation], p: Pointer, value: Int): List[Operation]

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  24. def toString(): String

    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Strategy

Inherited from AnyRef

Inherited from Any

Ungrouped