org.eclipse.emf.emfstore.internal.client.model.impl
Class ProjectSpaceBase

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.common.model.impl.IdentifiableElementImpl
                  extended by org.eclipse.emf.emfstore.internal.client.model.impl.ProjectSpaceBase
All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.InternalEObject, ESLoginObserver, ESObserver, ProjectSpace, APIDelegate<ESLocalProjectImpl>, ESDisposable, IdentifiableElement
Direct Known Subclasses:
ProjectSpaceImpl

public abstract class ProjectSpaceBase
extends IdentifiableElementImpl
implements ProjectSpace, ESLoginObserver, ESDisposable

Project space base class that contains custom user methods.

Author:
koegel, wesendon, emueller, jfaltermeier

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
 
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
ELAST_EOBJECT_FLAG
 
Fields inherited from interface org.eclipse.emf.emfstore.internal.client.model.ProjectSpace
RUNNABLE_CONTEXT_ID
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Constructor Summary
ProjectSpaceBase()
          Constructor.
 
Method Summary
 FileIdentifier addFile(File file)
          Adds a file to this project space.
 FileIdentifier addFile(File file, String fileIdentifier)
          Adds a file to this project space.
 void addOperations(List<? extends AbstractOperation> operations)
          Adds a list of operations to this project space.
 void addTag(PrimaryVersionSpec versionSpec, TagVersionSpec tag)
          Adds a tag to the specified version of this project.
 void applyChanges(PrimaryVersionSpec baseSpec, List<ChangePackage> incoming, ChangePackage myChanges, org.eclipse.core.runtime.IProgressMonitor progressMonitor, boolean runChecksumTestOnBaseSpec)
          Helper method which applies merged changes on the ProjectSpace.
 void applyOperations(List<AbstractOperation> operations, boolean addOperations)
          Applies a list of operations to the project.
 void applyOperationsWithRerecording(List<AbstractOperation> operations)
          Applies a list of operations to the project.
 CompositeOperationHandle beginCompositeOperation()
          Begin a composite operation on the projectSpace.
 void cleanCutElements()
          Removes the elements that are marked as cutted from the project.
 PrimaryVersionSpec commit(org.eclipse.core.runtime.IProgressMonitor monitor)
          Commits all pending changes of the project space.
 PrimaryVersionSpec commit(String logMessage, ESCommitCallback callback, org.eclipse.core.runtime.IProgressMonitor monitor)
          Commits all pending changes of the project space.
 PrimaryVersionSpec commitToBranch(BranchVersionSpec branch, String logMessage, ESCommitCallback callback, org.eclipse.core.runtime.IProgressMonitor monitor)
          This method allows to commit changes to a new branch.
 ESLocalProjectImpl createAPI()
          Creates the API interface for this class.
 void delete(org.eclipse.core.runtime.IProgressMonitor monitor)
          Deletes the project space.
 void dispose()
          Marker method for classes that need to perform clean-up tasks.
 void executeRunnable(Runnable runnable)
          Executes a given Runnable in the context of this ProjectSpace.
