org.eclipse.emf.emfstore.internal.client.model.impl.api
Class ESRemoteProjectImpl

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.model.impl.api.ESRemoteProjectImpl
All Implemented Interfaces:
ESProject, ESRemoteProject

public class ESRemoteProjectImpl
extends Object
implements ESRemoteProject

Represents a remote project that is located on a remote server.

Author:
wesendon, emueller

Constructor Summary
ESRemoteProjectImpl(ServerInfo serverInfo, ProjectInfo projectInfo)
          Constructor.
 
Method Summary
 void addTag(ESPrimaryVersionSpec primaryVersionSpec, ESTagVersionSpec tagVersionSpec, org.eclipse.core.runtime.IProgressMonitor monitor)
           Adds a tag to the specified version of this project on the server.
 ESLocalProjectImpl checkout(String name, ESUsersession session, ESPrimaryVersionSpec versionSpec, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
           Checkouts the project in the given version into the local workspace.
 ESLocalProjectImpl checkout(String name, ESUsersession usersession, org.eclipse.core.runtime.IProgressMonitor monitor)
           Checkouts the project in the HEAD version into the local workspace.
 ESLocalProjectImpl checkout(String name, org.eclipse.core.runtime.IProgressMonitor monitor)
           Checkouts the project in its HEAD version into the local workspace.
 void delete(ESUsersession session, org.eclipse.core.runtime.IProgressMonitor monitor)
          Deletes the remote project on the server.
 void delete(org.eclipse.core.runtime.IProgressMonitor monitor)
          Deletes the remote project on the server.
 ESLocalProjectImpl fetch(String name, ESUsersession session, ESPrimaryVersionSpec versionSpec, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
          
 List<ESBranchInfo> getBranches(ESUsersession usersession, org.eclipse.core.runtime.IProgressMonitor monitor)
          Returns all branches for the current 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.
 ESPrimaryVersionSpec getHeadVersion(org.eclipse.core.runtime.IProgressMonitor monitor)
          Returns the HEAD version 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.
 List<ESHistoryInfo> getHistoryInfos(ESUsersession session, 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.
 ProjectInfo getProjectInfo()
          Returns the project info of this remote project.
 String getProjectName()
          Returns the project's name.
 ESServerImpl getServer()
          Returns the project's server.
 ServerInfo getServerInfo()
          Returns the server info of this remote project.
 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(ESUsersession session, ESVersionSpec versionSpec, org.eclipse.core.runtime.IProgressMonitor monitor)
          Resolves a ESVersionSpec to a ESPrimaryVersionSpec by querying the server.
 ESPrimaryVersionSpec resolveVersionSpec(ESVersionSpec versionSpec, org.eclipse.core.runtime.IProgressMonitor monitor)
          Resolves a ESVersionSpec to a ESPrimaryVersionSpec by querying the server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ESRemoteProjectImpl

public ESRemoteProjectImpl(ServerInfo serverInfo,
                           ProjectInfo projectInfo)
Constructor.

Parameters:
serverInfo - the server the remote project is located on
projectInfo - information about which project to access
Method Detail

getGlobalProjectId

public ESGlobalProjectId getGlobalProjectId()
Returns the global ID of the project. This ID is globally unique even among different server and client nodes.

Specified by:
getGlobalProjectId in interface ESProject
Returns:
the global ID of the project
See Also:
ESProject.getGlobalProjectId()

getProjectName

public String getProjectName()
Returns the project's name.

Specified by:
getProjectName in interface ESProject
Returns:
the name of the project
See Also:
ESProject.getProjectName()

getBranches

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.

Specified by:
getBranches in interface ESProject
Parameters:
monitor - an IProgressMonitor instance that is used to indicate progress while fetching the branch information
Returns:
a list containing information about all branches for the current project
Throws:
ESException - in case an error occurs while retrieving the branch information for the project
See Also:
ESProject.getBranches(org.eclipse.core.runtime.IProgressMonitor)

getBranches

public List<ESBranchInfo> getBranches(ESUsersession usersession,
                                      org.eclipse.core.runtime.IProgressMonitor monitor)
                               throws ESException
Returns all branches for the current project.

Specified by:
getBranches in interface ESRemoteProject
Parameters:
usersession - the user session used to fetch the branch information
monitor - an IProgressMonitor instance that is used to indicate progress while fetching the branch information
Returns:
a list containing information about all branches for the current project
Throws:
ESException - in case an error occurs while retrieving the branch information for the project
See Also:
ESRemoteProject.getBranches(org.eclipse.emf.emfstore.client.ESUsersession, org.eclipse.core.runtime.IProgressMonitor)

resolveVersionSpec

public ESPrimaryVersionSpec resolveVersionSpec(ESVersionSpec versionSpec,
                                               org.eclipse.core.runtime.IProgressMonitor monitor)
                                        throws ESException
Resolves a 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.

Specified by:
resolveVersionSpec in interface ESProject
Parameters:
versionSpec - the ESVersionSpec to resolve
monitor - an IProgressMonitor instance that is used to indicate progress while resolving the version
Returns:
the resolved ESPrimaryVersionSpec
Throws:
ESException - in case an error occurs while resolving the given ESVersionSpec
See Also:
ESProject.resolveVersionSpec(org.eclipse.emf.emfstore.server.model.versionspec.ESVersionSpec, org.eclipse.core.runtime.IProgressMonitor)

resolveVersionSpec

public ESPrimaryVersionSpec resolveVersionSpec(ESUsersession session,
                                               ESVersionSpec versionSpec,
                                               org.eclipse.core.runtime.IProgressMonitor monitor)
                                        throws ESException
Resolves a ESVersionSpec to a ESPrimaryVersionSpec by querying the server.

Specified by:
resolveVersionSpec in interface ESRemoteProject
Parameters:
session - the user session that will be used by the ESServerCall to resolve the given ESVersionSpec
versionSpec - the version specifier to resolve
monitor - an IProgressMonitor instance that is used to indicate progress while resolving the version specifier
Returns:
the resolved primary version
Throws:
ESException - in case an error occurs while resolving the version
See Also:
ESRemoteProject.resolveVersionSpec(org.eclipse.emf.emfstore.client.ESUsersession, org.eclipse.emf.emfstore.server.model.versionspec.ESVersionSpec, org.eclipse.core.runtime.IProgressMonitor)

getHistoryInfos

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.

Specified by:
getHistoryInfos in interface ESProject
Parameters:
query - the ESHistoryQuery to be performed in order to fetch the history information
monitor - an IProgressMonitor instance that is used to indicate progress while fetching the history information
Returns:
a list containing the history information for the given query
Throws:
ESException - in case an error occurs while retrieving the history information
See Also:
ESProject.getHistoryInfos(org.eclipse.emf.emfstore.server.model.query.ESHistoryQuery, org.eclipse.core.runtime.IProgressMonitor)

getHistoryInfos

public List<ESHistoryInfo> getHistoryInfos(ESUsersession session,
                                           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.

Specified by:
getHistoryInfos in interface ESRemoteProject
Parameters:
session - the user session that will be used by the ESServerCall to fetch the history information
query - the query to be performed in order to fetch the history information
monitor - an IProgressMonitor instance that is used to indicate progress while fetching the history information
Returns:
a list of history infos
Throws:
ESException - in case an error occurs while retrieving the history information
See Also:
ESRemoteProject.getHistoryInfos(org.eclipse.emf.emfstore.client.ESUsersession, org.eclipse.emf.emfstore.server.model.query.ESHistoryQuery, org.eclipse.core.runtime.IProgressMonitor)

addTag

public void addTag(ESPrimaryVersionSpec primaryVersionSpec,
                   ESTagVersionSpec tagVersionSpec,
                   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.

Specified by:
addTag in interface ESProject
Parameters:
primaryVersionSpec - the ESPrimaryVersionSpec that should be tagged
tagVersionSpec - the tag being created
monitor - an IProgressMonitor instance that is used to indicate progress while adding the tag
Throws:
ESException - in case the given tag could not be removed
See Also:
ESProject.addTag(org.eclipse.emf.emfstore.server.model.versionspec.ESPrimaryVersionSpec, org.eclipse.emf.emfstore.server.model.versionspec.ESTagVersionSpec, org.eclipse.core.runtime.IProgressMonitor)

removeTag

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.

Specified by:
removeTag in interface ESProject
Parameters:
versionSpec - the ESPrimaryVersionSpec identifying the version from which the tag should be removed
tag - the ESTagVersionSpec to be removed
monitor - an IProgressMonitor instance that is used to indicate progress while removing the tag
Throws:
ESException - in case the given tag could not be removed
See Also:
ESProject.removeTag(org.eclipse.emf.emfstore.server.model.versionspec.ESPrimaryVersionSpec, org.eclipse.emf.emfstore.server.model.versionspec.ESTagVersionSpec, org.eclipse.core.runtime.IProgressMonitor)

checkout

public ESLocalProjectImpl checkout(String name,
                                   org.eclipse.core.runtime.IProgressMonitor monitor)
                            throws ESException

Checkouts the project in its HEAD version into the local workspace.

The ESUsersession used for checking out the project will be injected.

Specified by:
checkout in interface ESRemoteProject
Parameters:
name - the name of the copy being created during the checkout
monitor - the progress monitor that is used during checkout in order to indicate progress
Returns:
the checked out project
Throws:
ESException - in case an error occurs during checkout
See Also:
ESRemoteProject.checkout(java.lang.String, org.eclipse.core.runtime.IProgressMonitor)

checkout

public ESLocalProjectImpl checkout(String name,
                                   ESUsersession usersession,
                                   org.eclipse.core.runtime.IProgressMonitor monitor)
                            throws ESException

Checkouts the project in the HEAD version into the local workspace.

The caller must provide the ESUsersession used for checking out the project, e.g. by specifying the session that was lastly used in an ESServer.

The caller also must specify which specific ESVersionSpec to checkout. If the HEAD version should get checked out, the ESVersionFactory must be used, which can be fetched via ESVersionSpec.FACTORY.

Specified by:
checkout in interface ESRemoteProject
Parameters:
name - the name of the copy being created during the checkout
usersession - the user session that will be used by the ESServerCall to checkout the project
monitor - the IProgressMonitor that is used during checkout in order to indicate progress
Returns:
the checked out project
Throws:
ESException - in case an error occurs during checkout
See Also:
ESRemoteProject.checkout(java.lang.String, org.eclipse.emf.emfstore.client.ESUsersession, org.eclipse.core.runtime.IProgressMonitor)

fetch

public ESLocalProjectImpl fetch(String name,
                                ESUsersession session,
                                ESPrimaryVersionSpec versionSpec,
                                org.eclipse.core.runtime.IProgressMonitor progressMonitor)
                         throws ESException

Specified by:
fetch in interface ESRemoteProject
Parameters:
name - the name of the copy being created during the fetch
session - the user session that will be used by the ESServerCall to fetch the project
versionSpec - the version that should be fetched.
progressMonitor - the IProgressMonitor that is used during checkout in order to indicate progress
Returns:
the fetched project
Throws:
ESException - in case an error occurs during fetch
See Also:
ESRemoteProject.fetch(java.lang.String, org.eclipse.emf.emfstore.client.ESUsersession, org.eclipse.emf.emfstore.server.model.versionspec.ESPrimaryVersionSpec, org.eclipse.core.runtime.IProgressMonitor)

checkout

public ESLocalProjectImpl checkout(String name,
                                   ESUsersession session,
                                   ESPrimaryVersionSpec versionSpec,
                                   org.eclipse.core.runtime.IProgressMonitor progressMonitor)
                            throws ESException

Checkouts the project in the given version into the local workspace.

The caller must provide the ESUsersession used for checking out the project, e.g. by specifying the session that was lastly used in an ESServer.

The caller also must specify which specific ESVersionSpec to checkout. If the HEAD version should get checked out, the ESVersionFactory must be used, which can be fetched via ESVersionSpec.FACTORY.

Specified by:
checkout in interface ESRemoteProject
Parameters:
name - the name of the copy being created during the checkout
session - the user session that will be used by the ESServerCall to checkout the project
versionSpec - the version that should be checked out.
progressMonitor - the IProgressMonitor that is used during checkout in order to indicate progress
Returns:
the checked out project
Throws:
ESException - in case an error occurs during checkout
See Also:
ESRemoteProject.checkout(java.lang.String, org.eclipse.emf.emfstore.client.ESUsersession, org.eclipse.emf.emfstore.server.model.versionspec.ESPrimaryVersionSpec, org.eclipse.core.runtime.IProgressMonitor)

delete

public void delete(org.eclipse.core.runtime.IProgressMonitor monitor)
            throws ESException
Deletes the remote project on the server.

Specified by:
delete in interface ESProject
Specified by:
delete in interface ESRemoteProject
Parameters:
monitor - an IProgressMonitor used to indicate progress
Throws:
ESException - in case an error occurs during the deletion of the project
See Also:
ESRemoteProject.delete(org.eclipse.core.runtime.IProgressMonitor)

delete

public void delete(ESUsersession session,
                   org.eclipse.core.runtime.IProgressMonitor monitor)
            throws ESException
Deletes the remote project on the server.

Specified by:
delete in interface ESRemoteProject
Parameters:
session - the user session that will be used by the ESServerCall to delete the remote project
monitor - an IProgressMonitor used to indicate progress
Throws:
ESException - in case an error occurs during the deletion of the project
See Also:
ESRemoteProject.delete(org.eclipse.emf.emfstore.client.ESUsersession, org.eclipse.core.runtime.IProgressMonitor)

getServer

public ESServerImpl getServer()
Returns the project's server.

Specified by:
getServer in interface ESRemoteProject
Returns:
server
See Also:
ESRemoteProject.getServer()

getHeadVersion

public ESPrimaryVersionSpec getHeadVersion(org.eclipse.core.runtime.IProgressMonitor monitor)
                                    throws ESException
Returns the HEAD version of the project.

Specified by:
getHeadVersion in interface ESRemoteProject
Parameters:
monitor - an IProgressMonitor used to indicate progress
Returns:
the HEAD version
Throws:
ESException - in case an error occurs while fetching the HEAD version of the project
See Also:
ESRemoteProject.getHeadVersion(org.eclipse.core.runtime.IProgressMonitor)

getProjectInfo

public ProjectInfo getProjectInfo()
Returns the project info of this remote project.

Returns:
the project info of this remote project

getServerInfo

public ServerInfo getServerInfo()
Returns the server info of this remote project.

Returns:
the server info of this remote project


Copyright © 2015. All Rights Reserved.