org.eclipse.emf.emfstore.internal.server
Interface EMFStore

All Superinterfaces:
EMFStoreInterface
All Known Subinterfaces:
ConnectionManager
All Known Implementing Classes:
XmlRpcConnectionManager, XmlRpcEmfStoreImpl

public interface EMFStore
extends EMFStoreInterface

An EMF store is responsible for storing projects, change management on projects and for persisting projects.

Author:
Maximilian Koegel

Field Summary
static org.eclipse.emf.common.util.URI CHANGEPACKAGE_URI
          Virtual URI for change package de-/serialization.
static org.eclipse.emf.common.util.URI PROJECT_URI
          Virtual URI for project de-/serialization.
 
Method Summary
 void addTag(SessionId sessionId, ProjectId projectId, PrimaryVersionSpec versionSpec, TagVersionSpec tag)
          Adds a tag to a version of the specified project.
 ProjectInfo createEmptyProject(SessionId sessionId, String name, String description, LogMessage logMessage)
          Create a new project on the server.
 ProjectInfo createProject(SessionId sessionId, String name, String description, LogMessage logMessage, Project project)
          Create a new project on the server.
 PrimaryVersionSpec createVersion(SessionId sessionId, ProjectId projectId, PrimaryVersionSpec baseVersionSpec, ChangePackage changePackage, BranchVersionSpec targetBranch, PrimaryVersionSpec sourceVersion, LogMessage logMessage)
          Create a new version on the server of the given project.
 void deleteProject(SessionId sessionId, ProjectId projectId, boolean deleteFiles)
          Deletes a project on the server.
 FileChunk downloadFileChunk(SessionId sessionId, ProjectId projectId, FileTransferInformation fileInformation)
          Downloads a file chunk from the server.
 ProjectHistory exportProjectHistoryFromServer(SessionId sessionId, ProjectId projectId)
          Exports a given project history from the server.
 List<BranchInfo> getBranches(SessionId sessionId, ProjectId projectId)
          Lista all branches of the given project.
 List<ChangePackage> getChanges(SessionId sessionId, ProjectId projectId, VersionSpec source, VersionSpec target)
          Get changes from the server.
 List<EMFStoreProperty> getEMFProperties(SessionId sessionId, ProjectId projectId)
          Get stored EMFStoreProperties from the server.
 List<HistoryInfo> getHistoryInfo(SessionId sessionId, ProjectId projectId, HistoryQuery<?> historyQuery)
          Get history information from the server.
 Project getProject(SessionId sessionId, ProjectId projectId, VersionSpec versionSpec)
          Gets a project in a certain revision from the server.
 List<ProjectInfo> getProjectList(SessionId sessionId)
          Get a list of projects the user of the session id can access.
 String getVersion(SessionId sessionId)
          Returns the version of the EMFStore server.
 ProjectId importProjectHistoryToServer(SessionId sessionId, ProjectHistory projectHistory)
          Imports a project history to the server.
 void registerEPackage(SessionId sessionId, org.eclipse.emf.ecore.EPackage pkg)
          Register a new EPackage.
 void removeTag(SessionId sessionId, ProjectId projectId, PrimaryVersionSpec versionSpec, TagVersionSpec tag)
          Removes a tag to a version of the specified project.
 ACUser resolveUser(SessionId sessionId, ACOrgUnitId id)
          Resolves a user by id and returns an ACUser with all roles on the server.
 PrimaryVersionSpec resolveVersionSpec(SessionId sessionId, ProjectId projectId, VersionSpec versionSpec)
          Resolve a version specified to a primary version specifier.
 List<EMFStoreProperty> setEMFProperties(SessionId sessionId, List<EMFStoreProperty> property, ProjectId projectId)
          Store EMFProperties on the server.
 void transmitProperty(SessionId sessionId, OrgUnitProperty changedProperty, ACUser tmpUser, ProjectId projectId)
           
 FileTransferInformation uploadFileChunk(SessionId sessionId, ProjectId projectId, FileChunk fileChunk)
          Uploads a file chunk to the server.
 

Field Detail

CHANGEPACKAGE_URI

static final org.eclipse.emf.common.util.URI CHANGEPACKAGE_URI
Virtual URI for change package de-/serialization.


PROJECT_URI

static final org.eclipse.emf.common.util.URI PROJECT_URI
Virtual URI for project de-/serialization.

Method Detail

getProjectList

List<ProjectInfo> getProjectList(SessionId sessionId)
                                 throws ESException
Get a list of projects the user of the session id can access. The server should is determined by the session id.

Parameters:
sessionId - the session id for authentication
Returns:
a list of project infos for the projects the user can access
Throws:
ESException - if any error in the EmfStore occurs

