org.eclipse.emf.emfstore.internal.client.model
Class CompositeOperationHandle

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.model.CompositeOperationHandle
All Implemented Interfaces:
APIDelegate<ESCompositeOperationHandleImpl>

public class CompositeOperationHandle
extends Object
implements APIDelegate<ESCompositeOperationHandleImpl>

A handle to control a composite operation during recording.

Author:
koegel, Johannes Faltermeier

Constructor Summary
CompositeOperationHandle(OperationRecorder operationRecorder, CompositeOperation compositeOperation)
          Default constructor.
 
Method Summary
 void abort()
          Aborts a composite operation.
 ESCompositeOperationHandleImpl createAPI()
          Creates the API interface for this class.
 void end(SemanticCompositeOperation semanticCompositeOperation)
          Completes a the given semantic composite operation.
 void end(String name, String description, ModelElementId modelElementId)
          Completes a composite operation.
 boolean isValid()
          Returns whether the handle is still valid.
 ESCompositeOperationHandleImpl 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

CompositeOperationHandle

public CompositeOperationHandle(OperationRecorder operationRecorder,
                                CompositeOperation compositeOperation)
Default constructor.

Parameters:
operationRecorder - the change tracker this composite is tracked on
compositeOperation - the composite operation to be handled
Method Detail

isValid

public boolean isValid()
Returns whether the handle is still valid.

Returns:
false if the composite operation is already completed or aborted.

abort

public void abort()
           throws InvalidHandleException
Aborts a composite operation. The state before starting the composite operation will be recovered.

Throws:
InvalidHandleException - if the handle is invalid

end

public void end(String name,
                String description,
                ModelElementId modelElementId)
         throws InvalidHandleException
Completes a composite operation.

Parameters:
name - the name for the operation
description - the description of the operation
modelElementId - the id of the model element that is most important for the operation
Throws:
InvalidHandleException - if the handle is invalid

end

public void end(SemanticCompositeOperation semanticCompositeOperation)
         throws InvalidHandleException
Completes a the given semantic composite operation.

Parameters:
semanticCompositeOperation - a semanticCompositeOperation that was executed and represents the composite
Throws:
InvalidHandleException - if the handle is invalid

toAPI

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

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

createAPI

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

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


Copyright © 2016. All Rights Reserved.