org.eclipse.emf.emfstore.internal.server.conflictDetection
Class ConflictBucket

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.server.conflictDetection.ConflictBucket
All Implemented Interfaces:
APIDelegate<ESConflict>

public class ConflictBucket
extends Object
implements APIDelegate<ESConflict>

Represents a bucket of conflicting operations sets. In this context my operations are operations authored/owned by the current user while their operation are incoming operations from another user.

Author:
koegel

Constructor Summary
ConflictBucket(AbstractOperation myOperation, AbstractOperation theirOperation)
          Constructor.
ConflictBucket(Set<AbstractOperation> myOperations, Set<AbstractOperation> theirOperations)
          Constructor.
 
Method Summary
 ESConflict createAPI()
          Creates the API interface for this class.
 Set<AbstractOperation> getAcceptedLocalOperations()
          Returns the set of local operations that have been accepted.
 AbstractOperation getMyOperation()
           
 Set<AbstractOperation> getMyOperations()
           
 Set<AbstractOperation> getRejectedRemoteOperations()
          Returns the set of remote operations that have been rejected.
 AbstractOperation getTheirOperation()
           
 Set<AbstractOperation> getTheirOperations()
           
 boolean isResolved()
          Whether this conflict bucket is resolved.
 void resolveConflict(Set<AbstractOperation> acceptedLocalOperations, Set<AbstractOperation> rejectedRemoteOperations)
          Resolve the conflict by specifying the accepted local operations and the rejected remote operations.
 void setMyOperation(AbstractOperation myOperation)
          Set one of my operations representing all my operations.
 void setTheirOperation(AbstractOperation theirOperation)
          Set one of their operations representing all their operations.
 ESConflict toAPI()
          Returns the API interface of this class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConflictBucket

public ConflictBucket(AbstractOperation myOperation,
                      AbstractOperation theirOperation)
Constructor.

Parameters:
myOperation - initial my operation
theirOperation - initial their operation

ConflictBucket

public ConflictBucket(Set<AbstractOperation> myOperations,
                      Set<AbstractOperation> theirOperations)
Constructor.

Parameters:
myOperations - initial set of my operations
theirOperations - initial set of their operations
Method Detail

getMyOperations

public Set<AbstractOperation> getMyOperations()
Returns:
the set of my operations

getTheirOperations

public Set<AbstractOperation> getTheirOperations()
Returns:
the set of their operations

getMyOperation

public AbstractOperation getMyOperation()
Returns:
one of my operations representing all my operations

setMyOperation

public void setMyOperation(AbstractOperation myOperation)
Set one of my operations representing all my operations.

Parameters:
myOperation - the operation

getTheirOperation

public AbstractOperation getTheirOperation()
Returns:
one of their operations representing all their operations

setTheirOperation

public void setTheirOperation(AbstractOperation theirOperation)
Set one of their operations representing all their operations. * @param theirOperation the operation


toAPI

public ESConflict toAPI()
Returns the API interface of this class.

Specified by:
toAPI in interface APIDelegate<ESConflict>
Returns:
the API interface of this class
See Also:
APIDelegate.toAPI()

createAPI

public ESConflict createAPI()
Creates the API interface for this class.

Specified by:
createAPI in interface APIDelegate<ESConflict>
Returns:
the API interface of this class
See Also:
APIDelegate.createAPI()

resolveConflict

public void resolveConflict(Set<AbstractOperation> acceptedLocalOperations,
                            Set<AbstractOperation> rejectedRemoteOperations)
Resolve the conflict by specifying the accepted local operations and the rejected remote operations.

Parameters:
acceptedLocalOperations - a set of local operations that have been accepted
rejectedRemoteOperations - a set of remote operations that have been rejected

getAcceptedLocalOperations

public Set<AbstractOperation> getAcceptedLocalOperations()
Returns the set of local operations that have been accepted.

Returns:
a set of accepted local operations

getRejectedRemoteOperations

public Set<AbstractOperation> getRejectedRemoteOperations()
Returns the set of remote operations that have been rejected.

Returns:
the set of rejected remote operations

isResolved

public boolean isResolved()
Whether this conflict bucket is resolved.

Returns:
true if this bucket is resolved, false otherwise


Copyright © 2015. All Rights Reserved.