getProject

Project getProject(SessionId sessionId,
                   ProjectId projectId,
                   VersionSpec versionSpec)
                   throws ESException
Gets a project in a certain revision from the server. Depending on your persistence properties, this method can become expensive because it has to recalculate the requested project state.

Parameters:
sessionId - the session id for authentication
projectId - the project id of the project to get
versionSpec - the version to get
Returns:
a project in the specified revision
Throws:
ESException - if any error in the EmfStore occurs
See Also:
ServerConfiguration.PROJECTSTATE_VERSION_PERSISTENCE

createVersion

PrimaryVersionSpec createVersion(SessionId sessionId,
                                 ProjectId projectId,
                                 PrimaryVersionSpec baseVersionSpec,
                                 ChangePackage changePackage,
                                 BranchVersionSpec targetBranch,
                                 PrimaryVersionSpec sourceVersion,
                                 LogMessage logMessage)
                                 throws ESException,
                                        InvalidVersionSpecException
Create a new version on the server of the given project.

Parameters:
sessionId - the session id for authentication
projectId - the project id
baseVersionSpec - the version the project was last synched with the server
changePackage - the changes performed on the project since last synch
targetBranch - this should be set if a new branch shout be created with this commit. Otherwise set null
sourceVersion - if a branch was merged and the resulting merged changed are committed this should be set to the incoming branch inorder to set correct links in the version model. Can be null otherwise
logMessage - the log message for the new version
Returns:
the version specifier of the version created on the server
Throws:
InvalidVersionSpecException - if the base version is not equal to the current head revision.
ESException - if any error in the EmfStore occurs

resolveVersionSpec

PrimaryVersionSpec resolveVersionSpec(SessionId sessionId,
                                      ProjectId projectId,
                                      VersionSpec versionSpec)
                                      throws ESException
Resolve a version specified to a primary version specifier.

Parameters:
sessionId - the session id for authentication
versionSpec - the version specifier to resolve
projectId - the project id
Returns:
a primary version specifier identifing the same version
Throws:
ESException - if any error in the EmfStore occurs

getChanges

List<ChangePackage> getChanges(SessionId sessionId,
                               ProjectId projectId,
                               VersionSpec source,
                               VersionSpec target)
                               throws ESException
Get changes from the server.

Parameters:
sessionId - the session id for authentication
projectId - the project id
source - the source version specifier
target - the target version specifier
Returns:
a list of change packages from source to target representing the changes that happened between the two versions.
Throws:
ESException - if any error in the EmfStore occurs

getBranches

List<BranchInfo> getBranches(SessionId sessionId,
                             ProjectId projectId)
                             throws ESException
Lista all branches of the given project.

Parameters:
sessionId - the session id for authentication
projectId - the project id
Returns:
list of BranchInfo
Throws:
ESException - in case of an error

getHistoryInfo

List<HistoryInfo> getHistoryInfo(SessionId sessionId,
                                 ProjectId projectId,
                                 HistoryQuery<?> historyQuery)
                                 throws ESException
Get history information from the server. The list returned will describe the versions as request through HistoryQuery.

Parameters:
sessionId - the session id
projectId - the project id
historyQuery - the historyQuery
Returns:
list of history information
Throws:
ESException - if any error in the EmfStore occurs

addTag

void addTag(SessionId sessionId,
            ProjectId projectId,
            PrimaryVersionSpec versionSpec,
            TagVersionSpec tag)
            throws ESException
Adds a tag to a version of the specified project.

Parameters:
sessionId - the session id
projectId - the project id
versionSpec - the version versionSpec
tag - the tag
Throws:
ESException - if any error in the EmfStore occurs

removeTag

void removeTag(SessionId sessionId,
               ProjectId projectId,
               PrimaryVersionSpec versionSpec,
               TagVersionSpec tag)
               throws ESException
Removes a tag to a version of the specified project.

Parameters:
sessionId - the session id
projectId - the project id
versionSpec - the version versionSpec
tag - the tag to be removed
Throws:
ESException - if any error in the EmfStore occurs

createEmptyProject

ProjectInfo createEmptyProject(SessionId sessionId,
                               String name,
                               String description,
                               LogMessage logMessage)
                               throws ESException
Create a new project on the server.

Parameters:
sessionId - the session id for authentication
name - the name of the server
description - the description
logMessage - the logMessage
Returns:
a ProjectInfo for the new project
Throws:
ESException - if any error in the EmfStore occurs

createProject

ProjectInfo createProject(SessionId sessionId,
                          String name,
                          String description,
                          LogMessage logMessage,
                          Project project)
                          throws ESException
