org.eclipse.emf.emfstore.internal.server.model.versioning.impl
Class FileBasedChangePackageImpl

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended by org.eclipse.emf.ecore.impl.BasicEObjectImpl
          extended by org.eclipse.emf.ecore.impl.EObjectImpl
              extended by org.eclipse.emf.emfstore.internal.server.model.versioning.impl.FileBasedChangePackageImpl
All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.InternalEObject, APIDelegate<ESChangePackage>, AbstractChangePackage, FileBasedChangePackage

public class FileBasedChangePackageImpl
extends org.eclipse.emf.ecore.impl.EObjectImpl
implements FileBasedChangePackage

An implementation of the model object 'File Based Change Package'.

The following features are implemented:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
org.eclipse.emf.ecore.InternalEObject.EStore
 
Field Summary
static String FILE_OP_INDEX
          Index of an operations file tuple consisting of the actual and the temporary file.
 
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
ELAST_EOBJECT_FLAG
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Method Summary
 void add(AbstractOperation op)
          Add a single operation to this change package.
 void addAll(List<AbstractOperation> ops)
          Adds all given operations to this change package.
 void apply(Project project)
          Applies this change package to the given project.
 void apply(Project project, boolean forceApplication)
          Apply all operations in the change package to the given project.
 void attachToProjectSpace(ChangePackageContainer changePackageContainer)
          Attaches this change package to the given value.
 LogMessage basicGetLogMessage()
           
 org.eclipse.emf.common.notify.NotificationChain basicSetLogMessage(LogMessage newLogMessage, org.eclipse.emf.common.notify.NotificationChain msgs)
           
 void clear()
          Clears all operations from this change package.
 FileBasedChangePackage copy()
          Copies this change package.
 ESChangePackage createAPI()
          Creates the API interface for this class.
 void delete()
           
 Object eGet(int featureID, boolean resolve, boolean coreType)
           
 org.eclipse.emf.common.notify.NotificationChain eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)
           
 boolean eIsSet(int featureID)
           
 void eSet(int featureID, Object newValue)
           
 void eUnset(int featureID)
           
 AbstractOperation get(int index)
          Returns the operation at the given index.
 String getFilePath()
           
 LogMessage getLogMessage()
           
 org.eclipse.emf.common.util.EList<OperationProxy> getOperationProxies()
           
 String getTempFilePath()
          Returns the path to the temporary file
 void initialize(String filePath)
          Initializes this change package.
 boolean isEmpty()
          Whether this change package has any operations.
 int leafSize()
          Returns the number of leaf operations that are contained within this change package.
 void move(String newFilePath)
          Moves this change package.
 ESCloseableIterable<AbstractOperation> operations()
          Returns a handle for iterating through operations contained in this change package.
NOTE: Callers must call close on the returned handle.
 List<AbstractOperation> removeAtEnd(int n)
          Removes the given number of operations starting from the end.
 FileBasedChangePackage reverse()
          Creates a copy of the change package and reverses it.
 ESCloseableIterable<AbstractOperation> reversedOperations()
          Returns an ESCloseableIterable that returns the operations in a backwards fashion.
 void save()
          Save this change package.
 void setFilePath(String newFilePath)
          Sets the value of the ' File Path' attribute.
 void setLogMessage(LogMessage newLogMessage)
           
 int size()
          Returns the size of this change package, that is, how many operations are contained in it.
 ESChangePackage toAPI()
          Returns the API representation of this change package.
 ChangePackage toInMemoryChangePackage()
          Converts this file-based change package to an in-memory change package.
NOTE: for very big change packages this might cause a serious performance hit and also cause OutOfMemoryErrors.
 String toString()
           
 
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eInvoke, eIsProxy, eSetClass, eSetDeliver, eSetProxyURI
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eContainer, eContainingFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedOperationID, eDerivedOperationID, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInvoke, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eInternalResource, eInverseAdd, eInverseAdd, eInverseRemove, eInvoke, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eResolveProxy, eResource, eSet, eSetResource, eSetStore, eSetting, eStore, eUnset, eURIFragmentSegment, eVirtualGet, eVirtualGet, eVirtualIsSet, eVirtualSet, eVirtualUnset
 
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eNotificationRequired, eNotify
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eNotificationRequired
 

Field Detail

