org.eclipse.emf.emfstore.client
Interface ESLocalProject

All Superinterfaces:
ESObjectContainer<ESModelElementId>, ESProject
All Known Implementing Classes:
ESLocalProjectImpl

public interface ESLocalProject
extends ESProject, ESObjectContainer<ESModelElementId>

Represents a project in the local workspace that was checked out from a server or created locally.

Author:
emueller, wesendon, mkoegel

Method Summary
 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.
 ESPrimaryVersionSpec getBaseVersion()
          Returns the base version of the project.
 Date getLastUpdated()
          Returns the Date when the project was updated the last time.
 ESLocalProjectId getLocalProjectId()
          Returns a locally unique ID for the project.
 List<String> getRecentLogMessages()
          Returns a list with copies of the most recent log messages.
 ESRemoteProject getRemoteProject()
          Returns the ESRemoteProject on a server this local project is associated with.
 ESUsersession 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 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 operations)
          Undo the last operation n operations of the project.
 ESPrimaryVersionSpec update(ESVersionSpec version, 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 interface org.eclipse.emf.emfstore.client.ESProject
addTag, delete, getBranches, getGlobalProjectId, getHistoryInfos, getProjectName, removeTag, resolveVersionSpec
 
Methods inherited from interface org.eclipse.emf.emfstore.common.model.ESObjectContainer
contains, contains, getAllModelElements, getAllModelElementsByClass, getAllModelElementsByClass, getModelElement, getModelElementId, getModelElements
 

Method Detail

commit

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 commit(String, ESCommitCallback, IProgressMonitor).

This method throws a ESProjectNotSharedException runtime exception if the project hasn't been shared yet

Parameters:
monitor - a progress monitor to track the progress of the commit
Returns:
the new base version, if the commit was successful, otherwise the old base version
Throws:
ESException - in case any error occurs during commit

commit

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

Parameters:
logMessage - a message describing the changes being committed
callback - an optional ESCommitCallback
monitor - an IProgressMonitor instance that is used to track the progress of the commit
Returns:
the new base version, if the commit was successful, otherwise the old base version
Throws:
ESUpdateRequiredException - in case the local working copy is outdated and an update is required
ESException - in case any other error occurs during commit

commitToBranch

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

Parameters:
branch - the ESBranchVersionSpec indicating the branch to commit to
logMessage - a message describing the changes being committed
callback - a optional ESCommitCallback
monitor - an IProgressMonitor instance that is used to track the progress of the commit
Returns:
the new base version, if the commit was successful, otherwise the old base version
Throws:
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 commit

update

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

Parameters:
monitor - a progress monitor to track progress
Returns:
the new base version
Throws:
ChangeConflictException - in case a conflict is detected on update
ESException - in case update fails for any other reason

update

ESPrimaryVersionSpec update(ESVersionSpec version,
                            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

Parameters:
version - the ESVersionSpec to update to
callback - the ESUpdateCallback that will be called while the update is performing
monitor - an IProgressMonitor instance that is used to track the progress of the update
Returns:
the new base version
Throws:
ChangeConflictException - in case a conflict is detected on update
ESException - in case update fails for any other reason

addToWorkspace

void addToWorkspace(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
Adds this project to the workspace.

Parameters:
progressMonitor - a IProgressMonitor to track the progress while adding the project to the workspace

shareProject

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.

Parameters:
monitor - an IProgressMonitor instance that is used to indicate progress while sharing the project
Throws:
ESException - in case an error occurs while sharing the project

shareProject

ESRemoteProject shareProject(ESUsersession session,
                             org.eclipse.core.runtime.IProgressMonitor monitor)
                             throws ESException
Shares this project.

Parameters:
session - the ESUsersession that should be used for sharing the project
monitor - an IProgressMonitor instance that is used to indicate progress while sharing the project
Returns:
the corresponding remote project of a successful share
Throws:
ESException - in case an error occurs while sharing the project

isShared

boolean isShared()
Whether this project has been shared.

Returns:
true, if the project space has been shared, false otherwise

getUsersession

ESUsersession getUsersession()
Returns the ESUsersession associated with this project, if any.

Returns:
the user session associated with this project, or null, if no such session is available

getBaseVersion

ESPrimaryVersionSpec getBaseVersion()
Returns the base version of the project.

Returns:
the base version of the project

getLastUpdated

Date getLastUpdated()
Returns the Date when the project was updated the last time.

Returns:
the date of the last update

getRecentLogMessages

List<String> getRecentLogMessages()
Returns a list with copies of the most recent log messages.

Returns:
a list with copies of the most recent log messages

undoLastOperation

void undoLastOperation()
Undoes the last operation of the project.


undoLastOperations

void undoLastOperations(int operations)
Undo the last operation n operations of the project.

Parameters:
operations - the number of operations to be undone

isUpdated

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

Returns:
true, if the project is up to date, false otherwise
Throws:
ESException - if the head revision can not be resolved

revert

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


save

void save()
Saves the project space.


hasUnsavedChanges

boolean hasUnsavedChanges()
Determines whether the project has unsaved changes.

Returns:
true, if there are unsaved changes, false otherwise

hasUncommitedChanges

boolean hasUncommitedChanges()
Determines whether the project has uncommitted changes.

Returns:
true, if there are any uncommitted changes, false otherwise

getRemoteProject

ESRemoteProject getRemoteProject()
                                 throws ESException
Returns the ESRemoteProject on a server this local project is associated with.

Returns:
the remote project this project is associated with
Throws:
ESException - in case any error occurs while retrieving the remote project

getLocalProjectId

ESLocalProjectId getLocalProjectId()
Returns a locally unique ID for the project. It is only unique within the same workspace and it is not the same for different checkouts of the same ESRemoteProject. It is intended to identify a local copy of a remote project.

Returns:
the ID of the project


Copyright © 2015. All Rights Reserved.