Create a new project on the server. This createProject method allows to create a project on the server with initial projectstate (share project).

Parameters:
sessionId - the session id for authentication
name - the name of the server
description - the description
logMessage - the logMessage
project - the initial project state
Returns:
a ProjectInfo for the new project
Throws:
ESException - if any error in the EmfStore occurs

deleteProject

void deleteProject(SessionId sessionId,
                   ProjectId projectId,
                   boolean deleteFiles)
                   throws ESException
Deletes a project on the server. It's possible to delete the project from the containment tree and if wanted to deleted the related files too.

Parameters:
sessionId - the session id
projectId - the project id
deleteFiles - if true, the project files will be deleted too
Throws:
ESException - in case of failure

resolveUser

ACUser resolveUser(SessionId sessionId,
                   ACOrgUnitId id)
                   throws ESException
Resolves a user by id and returns an ACUser with all roles on the server. Also roles from groups are aggregated and added to the user. To resolve other user than the requesting user himself, the user has to have admin access rights. If id is null, the requesting user will be resolved.

Parameters:
sessionId - session id
id - user id, can be null, then requesting user gets resolved
Returns:
ACuser with all roles on the server
Throws:
ESException - if any error in the EmfStore occurs

importProjectHistoryToServer

ProjectId importProjectHistoryToServer(SessionId sessionId,
                                       ProjectHistory projectHistory)
                                       throws ESException
Imports a project history to the server. The project history elements such as version, projecstate etc will be devided in several files on the server file system. The server will try to use the specified project id, if it already exists a new id is generated.

Parameters:
sessionId - sessionid
projectHistory - project history
Returns:
projectId
Throws:
ESException - in case of failure

exportProjectHistoryFromServer

ProjectHistory exportProjectHistoryFromServer(SessionId sessionId,
                                              ProjectId projectId)
                                              throws ESException
Exports a given project history from the server. Caution if you try to export big projects from the server.

Parameters:
sessionId - session id
projectId - project id
Returns:
a projecthistory
Throws:
ESException - in case of failure

uploadFileChunk

FileTransferInformation uploadFileChunk(SessionId sessionId,
                                        ProjectId projectId,
                                        FileChunk fileChunk)
                                        throws ESException
Uploads a file chunk to the server.

Parameters:
sessionId - session id
projectId - project id
fileChunk - file chunk
Returns:
FileVersion denoting the current file version to be written to
Throws:
ESException - if any error occurs in the EmfStore

downloadFileChunk

FileChunk downloadFileChunk(SessionId sessionId,
                            ProjectId projectId,
                            FileTransferInformation fileInformation)
                            throws ESException
Downloads a file chunk from the server.

Parameters:
sessionId - session id
projectId - project id
fileInformation - file information
Returns:
FileChunk
Throws:
ESException - if any error occurs in the EmfStore

transmitProperty

void transmitProperty(SessionId sessionId,
                      OrgUnitProperty changedProperty,
                      ACUser tmpUser,
                      ProjectId projectId)
                      throws ESException
Parameters:
sessionId - session id
changedProperty - the property that has been changed client-side
tmpUser - the respective user
projectId - the project id
Throws:
ESException - if any error occurs in the EmfStore

setEMFProperties

List<EMFStoreProperty> setEMFProperties(SessionId sessionId,
                                        List<EMFStoreProperty> property,
                                        ProjectId projectId)
                                        throws ESException
Store EMFProperties on the server.

Parameters:
sessionId - sessionId
property - list properties which shall be shared on the server.
projectId - the project id
Returns:
a list of properties which have not been set on the server due there were more recent versions of these properties on the server
Throws:
ESException - if any error occurs in the EmfStore

getEMFProperties

List<EMFStoreProperty> getEMFProperties(SessionId sessionId,
                                        ProjectId projectId)
                                        throws ESException
Get stored EMFStoreProperties from the server.

Parameters:
sessionId - sessionId
projectId - the projct id
Returns:
list of EMFStoreProperties
Throws:
ESException - if any error occurs in the EmfStore

registerEPackage

void registerEPackage(SessionId sessionId,
                      org.eclipse.emf.ecore.EPackage pkg)
                      throws ESException
Register a new EPackage.

Parameters:
sessionId - session id
pkg - the EPackage to be registered
Throws:
ESException - if any error occurs in the EmfStore

getVersion

String getVersion(SessionId sessionId)
                  throws ESException
Returns the version of the EMFStore server.

Parameters:
sessionId - a session ID
Returns:
the version of the EMFStore server
Throws:
ESException - in case of an error


Copyright © 2015. All Rights Reserved.