FILE_OP_INDEX

public static final String FILE_OP_INDEX
Index of an operations file tuple consisting of the actual and the temporary file.

See Also:
Constant Field Values
Method Detail

getLogMessage

public LogMessage getLogMessage()

Specified by:
getLogMessage in interface AbstractChangePackage
Returns:
the value of the 'Log Message' containment reference.
See Also:
AbstractChangePackage.setLogMessage(LogMessage), VersioningPackage.getAbstractChangePackage_LogMessage()

basicGetLogMessage

public LogMessage basicGetLogMessage()


basicSetLogMessage

public org.eclipse.emf.common.notify.NotificationChain basicSetLogMessage(LogMessage newLogMessage,
                                                                          org.eclipse.emf.common.notify.NotificationChain msgs)


setLogMessage

public void setLogMessage(LogMessage newLogMessage)

Specified by:
setLogMessage in interface AbstractChangePackage
Parameters:
newLogMessage - the new value of the 'Log Message' containment reference.
See Also:
AbstractChangePackage.getLogMessage()

getFilePath

public String getFilePath()

Specified by:
getFilePath in interface FileBasedChangePackage
Returns:
the value of the 'File Path' attribute.
See Also:
FileBasedChangePackage.setFilePath(String), VersioningPackage.getFileBasedChangePackage_FilePath()

getTempFilePath

public String getTempFilePath()
Returns the path to the temporary file

Specified by:
getTempFilePath in interface FileBasedChangePackage
Returns:
the temporary file path

setFilePath

public void setFilePath(String newFilePath)
Description copied from interface: FileBasedChangePackage
Sets the value of the ' File Path' attribute.

Specified by:
setFilePath in interface FileBasedChangePackage
Parameters:
newFilePath - the new value of the 'File Path' attribute.
See Also:
FileBasedChangePackage.getFilePath()

getOperationProxies

public org.eclipse.emf.common.util.EList<OperationProxy> getOperationProxies()

Specified by:
getOperationProxies in interface FileBasedChangePackage
Returns:
the value of the 'Operation Proxies' containment reference list.
See Also:
VersioningPackage.getFileBasedChangePackage_OperationProxies()

eInverseRemove

public org.eclipse.emf.common.notify.NotificationChain eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd,
                                                                      int featureID,
                                                                      org.eclipse.emf.common.notify.NotificationChain msgs)

Overrides:
eInverseRemove in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

eGet

public Object eGet(int featureID,
                   boolean resolve,
                   boolean coreType)

Specified by:
eGet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eGet in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

eSet

public void eSet(int featureID,
                 Object newValue)

Specified by:
eSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eSet in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

eUnset

public void eUnset(int featureID)

Specified by:
eUnset in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eUnset in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

eIsSet

public boolean eIsSet(int featureID)

Specified by:
eIsSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eIsSet in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

toString

public String toString()

Overrides:
toString in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

toAPI

public ESChangePackage toAPI()
Returns the API representation of this change package.

Specified by:
toAPI in interface APIDelegate<ESChangePackage>
Specified by:
toAPI in interface AbstractChangePackage
Returns:
the API representation of this change package.
See Also:
APIDelegate.toAPI()

createAPI

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

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

addAll

public void addAll(List<AbstractOperation> ops)
Adds all given operations to this change package.

Specified by:
addAll in interface AbstractChangePackage
Parameters:
ops - the operations to be added
See Also:
AbstractChangePackage.addAll(java.util.List)

add

public void add(AbstractOperation op)
Add a single operation to this change package.

Specified by:
add in interface AbstractChangePackage
Parameters:
op - the operation to be added
See Also:
AbstractChangePackage.add(org.eclipse.emf.emfstore.internal.server.model.versioning.operations.AbstractOperation)

reverse

public FileBasedChangePackage reverse()
Creates a copy of the change package and reverses it.

Specified by:
reverse in interface AbstractChangePackage
Specified by:
reverse in interface FileBasedChangePackage
Returns:
the reversed change packages
See Also:
AbstractChangePackage.reverse()

copy

public FileBasedChangePackage copy()
Copies this change package.

Returns:
the copied change package

reversedOperations

public ESCloseableIterable<AbstractOperation> reversedOperations()
Returns an ESCloseableIterable that returns the operations in a backwards fashion.

