org.eclipse.emf.emfstore.internal.server.core.subinterfaces
Class VersionSubInterfaceImpl

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.server.core.AbstractSubEmfstoreInterface
      extended by org.eclipse.emf.emfstore.internal.server.core.subinterfaces.VersionSubInterfaceImpl

public class VersionSubInterfaceImpl
extends AbstractSubEmfstoreInterface

This subinterface implements all version related functionality.

Author:
wesendon

Constructor Summary
VersionSubInterfaceImpl(AbstractEmfstoreInterface parentInterface)
          Default constructor.
 
Method Summary
 PrimaryVersionSpec createVersion(SessionId sessionId, ProjectId projectId, PrimaryVersionSpec baseVersionSpec, ChangePackage changePackage, BranchVersionSpec targetBranch, PrimaryVersionSpec sourceVersion, LogMessage logMessage)
          Create a new version.
static Version findNextVersion(Version currentVersion)
          Helper method which retrieves the next version in the history tree.
 List<BranchInfo> getBranches(ProjectId projectId)
          Returns all branches for the project with the given ID.
 List<ChangePackage> getChanges(ProjectId projectId, VersionSpec source, VersionSpec target)
          Returns all changes within the specified version range for a given project.
 PrimaryVersionSpec resolveVersionSpec(ProjectId projectId, VersionSpec versionSpec)
          Resolves a versionSpec and delivers the corresponding primary versionSpec.
 
Methods inherited from class org.eclipse.emf.emfstore.internal.server.core.AbstractSubEmfstoreInterface
execute, getResourceHelper
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionSubInterfaceImpl

public VersionSubInterfaceImpl(AbstractEmfstoreInterface parentInterface)
                        throws FatalESException
Default constructor.

Parameters:
parentInterface - parent interface
Throws:
FatalESException - in case of failure
Method Detail

resolveVersionSpec

public PrimaryVersionSpec resolveVersionSpec(ProjectId projectId,
                                             VersionSpec versionSpec)
                                      throws InvalidVersionSpecException,
                                             ESException
Resolves a versionSpec and delivers the corresponding primary versionSpec.

Parameters:
projectId - project id
versionSpec - versionSpec
Returns:
primary versionSpec
Throws:
InvalidVersionSpecException - if the project ID is invalid
ESException - if versionSpec can't be resolved or other failure

createVersion

public PrimaryVersionSpec createVersion(SessionId sessionId,
                                        ProjectId projectId,
                                        PrimaryVersionSpec baseVersionSpec,
                                        ChangePackage changePackage,
                                        BranchVersionSpec targetBranch,
                                        PrimaryVersionSpec sourceVersion,
                                        LogMessage logMessage)
                                 throws ESException
Create a new version.

Parameters:
sessionId - the ID of the session being used to create a new version
projectId - the ID of the project for which a new version is created
baseVersionSpec - the base version
changePackage - the change package containing all changes that make up the new version
targetBranch - the target branch for which to create the new version
sourceVersion - the source version
logMessage - a log message
Returns:
the new version
Throws:
ESException - in case of failure

getBranches

public List<BranchInfo> getBranches(ProjectId projectId)
                             throws ESException
Returns all branches for the project with the given ID.

Parameters:
projectId - the ID of a project
Returns:
a list containing information about each branch
Throws:
ESException - in case of failure

getChanges

public List<ChangePackage> getChanges(ProjectId projectId,
                                      VersionSpec source,
                                      VersionSpec target)
                               throws InvalidVersionSpecException,
                                      ESException
Returns all changes within the specified version range for a given project.

Parameters:
projectId - the ID of a project
source - the source version
target - the target version (inclusive)
Returns:
a list of change packages containing all the changes for the specified version range
Throws:
InvalidVersionSpecException - if an invalid version has been specified
ESException - in case of failure

findNextVersion

public static Version findNextVersion(Version currentVersion)
                               throws InvalidVersionSpecException
Helper method which retrieves the next version in the history tree. This method must be used in reversed order. With the introduction of branches, the versions are organized in a tree structure. Therefore, next versions are always searched for walking up the tree.

Parameters:
currentVersion - current version
Returns:
version
Throws:
InvalidVersionSpecException - if the path can't be followed further


Copyright © 2015. All Rights Reserved.