|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.emf.emfstore.internal.common.api.AbstractAPIImpl<ESLocalProjectImpl,ProjectSpace>
org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl
public class ESLocalProjectImpl
Mapping between ESLocalProject and ProjectSpace.
All methods except getModelElements() are wrapped in commands by default.
| Constructor Summary | |
|---|---|
ESLocalProjectImpl(ProjectSpace projectSpace)
Constructor. |
|
| Method Summary | ||
|---|---|---|
void |
addTag(ESPrimaryVersionSpec versionSpec,
ESTagVersionSpec tag,
org.eclipse.core.runtime.IProgressMonitor monitor)
Adds a tag to the specified version of this project on the server. |
|
void |
addToWorkspace(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
Adds this project to the workspace. |
|
ESPrimaryVersionSpec |
commit(org.eclipse.core.runtime.IProgressMonitor monitor)
Commits any local changes. |
|
ESPrimaryVersionSpec |
commit(String logMessage,
ESCommitCallback callback,
org.eclipse.core.runtime.IProgressMonitor monitor)
Commits any local changes. |
|
ESPrimaryVersionSpec |
commitToBranch(ESBranchVersionSpec branch,
String logMessage,
ESCommitCallback callback,
org.eclipse.core.runtime.IProgressMonitor monitor)
Commits any local changes to a branch. |
|
boolean |
contains(org.eclipse.emf.ecore.EObject modelElement)
Checks whether a given EObject is contained in the collection. |
|
boolean |
contains(ESModelElementId modelElementId)
Checks whether the EObject with the given ESModelElementId is contained in the collection. |
|
void |
delete(org.eclipse.core.runtime.IProgressMonitor monitor)
Deletes the project. |
|
Set<org.eclipse.emf.ecore.EObject> |
getAllModelElements()
Returns a flat representation of all model elements in the collection. |
|
|
getAllModelElementsByClass(Class<T> modelElementClass)
Retrieve a list of all model elements of a certain type in the collection. |
|
|
getAllModelElementsByClass(Class<T> modelElementClass,
Boolean includeSubclasses)
Retrieve a list of all model elements of a certain type in the collection. |
|
ESPrimaryVersionSpec |
getBaseVersion()
Returns the base version of the project. |
|
List<ESBranchInfo> |
getBranches(org.eclipse.core.runtime.IProgressMonitor monitor)
Returns a list of branches for the current project. |
|
ESGlobalProjectId |
getGlobalProjectId()
Returns the global ID of the project. |
|
List<ESHistoryInfo> |
getHistoryInfos(ESHistoryQuery<? extends ESHistoryQuery<?>> query,
org.eclipse.core.runtime.IProgressMonitor monitor)
Retrieves a part of the project's version history from the server based on the given query. |
|
Date |
getLastUpdated()
Returns the Date when the project was updated the last time. |
|
ESLocalProjectId |
getLocalProjectId()
Returns a locally unique ID for the project. |
|
org.eclipse.emf.ecore.EObject |
getModelElement(ESModelElementId modelElementId)
Returns the model element with the given ESModelElementId. |
|
ESModelElementIdImpl |
getModelElementId(org.eclipse.emf.ecore.EObject modelElement)
Retrieve the ESModelElementId of the given model element. |
|
org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> |
getModelElements()
Returns all directly contained model element of the container, i.e. |
|
String |
getProjectName()
Returns the project's name. |
|
List<String> |
getRecentLogMessages()
Returns a list with copies of the most recent log messages. |
|
ESRemoteProjectImpl |
getRemoteProject()
Returns the ESRemoteProject on a server this local project is associated with. |
|
ESUsersessionImpl |
getUsersession()
Returns the ESUsersession associated with this project, if any. |
|
boolean |
hasUncommitedChanges()
Determines whether the project has uncommitted changes. |
|
boolean |
hasUnsavedChanges()
Determines whether the project has unsaved changes. |
|
boolean |
isShared()
Whether this project has been shared. |
|
boolean |
isUpdated()
Determines whether the project is up to date, that is, whether the base revision and the head revision are equal. |
|
void |
removeTag(ESPrimaryVersionSpec versionSpec,
ESTagVersionSpec tag,
org.eclipse.core.runtime.IProgressMonitor monitor)
Removes a tag from the specified version of this project on the server. |
|
ESPrimaryVersionSpec |
resolveVersionSpec(ESVersionSpec versionSpec,
org.eclipse.core.runtime.IProgressMonitor monitor)
Resolves a ESVersionSpec to a ESPrimaryVersionSpec by querying the server. |
|
void |
revert()
Revert all local changes in the project space. |
|
void |
save()
Saves the project space. |
|
ESRemoteProject |
shareProject(ESUsersession session,
org.eclipse.core.runtime.IProgressMonitor monitor)
Shares this project. |
|
void |
shareProject(org.eclipse.core.runtime.IProgressMonitor monitor)
Shares this project. |
|
void |
undoLastOperation()
Undoes the last operation of the project. |
|
void |
undoLastOperations(int nrOperations)
Undo the last operation n operations of the project. |
|
ESPrimaryVersionSpec |
update(ESVersionSpec versionSpec,
ESUpdateCallback callback,
org.eclipse.core.runtime.IProgressMonitor monitor)
Updates the project to the given version from the server. |
|
ESPrimaryVersionSpec |
update(org.eclipse.core.runtime.IProgressMonitor monitor)
Updates the project to the head version from the server. |
|
| Methods inherited from class org.eclipse.emf.emfstore.internal.common.api.AbstractAPIImpl |
|---|
equals, hashCode, toInternalAPI |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ESLocalProjectImpl(ProjectSpace projectSpace)
projectSpace - the delegate| Method Detail |
|---|
public ESGlobalProjectId getGlobalProjectId()
getGlobalProjectId in interface ESProjectESProject.getGlobalProjectId()public String getProjectName()
getProjectName in interface ESProjectESProject.getProjectName()
public void delete(org.eclipse.core.runtime.IProgressMonitor monitor)
throws IOException
Deletes the project.
When calling this method on a remote project it is recommended to use the overloaded method which allows to
specify an ESUsersession.
delete in interface ESProjectmonitor - an IProgressMonitor instance that is used to indicate progress while deleting the project
IOException - in case an I/O related error occurred while deleting the projectESProject.delete(org.eclipse.core.runtime.IProgressMonitor)
public ESPrimaryVersionSpec resolveVersionSpec(ESVersionSpec versionSpec,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ESException
ESVersionSpec to a ESPrimaryVersionSpec by querying the server.
When calling this method on a remote project it is recommended to use the overloaded method which allows to
specify an ESUsersession.
resolveVersionSpec in interface ESProjectversionSpec - the ESVersionSpec to resolvemonitor - an IProgressMonitor instance that is used to indicate progress while resolving the version
ESPrimaryVersionSpec
ESException - in case an error occurs while resolving the given ESVersionSpecESProject.resolveVersionSpec(org.eclipse.emf.emfstore.server.model.versionspec.ESVersionSpec,
org.eclipse.core.runtime.IProgressMonitor)
public List<ESBranchInfo> getBranches(org.eclipse.core.runtime.IProgressMonitor monitor)
throws ESException
Returns a list of branches for the current project.
When calling this method on a remote project it is recommended to use the overloaded method which allows to
specify an ESUsersession.
getBranches in interface ESProjectmonitor - an IProgressMonitor instance that is used to indicate progress while fetching the branch
information
ESException - in case an error occurs while retrieving the branch information for the projectESProject.getBranches(org.eclipse.core.runtime.IProgressMonitor)
public void addTag(ESPrimaryVersionSpec versionSpec,
ESTagVersionSpec tag,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ESException
Adds a tag to the specified version of this project on the server.
When calling this method on a remote project it is recommended to use the overloaded method which allows to
specify an ESUsersession.
addTag in interface ESProjectversionSpec - the ESPrimaryVersionSpec that should be taggedtag - the tag being createdmonitor - an IProgressMonitor instance that is used to indicate progress while adding the tag
ESException - in case the given tag could not be removedESProject.addTag(org.eclipse.emf.emfstore.server.model.versionspec.ESPrimaryVersionSpec,
org.eclipse.emf.emfstore.server.model.versionspec.ESTagVersionSpec,
org.eclipse.core.runtime.IProgressMonitor)
public void removeTag(ESPrimaryVersionSpec versionSpec,
ESTagVersionSpec tag,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ESException
Removes a tag from the specified version of this project on the server.
When calling this method on a remote project it is recommended to use the overloaded method which allows to
specify an ESUsersession.
removeTag in interface ESProjectversionSpec - the ESPrimaryVersionSpec identifying the version from which the tag should be removedtag - the ESTagVersionSpec to be removedmonitor - an IProgressMonitor instance that is used to indicate progress while removing the tag
ESException - in case the given tag could not be removedESProject.removeTag(org.eclipse.emf.emfstore.server.model.versionspec.ESPrimaryVersionSpec,
org.eclipse.emf.emfstore.server.model.versionspec.ESTagVersionSpec,
org.eclipse.core.runtime.IProgressMonitor)public org.eclipse.emf.ecore.EObject getModelElement(ESModelElementId modelElementId)
ESModelElementId.
getModelElement in interface ESObjectContainer<ESModelElementId>modelElementId - the ID of the model element, that should be retrieved
ESObjectContainer.getModelElement(java.lang.Object)public ESModelElementIdImpl getModelElementId(org.eclipse.emf.ecore.EObject modelElement)
ESModelElementId of the given model element.
getModelElementId in interface ESObjectContainer<ESModelElementId>modelElement - the model element for which to retrieve the ID for
ESModelElementId of the given model elementESObjectContainer.getModelElementId(org.eclipse.emf.ecore.EObject)public org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> getModelElements()
getModelElements in interface ESObjectContainer<ESModelElementId>ESObjectContainer.getModelElements()public Set<org.eclipse.emf.ecore.EObject> getAllModelElements()
Returns a flat representation of all model elements in the collection.
The returned set is not modifiable and will throw an UnsupportedOperationException in case trying to do
so.
getAllModelElements in interface ESObjectContainer<ESModelElementId>ESObjectContainer.getAllModelElements()
public <T extends org.eclipse.emf.ecore.EObject> Set<T> getAllModelElementsByClass(Class<T> modelElementClass,
Boolean includeSubclasses)
getAllModelElementsByClass in interface ESObjectContainer<ESModelElementId>T - the type of the model element(s) to be retrievedmodelElementClass - the Class of the model element(s) to be retrievedincludeSubclasses - whether to also include all subclasses of the given Class in the list
ESObjectContainer.getAllModelElementsByClass(java.lang.Class,
java.lang.Boolean)public <T extends org.eclipse.emf.ecore.EObject> Set<T> getAllModelElementsByClass(Class<T> modelElementClass)
getAllModelElementsByClass in interface ESObjectContainer<ESModelElementId>T - the type of the model element(s) to be retrievedmodelElementClass - the Class of the model element(s) to be retrieved
ESObjectContainer.getAllModelElementsByClass(java.lang.Class)public boolean contains(ESModelElementId modelElementId)
EObject with the given ESModelElementId is contained in the collection.
contains in interface ESObjectContainer<ESModelElementId>modelElementId - the model element ID of the EObject, which needs to be checked,
whether it is contained in the collection
true, if the EObject with the given model element ID is
contained in the collection, falseESObjectContainer.contains(java.lang.Object)public boolean contains(org.eclipse.emf.ecore.EObject modelElement)
EObject is contained in the collection.
contains in interface ESObjectContainer<ESModelElementId>modelElement - the model element to be checked, whether it is contained in the
collection
true, if the model element is contained in the collection, false otherwiseESObjectContainer.contains(org.eclipse.emf.ecore.EObject)
public ESPrimaryVersionSpec commit(org.eclipse.core.runtime.IProgressMonitor monitor)
throws ESException
Commits any local changes.
NOTE: The commit will be executed in headless mode, so no callback can be specified. If clients would like
to influence the commit behavior, they should use ESLocalProject.commit(String, ESCommitCallback, IProgressMonitor).
This method throws a ESProjectNotSharedException runtime
exception if the project hasn't been shared yet
commit in interface ESLocalProjectmonitor - a progress monitor to track the progress of the commit
ESException - in case any error occurs during commitESLocalProject.commit(org.eclipse.core.runtime.IProgressMonitor)
public ESPrimaryVersionSpec commit(String logMessage,
ESCommitCallback callback,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ESUpdateRequiredException,
ESException
Commits any local changes.
NOTE: If no callback is specified the return value will be used to indicate whether the commit was successful or not. This enables the the headless execution of the commit.
This method throws a ESProjectNotSharedException runtime
exception if the project hasn't been shared yet
commit in interface ESLocalProjectlogMessage - a message describing the changes being committedcallback - an optional ESCommitCallbackmonitor - an IProgressMonitor instance that is used to track the progress of the commit
ESUpdateRequiredException - in case the local working copy is outdated and an update is required
ESException - in case any other error occurs during commitESLocalProject.commit(java.lang.String,
org.eclipse.emf.emfstore.client.callbacks.ESCommitCallback, org.eclipse.core.runtime.IProgressMonitor)
public ESPrimaryVersionSpec commitToBranch(ESBranchVersionSpec branch,
String logMessage,
ESCommitCallback callback,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws InvalidVersionSpecException,
ESUpdateRequiredException,
ESException
Commits any local changes to a branch.
NOTE: If no callback is specified the return value will be used to indicate whether the commit was successful or not. This enables the the headless execution of the commit.
This method throws a ESProjectNotSharedException runtime
exception if the project hasn't been shared yet
commitToBranch in interface ESLocalProjectbranch - the ESBranchVersionSpec indicating the branch to commit tologMessage - a message describing the changes being committedcallback - a optional ESCommitCallbackmonitor - an IProgressMonitor instance that is used to track the progress of the commit
InvalidVersionSpecException - in case the given ESBranchVersionSpec could not be resolved
ESUpdateRequiredException - in case the local working copy is outdated
ESException - in case any other error occurs during commitESLocalProject.commitToBranch(org.eclipse.emf.emfstore.server.model.versionspec.ESBranchVersionSpec,
java.lang.String, org.eclipse.emf.emfstore.client.callbacks.ESCommitCallback,
org.eclipse.core.runtime.IProgressMonitor)
public ESPrimaryVersionSpec update(org.eclipse.core.runtime.IProgressMonitor monitor)
throws ChangeConflictException,
ESException
Updates the project to the head version from the server.
This method throws a ESProjectNotSharedException runtime
exception if the project hasn't been shared yet
update in interface ESLocalProjectmonitor - a progress monitor to track progress
ChangeConflictException - in case a conflict is detected on update
ESException - in case update fails for any other reasonESLocalProject.update(org.eclipse.core.runtime.IProgressMonitor)
public ESPrimaryVersionSpec update(ESVersionSpec versionSpec,
ESUpdateCallback callback,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ChangeConflictException,
ESException
Updates the project to the given version from the server.
This method throws a ESProjectNotSharedException runtime
exception if the project hasn't been shared yet
update in interface ESLocalProjectversionSpec - the ESVersionSpec to update tocallback - the ESUpdateCallback that will be called while the update is performingmonitor - an IProgressMonitor instance that is used to track the progress of the update
ChangeConflictException - in case a conflict is detected on update
ESException - in case update fails for any other reasonESLocalProject.update(org.eclipse.emf.emfstore.server.model.versionspec.ESVersionSpec,
org.eclipse.emf.emfstore.client.callbacks.ESUpdateCallback, org.eclipse.core.runtime.IProgressMonitor)public void addToWorkspace(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
addToWorkspace in interface ESLocalProjectprogressMonitor - a IProgressMonitor to track the progress while
adding the project to the workspaceESLocalProject.addToWorkspace(org.eclipse.core.runtime.IProgressMonitor)
public void shareProject(org.eclipse.core.runtime.IProgressMonitor monitor)
throws ESException
Shares this project.
The ESUsersession used to share the project will be injected by the framework.
shareProject in interface ESLocalProjectmonitor - an IProgressMonitor instance that is used to indicate progress while sharing the project
ESException - in case an error occurs while sharing the projectESLocalProject.shareProject(org.eclipse.core.runtime.IProgressMonitor)
public ESRemoteProject shareProject(ESUsersession session,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ESException
shareProject in interface ESLocalProjectsession - the ESUsersession that should be used for sharing the projectmonitor - an IProgressMonitor instance that is used to indicate progress while sharing the project
ESException - in case an error occurs while sharing the projectESLocalProject.shareProject(org.eclipse.emf.emfstore.client.ESUsersession,
org.eclipse.core.runtime.IProgressMonitor)public boolean isShared()
isShared in interface ESLocalProjecttrue, if the project space has been shared, false otherwiseESLocalProject.isShared()public ESUsersessionImpl getUsersession()
ESUsersession associated with this project, if any.
getUsersession in interface ESLocalProjectnull, if no such session is availableESLocalProject.getUsersession()public ESPrimaryVersionSpec getBaseVersion()
getBaseVersion in interface ESLocalProjectESLocalProject.getBaseVersion()public Date getLastUpdated()
Date when the project was updated the last time.
getLastUpdated in interface ESLocalProjectESLocalProject.getLastUpdated()public List<String> getRecentLogMessages()
getRecentLogMessages in interface ESLocalProjectESLocalProject.getRecentLogMessages()public void undoLastOperation()
undoLastOperation in interface ESLocalProjectESLocalProject.undoLastOperation()public void undoLastOperations(int nrOperations)
undoLastOperations in interface ESLocalProjectnrOperations - the number of operations to be undoneESLocalProject.undoLastOperations(int)
public boolean isUpdated()
throws ESException
isUpdated in interface ESLocalProjecttrue, if the project is up to date, false otherwise
ESException - if the head revision can not be resolvedESLocalProject.isUpdated()public void revert()
revert in interface ESLocalProjectESLocalProject.revert()public void save()
save in interface ESLocalProjectESLocalProject.save()public boolean hasUnsavedChanges()
hasUnsavedChanges in interface ESLocalProjecttrue, if there are unsaved changes, false otherwiseESLocalProject.hasUnsavedChanges()public boolean hasUncommitedChanges()
hasUncommitedChanges in interface ESLocalProjecttrue, if there are any uncommitted changes, false otherwiseESLocalProject.hasUncommitedChanges()
public ESRemoteProjectImpl getRemoteProject()
throws ESException
ESRemoteProject on a server this local project is associated with.
getRemoteProject in interface ESLocalProjectESException - in case any error occurs while retrieving the remote projectESLocalProject.getRemoteProject()public ESLocalProjectId getLocalProjectId()
ESRemoteProject. It is intended to identify a local copy of a remote
project.
getLocalProjectId in interface ESLocalProjectESLocalProject.getLocalProjectId()
public List<ESHistoryInfo> getHistoryInfos(ESHistoryQuery<? extends ESHistoryQuery<?>> query,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ESException
Retrieves a part of the project's version history from the server based on the given query. Use
ESHistoryQueryFactory to generate query objects.
getHistoryInfos in interface ESProjectquery - the ESHistoryQuery to be performed in order to fetch the history informationmonitor - an IProgressMonitor instance that is used to indicate progress while fetching the history
information
ESException - in case an error occurs while retrieving the history informationESProject.getHistoryInfos(org.eclipse.emf.emfstore.server.model.query.ESHistoryQuery,
org.eclipse.core.runtime.IProgressMonitor)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||