The Runnable usually modifies the Project contained in the ProjectSpace.
 void exportLocalChanges(File file)
          Export all local changes to a file.
 void exportLocalChanges(File file, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
          Export all local changes to a file.
 void exportProject(File file)
          Export a project to the given file.
 void exportProject(File file, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
          Export a project to the given file.
 Collection<org.eclipse.emf.ecore.EStructuralFeature.Setting> findInverseCrossReferences(org.eclipse.emf.ecore.EObject modelElement)
          Returns the ECrossReferenceAdapter, if available.
 List<BranchInfo> getBranches()
          Returns a list of branches of the current project.
 List<ChangePackage> getChanges(VersionSpec sourceVersion, VersionSpec targetVersion)
          
 FileDownloadStatus getFile(FileIdentifier fileIdentifier)
          Gets a file with a specific identifier.
 FileInformation getFileInfo(FileIdentifier fileIdentifier)
          Gets the file information for a specific file identifier.
 FileTransferManager getFileTransferManager()
          Returns the file transfer manager.
 ChangePackage getLocalChangePackage(boolean canonize)
          Gathers all local operations and canonizes them.
 NotificationRecorder getNotificationRecorder()
          Get the current notification recorder.
 OperationManager getOperationManager()
          Get the OperationManager for this ProjectSpace.
 List<AbstractOperation> getOperations()
          Return the list of operations that have already been performed on the project space.
 ProjectInfo getProjectInfo()
          Get a project info for the project space.
 PropertyManager getPropertyManager()
          Get the PropertyManager for this ProjectSpace.
 org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
          Returns the resource set of the ProjectSpace.
 ESRunnableContext getRunnableContext()
          Returns the ESRunnableContext operations are applied in.
 boolean hasUnsavedChanges()
          Determine if the project space has unsaved changes to any element in the project.
 void importLocalChanges(String fileName)
          Import changes from a file.
 void init()
          Initialize the project space and its resources.
 void initResources(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Initialize the resources of the project space.
 boolean isShared()
          Whether this project space has been shared.
 boolean isTransient()
          Shows whether projectSpace is transient.
 boolean isUpdated()
          Determines whether the project is up to date, that is, whether the base revision and the head revision are equal.
 void loginCompleted(ESUsersession session)
          To be called when login is completed.
 void makeTransient()
          Will make the projectSpace transient, it will not make its content or changes persistent.
 void mergeBranch(PrimaryVersionSpec branchSpec, ConflictResolver conflictResolver, org.eclipse.core.runtime.IProgressMonitor monitor)
          Allows to merge a version from another branch into the current project space.
 ChangePackage mergeResolvedConflicts(ChangeConflictSet conflictSet, List<ChangePackage> myChangePackages, List<ChangePackage> theirChangePackages)
          Merges the resolved conflict sets.
 void removeTag(PrimaryVersionSpec versionSpec, TagVersionSpec tag)
          Removes a tag to the specified version of this project.
 org.eclipse.emf.ecore.EObject resolve(ModelElementUrlFragment modelElementUrlFragment)
          Resolve the url to a model element.
 PrimaryVersionSpec resolveVersionSpec(VersionSpec versionSpec, org.eclipse.core.runtime.IProgressMonitor monitor)
          Resolve a version spec to a primary version spec.
 void revert()
          Revert all local changes in the project space.
 void save()
          Saves the project space.
 void saveProjectSpaceOnly()
          Saves the project space itself only, no containment children.
 void saveResource(org.eclipse.emf.ecore.resource.Resource resource)
          Save the given resource that is part of the project space resource set.
 void setProperty(OrgUnitProperty property)
          Sets a new OrgUnitProperty for the current user.
 void setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Sets the resource set of the project space.
 void setRunnableContext(ESRunnableContext runnableContext)
           Provides a context in which a Runnable is executed.
 ProjectInfo shareProject(org.eclipse.core.runtime.IProgressMonitor monitor)
          Shares this project space.
 ProjectInfo shareProject(Usersession session, org.eclipse.core.runtime.IProgressMonitor monitor)
          Shares this project space.
 void startChangeRecording()
          Starts change recording on this workspace, resumes previous recordings if there are any.
 void stopChangeRecording()
          Stops current recording of changes and adds recorded changes to this project spaces changes.
 ESLocalProjectImpl toAPI()
          Returns the API interface of this class.
 void transmitProperties()
          Transmit the OrgUnitproperties to the server.
 void undoLastOperation()
          Undo the last operation of the projectSpace.
 void undoLastOperations(int numberOfOperations)
          Undo the last operation n operations of the projectSpace.
 PrimaryVersionSpec update(org.eclipse.core.runtime.IProgressMonitor monitor)
          Update the project to the head version.
 PrimaryVersionSpec update(VersionSpec version)
          Update the project to the given version.
 PrimaryVersionSpec update(VersionSpec version, ESUpdateCallback callback, org.eclipse.core.runtime.IProgressMonitor progress)
          Update the workspace to the given revision.
 void updateDirtyState()
          Updates the dirty state of the project space.
 
Methods inherited from class org.eclipse.emf.emfstore.internal.common.model.impl.IdentifiableElementImpl
eGet, eIsSet, eSet, eUnset, getIdentifier, setIdentifier, 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, 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.emfstore.internal.client.model.ProjectSpace
getBaseVersion, getChangedSharedProperties, getLastUpdated, getLocalChangePackage, getMergedVersion, getOldLogMessages, getProject, getProjectDescription, getProjectId, getProjectName, getProperties, getResourceCount, getUsersession, getWaitingUploads, getWorkspace, isDirty, setBaseVersion, setDirty, setLastUpdated, setLocalChangePackage, setMergedVersion, setProject, setProjectDescription, setProjectId, setProjectName, setResourceCount, setUsersession, setWorkspace
 
Methods inherited from interface org.eclipse.emf.emfstore.internal.common.model.IdentifiableElement
getIdentifier, setIdentifier
 
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
 

Constructor Detail

ProjectSpaceBase

public ProjectSpaceBase()
Constructor.

Method Detail

setRunnableContext

public void setRunnableContext(ESRunnableContext runnableContext)

Provides a context in which a Runnable is executed.

This may be used to provide a context while applying operations on a ESLocalProject.

Specified by:
setRunnableContext in interface ProjectSpace
Parameters:
runnableContext - the runnable context to be set

addFile

public FileIdentifier addFile(File file)
                       throws FileTransferException
Adds a file to this project space. The file will be uploaded to the EMFStore upon a commit. As long as the file is not yet committed, it can be removed by first retrieving the FileInformation via ProjectSpace.getFileInfo(FileIdentifier) and then remove it via FileInformation.cancelPendingUpload().

Specified by:
addFile in interface ProjectSpace
Parameters:
file - to be added to the project space
Returns:
The file identifier the file was assigned to. This identifier can be used to retrieve the file later on
Throws:
FileTransferException - if any error occurs
See Also:
ProjectSpace.addFile(java.io.File)

addFile

public FileIdentifier addFile(File file,
                              String fileIdentifier)
                       throws FileTransferException
Adds a file to this project space. The file will be uploaded to the EMFStore upon a commit. As long as the file is not yet committed, it can be removed by first retrieving the FileInformation via ProjectSpace.getFileInfo(FileIdentifier) and then remove it via FileInformation.cancelPendingUpload().

Specified by:
addFile in interface ProjectSpace
Parameters:
file - to be added to the project space
fileIdentifier - the file identifier to be used for the given file
Returns:
The file identifier the file was assigned to. This identifier can be used to retrieve the file later on
Throws:
FileTransferException - if any error occurs
See Also:
ProjectSpace.addFile(java.io.File, java.lang.String)

addOperations

public void addOperations(List<? extends AbstractOperation> operations)
Adds a list of operations to this project space.

Specified by:
addOperations in interface ProjectSpace
Parameters:
operations - the list of operations to be added
See Also:
ProjectSpace.addOperations(java.util.List)

addTag

public void addTag(PrimaryVersionSpec versionSpec,
                   TagVersionSpec tag)
            throws ESException
Adds a tag to the specified version of this project.

Specified by:
addTag in interface ProjectSpace
Parameters:
versionSpec - the versionSpec
tag - the tag
Throws:
ESException - if exception occurs on the server
See Also:
ProjectSpace.addTag(org.eclipse.emf.emfstore.internal.server.model.versioning.PrimaryVersionSpec, org.eclipse.emf.emfstore.internal.server.model.versioning.TagVersionSpec)

applyChanges

public void applyChanges(PrimaryVersionSpec baseSpec,
                         List<ChangePackage> incoming,
                         ChangePackage myChanges,
                         org.eclipse.core.runtime.IProgressMonitor progressMonitor,
                         boolean runChecksumTestOnBaseSpec)
                  throws ESException
Helper method which applies merged changes on the ProjectSpace. This method is used by merge mechanisms in update as well as branch merging.

Parameters:
baseSpec - new base version
incoming - changes from the current branch
myChanges - merged changes
progressMonitor - an IProgressMonitor to inform about the progress of the UpdateCallback in case it is called
runChecksumTestOnBaseSpec - whether the checksum check is performed while applying the changes
Throws:
ESException - in case the checksum comparison failed and the activated IChecksumErrorHandler also failed

applyOperations

public void applyOperations(List<AbstractOperation> operations,
                            boolean addOperations)
Applies a list of operations to the project. The change tracking will be stopped meanwhile.

Parameters:
operations - the list of operations to be applied upon the project space
addOperations - whether the operations should be saved in project space

applyOperationsWithRerecording

public void applyOperationsWithRerecording(List<AbstractOperation> operations)
Applies a list of operations to the project. The change tracking will be stopped meanwhile.

Parameters:
operations - the list of operations to be applied upon the project space

executeRunnable

public void executeRunnable(Runnable runnable)
Executes a given Runnable in the context of this ProjectSpace.
The Runnable usually modifies the Project contained in the ProjectSpace.

Parameters:
runnable - the Runnable to be executed in the context of this ProjectSpace

beginCompositeOperation

public CompositeOperationHandle beginCompositeOperation()
Begin a composite operation on the projectSpace.

Specified by:
beginCompositeOperation in interface ProjectSpace
Returns:
a handle to abort or complete the operation
See Also:
ProjectSpace.beginCompositeOperation()

cleanCutElements

public void cleanCutElements()
Removes the elements that are marked as cutted from the project.


commit

public PrimaryVersionSpec commit(org.eclipse.core.runtime.IProgressMonitor monitor)
                          throws ESException
Commits all pending changes of the project space.

Specified by:
commit in interface ProjectSpace
Parameters:
monitor - a progress monitor that may be used during the commit to indicate the progress
Returns:
the current version specification
Throws:
ESException - in case the commit went wrong
See Also:
ProjectSpace.commit(org.eclipse.core.runtime.IProgressMonitor)

commit

public PrimaryVersionSpec commit(String logMessage,
                                 ESCommitCallback callback,
                                 org.eclipse.core.runtime.IProgressMonitor monitor)
                          throws ESException
Commits all pending changes of the project space.

Specified by:
commit in interface ProjectSpace
Parameters:
logMessage - a log message describing the changes to be committed
callback - an optional callback method to be performed while the commit is in progress, may be null
monitor - an optional progress monitor to be used while the commit is in progress, may be null
Returns:
the current version specification
Throws:
ESException - in case the commit went wrong
See Also:
ProjectSpace.commit(java.lang.String, org.eclipse.emf.emfstore.client.callbacks.ESCommitCallback, org.eclipse.core.runtime.IProgressMonitor)

commitToBranch

public PrimaryVersionSpec commitToBranch(BranchVersionSpec branch,
                                         String logMessage,
                                         ESCommitCallback callback,
                                         org.eclipse.core.runtime.IProgressMonitor monitor)
                                  throws ESException
This method allows to commit changes to a new branch. It works very similar to ProjectSpace.commit(IProgressMonitor) with the addition of a Branch specifier. Once the branch is created use ProjectSpace.commit(IProgressMonitor) for further commits.

Specified by:
commitToBranch in interface ProjectSpace
Parameters:
branch - branch specifier
logMessage - optional log message
callback - optional callback, passing an implementation is recommended
monitor - optional progress monitor
Returns:
the created version
Throws:
ESException - in case of an exception

exportLocalChanges

public void exportLocalChanges(File file,
                               org.eclipse.core.runtime.IProgressMonitor progressMonitor)
                        throws IOException
Export all local changes to a file.

Specified by:
exportLocalChanges in interface ProjectSpace
Parameters:
file - the file being exported to
progressMonitor - the progress monitor that should be used while exporting
Throws:
IOException - if writing to the given file fails
See Also:
ProjectSpace.exportLocalChanges(java.io.File, org.eclipse.core.runtime.IProgressMonitor)

exportLocalChanges

public void exportLocalChanges(File file)
                        throws IOException
Export all local changes to a file.

Specified by:
exportLocalChanges in interface ProjectSpace
Parameters:
file - the file being exported to
Throws:
IOException - if writing to the given file fails
See Also:
ProjectSpace.exportLocalChanges(java.io.File)

exportProject

public void exportProject(File file,
                          org.eclipse.core.runtime.IProgressMonitor progressMonitor)
                   throws IOException
Export a project to the given file.

Specified by:
exportProject in interface ProjectSpace
Parameters:
file - the file being exported to
progressMonitor - the progress monitor that should be used during the export
Throws:
IOException - if writing to the given file fails
See Also:
ProjectSpace.exportProject(java.io.File, org.eclipse.core.runtime.IProgressMonitor)

exportProject

public void exportProject(File file)
                   throws IOException
Export a project to the given file.

Specified by:
exportProject in interface ProjectSpace
Parameters:
file - the file being exported to
Throws:
IOException - if writing to the given file fails
See Also:
ProjectSpace.exportProject(java.io.File)

getChanges

public List<ChangePackage> getChanges(VersionSpec sourceVersion,
                                      VersionSpec targetVersion)
                               throws InvalidVersionSpecException,
                                      ESException

Specified by:
getChanges in interface ProjectSpace
Parameters:
sourceVersion - the source version spec
targetVersion - the target version spec
Returns:
a list of the change packages between two PrimarySpecVersions.
Throws:
ESException - if any error in the EmfStore occurs
InvalidVersionSpecException
See Also:
ProjectSpace.getChanges(org.eclipse.emf.emfstore.internal.server.model.versioning.VersionSpec, org.eclipse.emf.emfstore.internal.server.model.versioning.VersionSpec)

getFile

public FileDownloadStatus getFile(FileIdentifier fileIdentifier)
                           throws FileTransferException
Gets a file with a specific identifier. If the file is not cached locally, it is tried to download the file if a connection to the sever exists. If the file cannot be found locally and not on the server (or the server isn't reachable), a FileTransferException is thrown. Such an exception is also thrown if other errors occur while trying to download the file. The method returns not the file itself, because it does not block in case of downloading the file. Instead, it returns a status object which can be queried for the status of the download. Once the download is finished ( status.isFinished() ), the file can be retrieved from this status object by calling status.getTransferredFile().

Specified by:
getFile in interface ProjectSpace
Parameters:
fileIdentifier - file identifier string.
Returns:
a status object that can be used to retrieve various information about the file.
Throws:
FileTransferException - if any error occurs retrieving the files
See Also:
ProjectSpace.getFile(org.eclipse.emf.emfstore.internal.server.model.FileIdentifier)

getFileInfo

public FileInformation getFileInfo(FileIdentifier fileIdentifier)
Gets the file information for a specific file identifier. This file information can be used to access further details of a file (if it exists, is cached, is a pending upload). It can also be used to alter the file in limited ways (like removing a pending upload). The FileInformation class is basically a facade to keep the interface in the project space small (only getFileInfo) while still providing a rich interface for files.

Specified by:
getFileInfo in interface ProjectSpace
Parameters:
fileIdentifier - the file identifier for which to get the information
Returns:
the information for that identifier.
See Also:
ProjectSpace.getFileInfo(org.eclipse.emf.emfstore.internal.server.model.FileIdentifier)

getLocalChangePackage

public ChangePackage getLocalChangePackage(boolean canonize)
Gathers all local operations and canonizes them.

Specified by:
getLocalChangePackage in interface ProjectSpace
Parameters:
canonize - true if the operations should be canonized
Returns:
the list of operations
See Also:
ProjectSpace.getLocalChangePackage()

getNotificationRecorder

public NotificationRecorder getNotificationRecorder()
Get the current notification recorder.

Returns:
the recorder

getOperationManager

public OperationManager getOperationManager()
Get the OperationManager for this ProjectSpace.

Specified by:
getOperationManager in interface ProjectSpace
Returns:
the operation manager
See Also:
ProjectSpace.getOperationManager()

getOperations

public List<AbstractOperation> getOperations()
Return the list of operations that have already been performed on the project space.

Specified by:
getOperations in interface ProjectSpace
Returns:
a list of operations
See Also:
ProjectSpace.getOperations()

getProjectInfo

public ProjectInfo getProjectInfo()
Get a project info for the project space.

Specified by:
getProjectInfo in interface ProjectSpace
Returns:
a project info
See Also:
ProjectSpace.getProjectInfo()

getPropertyManager

public PropertyManager getPropertyManager()
Get the PropertyManager for this ProjectSpace.

Specified by:
getPropertyManager in interface ProjectSpace
Returns:
the property manager
See Also:
ProjectSpace.getPropertyManager()

importLocalChanges

public void importLocalChanges(String fileName)
                        throws IOException
Import changes from a file.

Specified by:
importLocalChanges in interface ProjectSpace
Parameters:
fileName - the file name to import from
Throws:
IOException - if file access fails
See Also:
ProjectSpace.importLocalChanges(java.lang.String)

init

public void init()
Initialize the project space and its resources.

Specified by:
init in interface ProjectSpace
See Also:
ProjectSpace.init()

getFileTransferManager

public FileTransferManager getFileTransferManager()
Returns the file transfer manager.

Returns:
the file transfer manager

initResources

public void initResources(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Initialize the resources of the project space.

Specified by:
initResources in interface ProjectSpace
Parameters:
resourceSet - the resource set the project space should use
See Also:
ProjectSpace.initResources(org.eclipse.emf.ecore.resource.ResourceSet)

delete

public void delete(org.eclipse.core.runtime.IProgressMonitor monitor)
            throws IOException
Deletes the project space.

Specified by:
delete in interface ProjectSpace
Parameters:
monitor - a progress monitor that may be used during the delete to indicate the progress
Throws:
IOException - in case the project space could not be deleted
See Also:
ProjectSpace.delete(org.eclipse.core.runtime.IProgressMonitor)

findInverseCrossReferences

public Collection<org.eclipse.emf.ecore.EStructuralFeature.Setting> findInverseCrossReferences(org.eclipse.emf.ecore.EObject modelElement)
Returns the ECrossReferenceAdapter, if available.

Parameters:
modelElement - the model element for which to find inverse cross references
Returns:
the ECrossReferenceAdapter

getResourceSet

public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
Returns the resource set of the ProjectSpace.

Specified by:
getResourceSet in interface ProjectSpace
Returns:
resource set of the ProjectSpace
See Also:
ProjectSpace.getResourceSet()

setResourceSet

public void setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Sets the resource set of the project space.

Specified by:
setResourceSet in interface ProjectSpace
Parameters:
resourceSet - the resource set to be used by this project space
See Also:
ProjectSpace.setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet)

isTransient

public boolean isTransient()
Shows whether projectSpace is transient.

Specified by:
isTransient in interface ProjectSpace
Returns:
true, if transient.
See Also:
ProjectSpace.isTransient()

isUpdated

public boolean isUpdated()
                  throws ESException
Determines whether the project is up to date, that is, whether the base revision and the head revision are equal.

Specified by:
isUpdated in interface ProjectSpace
Returns:
true, if the project is up to date, false otherwise
Throws:
ESException - if the head revision can not be resolved
See Also:
ProjectSpace.isUpdated()

loginCompleted

public void loginCompleted(ESUsersession session)
To be called when login is completed.

Specified by:
loginCompleted in interface ESLoginObserver
Parameters:
session - the ESUsersession which has been logged in

makeTransient

public void makeTransient()
Will make the projectSpace transient, it will not make its content or changes persistent. Can only be called before the resources or the project space have been initialized.

Specified by:
makeTransient in interface ProjectSpace
See Also:
ProjectSpace.makeTransient()

mergeBranch

public void mergeBranch(PrimaryVersionSpec branchSpec,
                        ConflictResolver conflictResolver,
                        org.eclipse.core.runtime.IProgressMonitor monitor)
                 throws ESException
Allows to merge a version from another branch into the current project space.

Specified by:
mergeBranch in interface ProjectSpace
Parameters:
branchSpec - the version which is supposed to be merged
conflictResolver - a ConflictResolver for conflict resolving
monitor - a progress monitor that may be used during the merge to indicate the progress
Throws:
ESException - in case of an exception

mergeResolvedConflicts

public ChangePackage mergeResolvedConflicts(ChangeConflictSet conflictSet,
                                            List<ChangePackage> myChangePackages,
                                            List<ChangePackage> theirChangePackages)
                                     throws ChangeConflictException
Merges the resolved conflict sets.

Specified by:
mergeResolvedConflicts in interface ProjectSpace
Parameters:
conflictSet - a set containing the conflicts
myChangePackages - a list of local change packages
theirChangePackages - a list of containing the incoming change packages
Returns:
a merge change package
Throws:
ChangeConflictException - in case the conflicts can not be resolved
See Also:
ProjectSpace.mergeResolvedConflicts(org.eclipse.emf.emfstore.internal.server.conflictDetection.ChangeConflictSet, java.util.List, java.util.List)

getBranches

public List<BranchInfo> getBranches()
                             throws ESException
Returns a list of branches of the current project. Every call triggers a server call.

Specified by:
getBranches in interface ProjectSpace
Returns:
list of BranchInfo
Throws:
ESException - in case of an exception
See Also:
ProjectSpace.getBranches()

removeTag

public void removeTag(PrimaryVersionSpec versionSpec,
                      TagVersionSpec tag)
               throws ESException
Removes a tag to the specified version of this project.

Specified by:
removeTag in interface ProjectSpace
Parameters:
versionSpec - the versionSpec
tag - the tag
Throws:
ESException - if exception occurs on the server
See Also:
ProjectSpace.removeTag(org.eclipse.emf.emfstore.internal.server.model.versioning.PrimaryVersionSpec, org.eclipse.emf.emfstore.internal.server.model.versioning.TagVersionSpec)

resolve

public org.eclipse.emf.ecore.EObject resolve(ModelElementUrlFragment modelElementUrlFragment)
                                      throws MEUrlResolutionException
Resolve the url to a model element.

Specified by:
resolve in interface ProjectSpace
Parameters:
modelElementUrlFragment - the url
Returns:
the model element
Throws:
MEUrlResolutionException - if model element does not exist in project.
See Also:
ProjectSpace.resolve(org.eclipse.emf.emfstore.internal.server.model.url.ModelElementUrlFragment)

resolveVersionSpec

public PrimaryVersionSpec resolveVersionSpec(VersionSpec versionSpec,
                                             org.eclipse.core.runtime.IProgressMonitor monitor)
                                      throws InvalidVersionSpecException,
                                             ESException
Resolve a version spec to a primary version spec.

Specified by:
resolveVersionSpec in interface ProjectSpace
Parameters:
versionSpec - the spec to resolve
monitor - a progress monitor that may be used during resolving the version to indicate the progress
Returns:
the primary version specifier
Throws:
ESException - if resolving fails
InvalidVersionSpecException
See Also:
ProjectSpace.resolveVersionSpec(org.eclipse.emf.emfstore.internal.server.model.versioning.VersionSpec, org.eclipse.core.runtime.IProgressMonitor)

revert

public void revert()
Revert all local changes in the project space. Returns the state of the project to that of the project space base version.

Specified by:
revert in interface ProjectSpace
See Also:
ProjectSpace.revert()

saveProjectSpaceOnly

public void saveProjectSpaceOnly()
Saves the project space itself only, no containment children.


save

public void save()
Saves the project space.

Specified by:
save in interface ProjectSpace

hasUnsavedChanges

public boolean hasUnsavedChanges()
Determine if the project space has unsaved changes to any element in the project.

Specified by:
hasUnsavedChanges in interface ProjectSpace
Returns:
true if there is unsaved changes.
See Also:
ProjectSpace.hasUnsavedChanges()

saveResource

public void saveResource(org.eclipse.emf.ecore.resource.Resource resource)
Save the given resource that is part of the project space resource set.

Parameters:
resource - the resource

setProperty

public void setProperty(OrgUnitProperty property)
Sets a new OrgUnitProperty for the current user.

Specified by:
setProperty in interface ProjectSpace
Parameters:
property - the new property
See Also:
ProjectSpace.setProperty(org.eclipse.emf.emfstore.internal.server.model.accesscontrol.OrgUnitProperty)

shareProject

public ProjectInfo shareProject(org.eclipse.core.runtime.IProgressMonitor monitor)
                         throws ESException
Shares this project space.

Specified by:
shareProject in interface ProjectSpace
Returns:
the project info of the created project
Throws:
ESException - if an error occurs during the sharing of the project
See Also:
ProjectSpace.shareProject(org.eclipse.core.runtime.IProgressMonitor)

shareProject

public ProjectInfo shareProject(Usersession session,
                                org.eclipse.core.runtime.IProgressMonitor monitor)
                         throws ESException
Shares this project space.

Specified by:
shareProject in interface ProjectSpace
Parameters:
session - the Usersession that should be used for sharing the project
monitor - an instance of an IProgressMonitor
Returns:
the project info of the remote project
Throws:
ESException - if an error occurs during the sharing of the project
See Also:
ProjectSpace.shareProject(org.eclipse.emf.emfstore.internal.client.model.Usersession, org.eclipse.core.runtime.IProgressMonitor)

startChangeRecording

public void startChangeRecording()
Starts change recording on this workspace, resumes previous recordings if there are any.


stopChangeRecording

public void stopChangeRecording()
Stops current recording of changes and adds recorded changes to this project spaces changes.


transmitProperties

public void transmitProperties()
Transmit the OrgUnitproperties to the server.

Specified by:
transmitProperties in interface ProjectSpace
See Also:
ProjectSpace.transmitProperties()

undoLastOperation

public void undoLastOperation()
Undo the last operation of the projectSpace.

Specified by:
undoLastOperation in interface ProjectSpace
See Also:
ProjectSpace.undoLastOperation()

undoLastOperations

public void undoLastOperations(int numberOfOperations)
Undo the last operation n operations of the projectSpace.

Specified by:
undoLastOperations in interface ProjectSpace
Parameters:
numberOfOperations - the number of operations to be undone
See Also:
ProjectSpace.undoLastOperation()

update

public PrimaryVersionSpec update(org.eclipse.core.runtime.IProgressMonitor monitor)
                          throws ESException
Update the project to the head version.

Specified by:
update in interface ProjectSpace
Parameters:
monitor - a progress monitor that may be used during update to indicate progress
Returns:
the new base version
Throws:
ESException - if update fails
See Also:
ProjectSpace.update(org.eclipse.core.runtime.IProgressMonitor)

update

public PrimaryVersionSpec update(VersionSpec version)
                          throws ESException
Update the project to the given version.

Specified by:
update in interface ProjectSpace
Parameters:
version - the version to update to
Returns:
the new base version
Throws:
ESException - if update fails
See Also:
ProjectSpace.update(org.eclipse.emf.emfstore.internal.server.model.versioning.VersionSpec)

update

public PrimaryVersionSpec update(VersionSpec version,
                                 ESUpdateCallback callback,
                                 org.eclipse.core.runtime.IProgressMonitor progress)
                          throws ESException
Update the workspace to the given revision.

Specified by:
update in interface ProjectSpace
Parameters:
version - the VersionSpec to update to
callback - the ESUpdateCallback that will be called when the update has been performed
progress - an IProgressMonitor instance
Returns:
the current version specifier
Throws:
ESException - in case the update went wrong
See Also:
ProjectSpace.update(org.eclipse.emf.emfstore.internal.server.model.versioning.VersionSpec, org.eclipse.emf.emfstore.client.callbacks.ESUpdateCallback, org.eclipse.core.runtime.IProgressMonitor)

updateDirtyState

public void updateDirtyState()
Updates the dirty state of the project space.


dispose

public void dispose()
Marker method for classes that need to perform clean-up tasks.

Specified by:
dispose in interface ESDisposable
See Also:
ESDisposable.dispose()

isShared

public boolean isShared()
Whether this project space has been shared.

Specified by:
isShared in interface ProjectSpace
Returns:
true, if the project space has been shared, false otherwise
See Also:
ProjectSpace.isShared()

toAPI

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

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

createAPI

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

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

getRunnableContext

public ESRunnableContext getRunnableContext()
Returns the ESRunnableContext operations are applied in.

Returns:
the runnable context operations are executed in


Copyright © 2015. All Rights Reserved.