Specified by:
reversedOperations in interface AbstractChangePackage
Returns:
ESCloseableIterable that must be close after iteration

size

public int size()
Returns the size of this change package, that is, how many operations are contained in it.

Specified by:
size in interface AbstractChangePackage
Returns:
the number of operations contained in this change package
See Also:
AbstractChangePackage.size()

operations

public ESCloseableIterable<AbstractOperation> operations()
Returns a handle for iterating through operations contained in this change package.
NOTE: Callers must call close on the returned handle.

Specified by:
operations in interface AbstractChangePackage
Returns:
a handle that enables iterating through all operations of this change package
See Also:
AbstractChangePackage.operations()

isEmpty

public boolean isEmpty()
Whether this change package has any operations.

Specified by:
isEmpty in interface AbstractChangePackage
Returns:
true, if this change package is empty, false otherwise
See Also:
AbstractChangePackage.isEmpty()

removeAtEnd

public List<AbstractOperation> removeAtEnd(int n)
Removes the given number of operations starting from the end.

Specified by:
removeAtEnd in interface AbstractChangePackage
Parameters:
n - the number of operations to be removed
Returns:
the removed operations
See Also:
AbstractChangePackage.removeAtEnd(int)

clear

public void clear()
Clears all operations from this change package.

Specified by:
clear in interface AbstractChangePackage
See Also:
AbstractChangePackage.clear()

attachToProjectSpace

public void attachToProjectSpace(ChangePackageContainer changePackageContainer)
Attaches this change package to the given value.

Specified by:
attachToProjectSpace in interface AbstractChangePackage
Parameters:
changePackageContainer - the value to which this change package will be attached to
See Also:
AbstractChangePackage.attachToProjectSpace(org.eclipse.emf.emfstore.internal.server.model.versioning.impl.persistent.ChangePackageContainer)

delete

public void delete()

leafSize

public int leafSize()
Returns the number of leaf operations that are contained within this change package.

Specified by:
leafSize in interface AbstractChangePackage
Returns:
the number of leaf operations contained in this change package
See Also:
AbstractChangePackage.leafSize()

initialize

public void initialize(String filePath)
Initializes this change package.

Specified by:
initialize in interface FileBasedChangePackage
Parameters:
filePath - the file path where the change package should be initialized
See Also:
FileBasedChangePackage.initialize(java.lang.String)

apply

public void apply(Project project)
Applies this change package to the given project.

Specified by:
apply in interface AbstractChangePackage
Parameters:
project - the project upon which the change package should be applied
See Also:
AbstractChangePackage.apply(org.eclipse.emf.emfstore.internal.common.model.Project)

apply

public void apply(Project project,
                  boolean forceApplication)
Apply all operations in the change package to the given project. Additional you can force the operations to be applied with illegal operations being ignored.

Specified by:
apply in interface AbstractChangePackage
Parameters:
project - the project
forceApplication - if true, illegal Operations won't stop the other to be applied
See Also:
AbstractChangePackage.apply(org.eclipse.emf.emfstore.internal.common.model.Project, boolean)

get

public AbstractOperation get(int index)
Returns the operation at the given index.

Specified by:
get in interface AbstractChangePackage
Parameters:
index - the requested index
Returns:
the operation corresponding to the given index
See Also:
AbstractChangePackage.get(int)

toInMemoryChangePackage

public ChangePackage toInMemoryChangePackage()
Converts this file-based change package to an in-memory change package.
NOTE: for very big change packages this might cause a serious performance hit and also cause OutOfMemoryErrors.

Specified by:
toInMemoryChangePackage in interface FileBasedChangePackage
Returns:
an in-memory change-package
See Also:
FileBasedChangePackage.toInMemoryChangePackage()

save

public void save()
          throws IOException
Save this change package.

Specified by:
save in interface AbstractChangePackage
Throws:
IOException - in case saving fails
See Also:
AbstractChangePackage.save()

move

public void move(String newFilePath)
          throws IOException
Moves this change package.

Specified by:
move in interface FileBasedChangePackage
Parameters:
newFilePath - the file path where the change package should be moved to
Throws:
IOException - in case of an error during move
See Also:
FileBasedChangePackage.move(java.lang.String)


Copyright © 2016. All Rights Reserved.