fixed Bug 357120 - LogMessage->author should be set on server
diff --git a/org.eclipse.emf.emfstore.client/src/org/eclipse/emf/emfstore/client/model/impl/ProjectSpaceImpl.java b/org.eclipse.emf.emfstore.client/src/org/eclipse/emf/emfstore/client/model/impl/ProjectSpaceImpl.java
index 43b4378..8c18f7f 100644
--- a/org.eclipse.emf.emfstore.client/src/org/eclipse/emf/emfstore/client/model/impl/ProjectSpaceImpl.java
+++ b/org.eclipse.emf.emfstore.client/src/org/eclipse/emf/emfstore/client/model/impl/ProjectSpaceImpl.java
@@ -107,7 +107,8 @@
import org.eclipse.emf.emfstore.server.model.versioning.operations.semantic.SemanticCompositeOperation;
/**
- * <!-- begin-user-doc --> An implementation of the model object ' <em><b>Project Container</b></em>'.
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Project Container</b></em>'.
*
* @implements LoginObserver <!-- end-user-doc -->
* <p>
@@ -172,7 +173,8 @@
*
* @generated
*/
-public class ProjectSpaceImpl extends IdentifiableElementImpl implements ProjectSpace, LoginObserver {
+public class ProjectSpaceImpl extends IdentifiableElementImpl implements
+ ProjectSpace, LoginObserver {
/**
* The cached value of the '{@link #getProject() <em>Project</em>}'
@@ -195,8 +197,8 @@
protected ProjectId projectId;
/**
- * The default value of the '{@link #getProjectName() <em>Project Name</em>} ' attribute. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * The default value of the '{@link #getProjectName() <em>Project Name</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getProjectName()
* @generated
@@ -257,8 +259,8 @@
protected Usersession usersession;
/**
- * The default value of the '{@link #getLastUpdated() <em>Last Updated</em>} ' attribute. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * The default value of the '{@link #getLastUpdated() <em>Last Updated</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getLastUpdated()
* @generated
@@ -481,17 +483,20 @@
project = (Project) eResolveProxy(oldProject);
if (project != oldProject) {
InternalEObject newProject = (InternalEObject) project;
- NotificationChain msgs = oldProject.eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__PROJECT, null, null);
+ NotificationChain msgs = oldProject.eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__PROJECT, null,
+ null);
if (newProject.eInternalContainer() == null) {
- msgs = newProject.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ModelPackage.PROJECT_SPACE__PROJECT,
- null, msgs);
+ msgs = newProject.eInverseAdd(this, EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__PROJECT, null, msgs);
}
if (msgs != null)
msgs.dispatch();
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, ModelPackage.PROJECT_SPACE__PROJECT,
- oldProject, project));
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+ ModelPackage.PROJECT_SPACE__PROJECT, oldProject,
+ project));
}
}
return project;
@@ -511,12 +516,14 @@
*
* @generated
*/
- public NotificationChain basicSetProject(Project newProject, NotificationChain msgs) {
+ public NotificationChain basicSetProject(Project newProject,
+ NotificationChain msgs) {
Project oldProject = project;
project = newProject;
if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
- ModelPackage.PROJECT_SPACE__PROJECT, oldProject, newProject);
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, ModelPackage.PROJECT_SPACE__PROJECT,
+ oldProject, newProject);
if (msgs == null)
msgs = notification;
else
@@ -534,17 +541,21 @@
if (newProject != project) {
NotificationChain msgs = null;
if (project != null)
- msgs = ((InternalEObject) project).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__PROJECT, null, msgs);
+ msgs = ((InternalEObject) project).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__PROJECT, null,
+ msgs);
if (newProject != null)
- msgs = ((InternalEObject) newProject).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__PROJECT, null, msgs);
+ msgs = ((InternalEObject) newProject).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__PROJECT, null,
+ msgs);
msgs = basicSetProject(newProject, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__PROJECT, newProject,
- newProject));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__PROJECT, newProject, newProject));
}
/**
@@ -558,17 +569,22 @@
projectId = (ProjectId) eResolveProxy(oldProjectId);
if (projectId != oldProjectId) {
InternalEObject newProjectId = (InternalEObject) projectId;
- NotificationChain msgs = oldProjectId.eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__PROJECT_ID, null, null);
+ NotificationChain msgs = oldProjectId.eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__PROJECT_ID, null,
+ null);
if (newProjectId.eInternalContainer() == null) {
- msgs = newProjectId.eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__PROJECT_ID, null, msgs);
+ msgs = newProjectId.eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__PROJECT_ID,
+ null, msgs);
}
if (msgs != null)
msgs.dispatch();
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, ModelPackage.PROJECT_SPACE__PROJECT_ID,
- oldProjectId, projectId));
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+ ModelPackage.PROJECT_SPACE__PROJECT_ID,
+ oldProjectId, projectId));
}
}
return projectId;
@@ -588,12 +604,14 @@
*
* @generated
*/
- public NotificationChain basicSetProjectId(ProjectId newProjectId, NotificationChain msgs) {
+ public NotificationChain basicSetProjectId(ProjectId newProjectId,
+ NotificationChain msgs) {
ProjectId oldProjectId = projectId;
projectId = newProjectId;
if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
- ModelPackage.PROJECT_SPACE__PROJECT_ID, oldProjectId, newProjectId);
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, ModelPackage.PROJECT_SPACE__PROJECT_ID,
+ oldProjectId, newProjectId);
if (msgs == null)
msgs = notification;
else
@@ -611,17 +629,22 @@
if (newProjectId != projectId) {
NotificationChain msgs = null;
if (projectId != null)
- msgs = ((InternalEObject) projectId).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__PROJECT_ID, null, msgs);
+ msgs = ((InternalEObject) projectId).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__PROJECT_ID, null,
+ msgs);
if (newProjectId != null)
- msgs = ((InternalEObject) newProjectId).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__PROJECT_ID, null, msgs);
+ msgs = ((InternalEObject) newProjectId).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__PROJECT_ID, null,
+ msgs);
msgs = basicSetProjectId(newProjectId, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__PROJECT_ID, newProjectId,
- newProjectId));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__PROJECT_ID, newProjectId,
+ newProjectId));
}
/**
@@ -642,8 +665,9 @@
String oldProjectName = projectName;
projectName = newProjectName;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__PROJECT_NAME,
- oldProjectName, projectName));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__PROJECT_NAME, oldProjectName,
+ projectName));
}
/**
@@ -664,8 +688,9 @@
String oldProjectDescription = projectDescription;
projectDescription = newProjectDescription;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__PROJECT_DESCRIPTION,
- oldProjectDescription, projectDescription));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__PROJECT_DESCRIPTION,
+ oldProjectDescription, projectDescription));
}
/**
@@ -676,7 +701,8 @@
@Deprecated
public EList<Event> getEvents() {
if (events == null) {
- events = new EObjectContainmentEList.Resolving<Event>(Event.class, this, ModelPackage.PROJECT_SPACE__EVENTS);
+ events = new EObjectContainmentEList.Resolving<Event>(Event.class,
+ this, ModelPackage.PROJECT_SPACE__EVENTS);
}
return events;
}
@@ -701,9 +727,12 @@
eventComposite = ModelFactory.eINSTANCE.createEventComposite();
// migration code: existing events in the event feature are added to
// the composite
- eventList = new AutoSplitAndSaveResourceContainmentList<Event>(eventComposite, eventComposite.getEvents(),
- this.eResource().getResourceSet(), Configuration.getWorkspaceDirectory() + "ps-" + getIdentifier()
- + File.separatorChar + "events", ".eff");
+ eventList = new AutoSplitAndSaveResourceContainmentList<Event>(
+ eventComposite, eventComposite.getEvents(), this
+ .eResource().getResourceSet(),
+ Configuration.getWorkspaceDirectory() + "ps-"
+ + getIdentifier() + File.separatorChar + "events",
+ ".eff");
this.setEventComposite(eventComposite);
if (getEvents().size() > 0) {
eventList.addAll(getEvents());
@@ -711,9 +740,12 @@
}
}
if (eventList == null) {
- eventList = new AutoSplitAndSaveResourceContainmentList<Event>(eventComposite, eventComposite.getEvents(),
- this.eResource().getResourceSet(), Configuration.getWorkspaceDirectory() + "ps-" + getIdentifier()
- + File.separatorChar + "events", ".eff");
+ eventList = new AutoSplitAndSaveResourceContainmentList<Event>(
+ eventComposite, eventComposite.getEvents(), this
+ .eResource().getResourceSet(),
+ Configuration.getWorkspaceDirectory() + "ps-"
+ + getIdentifier() + File.separatorChar + "events",
+ ".eff");
}
return eventList;
}
@@ -731,8 +763,9 @@
usersession = (Usersession) eResolveProxy(oldUsersession);
if (usersession != oldUsersession) {
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, ModelPackage.PROJECT_SPACE__USERSESSION,
- oldUsersession, usersession));
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+ ModelPackage.PROJECT_SPACE__USERSESSION,
+ oldUsersession, usersession));
}
}
return usersession;
@@ -756,8 +789,9 @@
Usersession oldUsersession = usersession;
usersession = newUsersession;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__USERSESSION,
- oldUsersession, usersession));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__USERSESSION, oldUsersession,
+ usersession));
}
/**
@@ -778,8 +812,9 @@
Date oldLastUpdated = lastUpdated;
lastUpdated = newLastUpdated;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__LAST_UPDATED,
- oldLastUpdated, lastUpdated));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__LAST_UPDATED, oldLastUpdated,
+ lastUpdated));
}
/**
@@ -793,17 +828,22 @@
baseVersion = (PrimaryVersionSpec) eResolveProxy(oldBaseVersion);
if (baseVersion != oldBaseVersion) {
InternalEObject newBaseVersion = (InternalEObject) baseVersion;
- NotificationChain msgs = oldBaseVersion.eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__BASE_VERSION, null, null);
+ NotificationChain msgs = oldBaseVersion.eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__BASE_VERSION,
+ null, null);
if (newBaseVersion.eInternalContainer() == null) {
- msgs = newBaseVersion.eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__BASE_VERSION, null, msgs);
+ msgs = newBaseVersion.eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__BASE_VERSION,
+ null, msgs);
}
if (msgs != null)
msgs.dispatch();
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, ModelPackage.PROJECT_SPACE__BASE_VERSION,
- oldBaseVersion, baseVersion));
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+ ModelPackage.PROJECT_SPACE__BASE_VERSION,
+ oldBaseVersion, baseVersion));
}
}
return baseVersion;
@@ -823,12 +863,14 @@
*
* @generated
*/
- public NotificationChain basicSetBaseVersion(PrimaryVersionSpec newBaseVersion, NotificationChain msgs) {
+ public NotificationChain basicSetBaseVersion(
+ PrimaryVersionSpec newBaseVersion, NotificationChain msgs) {
PrimaryVersionSpec oldBaseVersion = baseVersion;
baseVersion = newBaseVersion;
if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
- ModelPackage.PROJECT_SPACE__BASE_VERSION, oldBaseVersion, newBaseVersion);
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, ModelPackage.PROJECT_SPACE__BASE_VERSION,
+ oldBaseVersion, newBaseVersion);
if (msgs == null)
msgs = notification;
else
@@ -846,17 +888,22 @@
if (newBaseVersion != baseVersion) {
NotificationChain msgs = null;
if (baseVersion != null)
- msgs = ((InternalEObject) baseVersion).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__BASE_VERSION, null, msgs);
+ msgs = ((InternalEObject) baseVersion).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__BASE_VERSION,
+ null, msgs);
if (newBaseVersion != null)
- msgs = ((InternalEObject) newBaseVersion).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__BASE_VERSION, null, msgs);
+ msgs = ((InternalEObject) newBaseVersion).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__BASE_VERSION,
+ null, msgs);
msgs = basicSetBaseVersion(newBaseVersion, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__BASE_VERSION,
- newBaseVersion, newBaseVersion));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__BASE_VERSION, newBaseVersion,
+ newBaseVersion));
}
/**
@@ -877,8 +924,9 @@
int oldResourceCount = resourceCount;
resourceCount = newResourceCount;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__RESOURCE_COUNT,
- oldResourceCount, resourceCount));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__RESOURCE_COUNT,
+ oldResourceCount, resourceCount));
}
/**
@@ -910,7 +958,8 @@
boolean oldDirty = dirty;
dirty = newDirty;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__DIRTY, oldDirty, dirty));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__DIRTY, oldDirty, dirty));
}
/**
@@ -920,8 +969,8 @@
*/
public EList<String> getOldLogMessages() {
if (oldLogMessages == null) {
- oldLogMessages = new EDataTypeUniqueEList<String>(String.class, this,
- ModelPackage.PROJECT_SPACE__OLD_LOG_MESSAGES);
+ oldLogMessages = new EDataTypeUniqueEList<String>(String.class,
+ this, ModelPackage.PROJECT_SPACE__OLD_LOG_MESSAGES);
}
return oldLogMessages;
}
@@ -937,17 +986,24 @@
localOperations = (OperationComposite) eResolveProxy(oldLocalOperations);
if (localOperations != oldLocalOperations) {
InternalEObject newLocalOperations = (InternalEObject) localOperations;
- NotificationChain msgs = oldLocalOperations.eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS, null, null);
+ NotificationChain msgs = oldLocalOperations.eInverseRemove(
+ this, EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS,
+ null, null);
if (newLocalOperations.eInternalContainer() == null) {
- msgs = newLocalOperations.eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS, null, msgs);
+ msgs = newLocalOperations
+ .eInverseAdd(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS,
+ null, msgs);
}
if (msgs != null)
msgs.dispatch();
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
- ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS, oldLocalOperations, localOperations));
+ ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS,
+ oldLocalOperations, localOperations));
}
}
return localOperations;
@@ -967,12 +1023,15 @@
*
* @generated
*/
- public NotificationChain basicSetLocalOperations(OperationComposite newLocalOperations, NotificationChain msgs) {
+ public NotificationChain basicSetLocalOperations(
+ OperationComposite newLocalOperations, NotificationChain msgs) {
OperationComposite oldLocalOperations = localOperations;
localOperations = newLocalOperations;
if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
- ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS, oldLocalOperations, newLocalOperations);
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET,
+ ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS,
+ oldLocalOperations, newLocalOperations);
if (msgs == null)
msgs = notification;
else
@@ -990,17 +1049,22 @@
if (newLocalOperations != localOperations) {
NotificationChain msgs = null;
if (localOperations != null)
- msgs = ((InternalEObject) localOperations).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS, null, msgs);
+ msgs = ((InternalEObject) localOperations).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS,
+ null, msgs);
if (newLocalOperations != null)
- msgs = ((InternalEObject) newLocalOperations).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS, null, msgs);
+ msgs = ((InternalEObject) newLocalOperations).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS,
+ null, msgs);
msgs = basicSetLocalOperations(newLocalOperations, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS,
- newLocalOperations, newLocalOperations));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS,
+ newLocalOperations, newLocalOperations));
}
/**
@@ -1011,8 +1075,9 @@
@Deprecated
public EList<ESNotification> getNotifications() {
if (notifications == null) {
- notifications = new EObjectContainmentEList.Resolving<ESNotification>(ESNotification.class, this,
- ModelPackage.PROJECT_SPACE__NOTIFICATIONS);
+ notifications = new EObjectContainmentEList.Resolving<ESNotification>(
+ ESNotification.class, this,
+ ModelPackage.PROJECT_SPACE__NOTIFICATIONS);
}
return notifications;
}
@@ -1024,22 +1089,28 @@
*/
public List<ESNotification> getNotificationsFromComposite() {
// check if operation composite exists
- NotificationComposite notificationComposite = this.getNotificationComposite();
+ NotificationComposite notificationComposite = this
+ .getNotificationComposite();
if (isTransient) {
if (notificationComposite == null) {
- notificationComposite = ModelFactory.eINSTANCE.createNotificationComposite();
+ notificationComposite = ModelFactory.eINSTANCE
+ .createNotificationComposite();
this.setNotificationComposite(notificationComposite);
}
return notificationComposite.getNotifications();
}
if (notificationComposite == null) {
- notificationComposite = ModelFactory.eINSTANCE.createNotificationComposite();
+ notificationComposite = ModelFactory.eINSTANCE
+ .createNotificationComposite();
// migration code: existing notifications in the notification
// feature are added to the composite
- notificationList = new AutoSplitAndSaveResourceContainmentList<ESNotification>(notificationComposite,
- notificationComposite.getNotifications(), this.eResource().getResourceSet(),
- Configuration.getWorkspaceDirectory() + "ps-" + getIdentifier() + File.separatorChar + "notifications",
- ".nff");
+ notificationList = new AutoSplitAndSaveResourceContainmentList<ESNotification>(
+ notificationComposite,
+ notificationComposite.getNotifications(), this.eResource()
+ .getResourceSet(),
+ Configuration.getWorkspaceDirectory() + "ps-"
+ + getIdentifier() + File.separatorChar
+ + "notifications", ".nff");
this.setNotificationComposite(notificationComposite);
if (getNotifications().size() > 0) {
notificationList.addAll(getNotifications());
@@ -1047,10 +1118,13 @@
}
}
if (notificationList == null) {
- notificationList = new AutoSplitAndSaveResourceContainmentList<ESNotification>(notificationComposite,
- notificationComposite.getNotifications(), this.eResource().getResourceSet(),
- Configuration.getWorkspaceDirectory() + "ps-" + getIdentifier() + File.separatorChar + "notifications",
- ".nff");
+ notificationList = new AutoSplitAndSaveResourceContainmentList<ESNotification>(
+ notificationComposite,
+ notificationComposite.getNotifications(), this.eResource()
+ .getResourceSet(),
+ Configuration.getWorkspaceDirectory() + "ps-"
+ + getIdentifier() + File.separatorChar
+ + "notifications", ".nff");
}
return notificationList;
}
@@ -1066,17 +1140,24 @@
eventComposite = (EventComposite) eResolveProxy(oldEventComposite);
if (eventComposite != oldEventComposite) {
InternalEObject newEventComposite = (InternalEObject) eventComposite;
- NotificationChain msgs = oldEventComposite.eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE, null, null);
+ NotificationChain msgs = oldEventComposite.eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE,
+ null, null);
if (newEventComposite.eInternalContainer() == null) {
- msgs = newEventComposite.eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE, null, msgs);
+ msgs = newEventComposite
+ .eInverseAdd(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE,
+ null, msgs);
}
if (msgs != null)
msgs.dispatch();
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
- ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE, oldEventComposite, eventComposite));
+ ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE,
+ oldEventComposite, eventComposite));
}
}
return eventComposite;
@@ -1096,12 +1177,15 @@
*
* @generated
*/
- public NotificationChain basicSetEventComposite(EventComposite newEventComposite, NotificationChain msgs) {
+ public NotificationChain basicSetEventComposite(
+ EventComposite newEventComposite, NotificationChain msgs) {
EventComposite oldEventComposite = eventComposite;
eventComposite = newEventComposite;
if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
- ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE, oldEventComposite, newEventComposite);
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET,
+ ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE,
+ oldEventComposite, newEventComposite);
if (msgs == null)
msgs = notification;
else
@@ -1119,17 +1203,22 @@
if (newEventComposite != eventComposite) {
NotificationChain msgs = null;
if (eventComposite != null)
- msgs = ((InternalEObject) eventComposite).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE, null, msgs);
+ msgs = ((InternalEObject) eventComposite).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE,
+ null, msgs);
if (newEventComposite != null)
- msgs = ((InternalEObject) newEventComposite).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE, null, msgs);
+ msgs = ((InternalEObject) newEventComposite).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE,
+ null, msgs);
msgs = basicSetEventComposite(newEventComposite, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE,
- newEventComposite, newEventComposite));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE,
+ newEventComposite, newEventComposite));
}
/**
@@ -1143,18 +1232,26 @@
notificationComposite = (NotificationComposite) eResolveProxy(oldNotificationComposite);
if (notificationComposite != oldNotificationComposite) {
InternalEObject newNotificationComposite = (InternalEObject) notificationComposite;
- NotificationChain msgs = oldNotificationComposite.eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE, null, null);
+ NotificationChain msgs = oldNotificationComposite
+ .eInverseRemove(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE,
+ null, null);
if (newNotificationComposite.eInternalContainer() == null) {
- msgs = newNotificationComposite.eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE, null, msgs);
+ msgs = newNotificationComposite
+ .eInverseAdd(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE,
+ null, msgs);
}
if (msgs != null)
msgs.dispatch();
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
- ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE, oldNotificationComposite,
- notificationComposite));
+ ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE,
+ oldNotificationComposite, notificationComposite));
}
}
return notificationComposite;
@@ -1174,13 +1271,16 @@
*
* @generated
*/
- public NotificationChain basicSetNotificationComposite(NotificationComposite newNotificationComposite,
- NotificationChain msgs) {
+ public NotificationChain basicSetNotificationComposite(
+ NotificationComposite newNotificationComposite,
+ NotificationChain msgs) {
NotificationComposite oldNotificationComposite = notificationComposite;
notificationComposite = newNotificationComposite;
if (eNotificationRequired()) {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
- ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE, oldNotificationComposite, newNotificationComposite);
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET,
+ ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE,
+ oldNotificationComposite, newNotificationComposite);
if (msgs == null)
msgs = notification;
else
@@ -1194,21 +1294,31 @@
*
* @generated
*/
- public void setNotificationComposite(NotificationComposite newNotificationComposite) {
+ public void setNotificationComposite(
+ NotificationComposite newNotificationComposite) {
if (newNotificationComposite != notificationComposite) {
NotificationChain msgs = null;
if (notificationComposite != null)
- msgs = ((InternalEObject) notificationComposite).eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE, null, msgs);
+ msgs = ((InternalEObject) notificationComposite)
+ .eInverseRemove(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE,
+ null, msgs);
if (newNotificationComposite != null)
- msgs = ((InternalEObject) newNotificationComposite).eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- - ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE, null, msgs);
+ msgs = ((InternalEObject) newNotificationComposite)
+ .eInverseAdd(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE,
+ null, msgs);
msgs = basicSetNotificationComposite(newNotificationComposite, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE,
- newNotificationComposite, newNotificationComposite));
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE,
+ newNotificationComposite, newNotificationComposite));
}
/**
@@ -1218,8 +1328,9 @@
*/
public EList<FileIdentifier> getWaitingUploads() {
if (waitingUploads == null) {
- waitingUploads = new EObjectContainmentEList.Resolving<FileIdentifier>(FileIdentifier.class, this,
- ModelPackage.PROJECT_SPACE__WAITING_UPLOADS);
+ waitingUploads = new EObjectContainmentEList.Resolving<FileIdentifier>(
+ FileIdentifier.class, this,
+ ModelPackage.PROJECT_SPACE__WAITING_UPLOADS);
}
return waitingUploads;
}
@@ -1232,8 +1343,9 @@
public EMap<String, EMFStoreProperty> getProperties() {
if (properties == null) {
properties = new EcoreEMap<String, EMFStoreProperty>(
- org.eclipse.emf.emfstore.common.model.ModelPackage.Literals.PROPERTY_MAP_ENTRY,
- PropertyMapEntryImpl.class, this, ModelPackage.PROJECT_SPACE__PROPERTIES);
+ org.eclipse.emf.emfstore.common.model.ModelPackage.Literals.PROPERTY_MAP_ENTRY,
+ PropertyMapEntryImpl.class, this,
+ ModelPackage.PROJECT_SPACE__PROPERTIES);
}
return properties;
}
@@ -1246,8 +1358,9 @@
public EMap<String, EMFStoreProperty> getChangedSharedProperties() {
if (changedSharedProperties == null) {
changedSharedProperties = new EcoreEMap<String, EMFStoreProperty>(
- org.eclipse.emf.emfstore.common.model.ModelPackage.Literals.PROPERTY_MAP_ENTRY,
- PropertyMapEntryImpl.class, this, ModelPackage.PROJECT_SPACE__CHANGED_SHARED_PROPERTIES);
+ org.eclipse.emf.emfstore.common.model.ModelPackage.Literals.PROPERTY_MAP_ENTRY,
+ PropertyMapEntryImpl.class, this,
+ ModelPackage.PROJECT_SPACE__CHANGED_SHARED_PROPERTIES);
}
return changedSharedProperties;
}
@@ -1257,7 +1370,8 @@
*
* @generated NOT
*/
- public PrimaryVersionSpec commit(final LogMessage logMessage) throws EmfStoreException {
+ public PrimaryVersionSpec commit(final LogMessage logMessage)
+ throws EmfStoreException {
return commit(logMessage, null);
}
@@ -1268,7 +1382,8 @@
* org.eclipse.emf.emfstore.client.model.observers.CommitObserver)
* @generated NOT
*/
- public PrimaryVersionSpec commit(LogMessage logMessage, CommitObserver commitObserver) throws EmfStoreException {
+ public PrimaryVersionSpec commit(LogMessage logMessage,
+ CommitObserver commitObserver) throws EmfStoreException {
ChangePackage changePackage;
try {
changePackage = prepareCommit(commitObserver);
@@ -1285,7 +1400,8 @@
* @see org.eclipse.emf.emfstore.client.model.ProjectSpace#prepareCommit(org.eclipse.emf.emfstore.client.model.observers.CommitObserver)
* @generated NOT
*/
- public ChangePackage prepareCommit(CommitObserver commitObserver) throws EmfStoreException {
+ public ChangePackage prepareCommit(CommitObserver commitObserver)
+ throws EmfStoreException {
// check if there are any changes
if (!this.isDirty()) {
@@ -1312,8 +1428,10 @@
notifyPreCommitObservers(changePackage);
- if (commitObserver != null && !commitObserver.inspectChanges(this, changePackage)) {
- throw new CommitCanceledException("Changes have been canceld by the user.");
+ if (commitObserver != null
+ && !commitObserver.inspectChanges(this, changePackage)) {
+ throw new CommitCanceledException(
+ "Changes have been canceld by the user.");
}
return changePackage;
@@ -1327,13 +1445,16 @@
* org.eclipse.emf.emfstore.client.model.observers.CommitObserver)
* @generated NOT
*/
- public PrimaryVersionSpec finalizeCommit(ChangePackage changePackage, LogMessage logMessage,
- CommitObserver commitObserver) throws EmfStoreException {
+ public PrimaryVersionSpec finalizeCommit(ChangePackage changePackage,
+ LogMessage logMessage, CommitObserver commitObserver)
+ throws EmfStoreException {
- final ConnectionManager connectionManager = WorkspaceManager.getInstance().getConnectionManager();
+ final ConnectionManager connectionManager = WorkspaceManager
+ .getInstance().getConnectionManager();
- PrimaryVersionSpec newBaseVersion = connectionManager.createVersion(getUsersession().getSessionId(),
- getProjectId(), getBaseVersion(), changePackage, logMessage);
+ PrimaryVersionSpec newBaseVersion = connectionManager.createVersion(
+ getUsersession().getSessionId(), getProjectId(),
+ getBaseVersion(), changePackage, logMessage);
setBaseVersion(newBaseVersion);
getOperations().clear();
@@ -1360,7 +1481,8 @@
* @see org.eclipse.emf.emfstore.client.model.ProjectSpace#getLocalChangePackage()
*/
public ChangePackage getLocalChangePackage(boolean canonize) {
- ChangePackage changePackage = VersioningFactory.eINSTANCE.createChangePackage();
+ ChangePackage changePackage = VersioningFactory.eINSTANCE
+ .createChangePackage();
// copy operations from ProjectSpace
for (AbstractOperation abstractOperation : getOperations()) {
AbstractOperation copy = EcoreUtil.copy(abstractOperation);
@@ -1377,7 +1499,8 @@
// BEGIN SUPRESS CATCH EXCEPTION
} catch (RuntimeException e) {
// END SUPRESS CATCH EXCEPTION
- WorkspaceUtil.logException("CommitObserver failed with exception", e);
+ WorkspaceUtil.logException(
+ "CommitObserver failed with exception", e);
}
}
}
@@ -1389,7 +1512,8 @@
// BEGIN SUPRESS CATCH EXCEPTION
} catch (RuntimeException e) {
// END SUPRESS CATCH EXCEPTION
- WorkspaceUtil.logException("CommitObserver failed with exception", e);
+ WorkspaceUtil.logException(
+ "CommitObserver failed with exception", e);
}
}
}
@@ -1403,17 +1527,20 @@
// check if operation composite exists
OperationComposite operationComposite = this.getLocalOperations();
if (operationComposite == null) {
- this.setLocalOperations(ModelFactory.eINSTANCE.createOperationComposite());
+ this.setLocalOperations(ModelFactory.eINSTANCE
+ .createOperationComposite());
operationComposite = getLocalOperations();
}
if (isTransient) {
return operationComposite.getOperations();
}
if (operationsList == null) {
- operationsList = new AutoSplitAndSaveResourceContainmentList<AbstractOperation>(operationComposite,
- operationComposite.getOperations(), this.eResource().getResourceSet(),
- Configuration.getWorkspaceDirectory() + "ps-" + getIdentifier() + File.separatorChar + "operations",
- ".off");
+ operationsList = new AutoSplitAndSaveResourceContainmentList<AbstractOperation>(
+ operationComposite, operationComposite.getOperations(),
+ this.eResource().getResourceSet(),
+ Configuration.getWorkspaceDirectory() + "ps-"
+ + getIdentifier() + File.separatorChar
+ + "operations", ".off");
}
return operationsList;
}
@@ -1434,7 +1561,8 @@
* @see org.eclipse.emf.emfstore.client.model.ProjectSpace#update(org.eclipse.emf.emfstore.server.model.versioning.VersionSpec)
* @generated NOT
*/
- public PrimaryVersionSpec update(final VersionSpec version) throws EmfStoreException {
+ public PrimaryVersionSpec update(final VersionSpec version)
+ throws EmfStoreException {
return update(version, null);
}
@@ -1443,12 +1571,14 @@
*
* @generated NOT
*/
- public List<ChangePackage> getChanges(VersionSpec sourceVersion, VersionSpec targetVersion)
- throws EmfStoreException {
- final ConnectionManager connectionManager = WorkspaceManager.getInstance().getConnectionManager();
+ public List<ChangePackage> getChanges(VersionSpec sourceVersion,
+ VersionSpec targetVersion) throws EmfStoreException {
+ final ConnectionManager connectionManager = WorkspaceManager
+ .getInstance().getConnectionManager();
- List<ChangePackage> changes = connectionManager.getChanges(getUsersession().getSessionId(), projectId,
- sourceVersion, targetVersion);
+ List<ChangePackage> changes = connectionManager.getChanges(
+ getUsersession().getSessionId(), projectId, sourceVersion,
+ targetVersion);
return changes;
}
@@ -1457,9 +1587,11 @@
* {@inheritDoc}
*
* @see org.eclipse.emf.emfstore.client.model.ProjectSpace#update(org.eclipse.emf.emfstore.server.model.versioning.VersionSpec,
- * org.eclipse.emf.emfstore.client.model.controller.UpdateCallback, org.eclipse.core.runtime.IProgressMonitor)
+ * org.eclipse.emf.emfstore.client.model.controller.UpdateCallback,
+ * org.eclipse.core.runtime.IProgressMonitor)
*/
- public void update(VersionSpec version, UpdateCallback callback, IProgressMonitor progress) {
+ public void update(VersionSpec version, UpdateCallback callback,
+ IProgressMonitor progress) {
new UpdateController(this).update(version, callback, progress);
}
@@ -1472,8 +1604,10 @@
* @deprecated
*/
@Deprecated
- public PrimaryVersionSpec update(final VersionSpec version, final UpdateObserver observer) throws EmfStoreException {
- final ConnectionManager connectionManager = WorkspaceManager.getInstance().getConnectionManager();
+ public PrimaryVersionSpec update(final VersionSpec version,
+ final UpdateObserver observer) throws EmfStoreException {
+ final ConnectionManager connectionManager = WorkspaceManager
+ .getInstance().getConnectionManager();
final PrimaryVersionSpec resolvedVersion = resolveVersionSpec(version);
if (resolvedVersion.compareTo(baseVersion) == 0) {
@@ -1482,15 +1616,16 @@
List<ChangePackage> changes = new ArrayList<ChangePackage>();
- changes = connectionManager
- .getChanges(getUsersession().getSessionId(), projectId, baseVersion, resolvedVersion);
+ changes = connectionManager.getChanges(getUsersession().getSessionId(),
+ projectId, baseVersion, resolvedVersion);
ChangePackage localchanges = getLocalChangePackage(false);
ConflictDetector conflictDetector = new ConflictDetector();
for (ChangePackage change : changes) {
if (conflictDetector.doConflict(change, localchanges)) {
- throw new ChangeConflictException(changes, this, conflictDetector);
+ throw new ChangeConflictException(changes, this,
+ conflictDetector);
}
}
@@ -1499,7 +1634,8 @@
return getBaseVersion();
}
- WorkspaceManager.getObserverBus().notify(UpdateObserver.class).inspectChanges(this, changes);
+ WorkspaceManager.getObserverBus().notify(UpdateObserver.class)
+ .inspectChanges(this, changes);
final List<ChangePackage> cps = changes;
@@ -1521,7 +1657,8 @@
if (observer != null) {
observer.updateCompleted(this);
}
- WorkspaceManager.getObserverBus().notify(UpdateObserver.class).updateCompleted(this);
+ WorkspaceManager.getObserverBus().notify(UpdateObserver.class)
+ .updateCompleted(this);
// check for operations on file attachments: if version has been
// increased and file is required offline, add to
@@ -1635,20 +1772,24 @@
// EObjectChangeNotifier changeNotifier = new EObjectChangeNotifier(
// this.getProject());
this.operationRecorder = new OperationRecorder(this.getProject(),
- ((ProjectImpl) this.getProject()).getChangeNotifier());
+ ((ProjectImpl) this.getProject()).getChangeNotifier());
if (Configuration.isTesting()) {
this.operationRecorder.setEmitOperationsImmediately(true);
}
this.operationManager = new OperationManager(operationRecorder, this);
this.operationManager.addOperationListener(modifiedModelElementsCache);
- statePersister = new StatePersister(((ProjectImpl) this.getProject()).getChangeNotifier(),
- ((EMFStoreCommandStack) Configuration.getEditingDomain().getCommandStack()), this.getProject());
+ statePersister = new StatePersister(
+ ((ProjectImpl) this.getProject()).getChangeNotifier(),
+ ((EMFStoreCommandStack) Configuration.getEditingDomain()
+ .getCommandStack()), this.getProject());
// TODO: initialization order important
- this.getProject().addIdEObjectCollectionChangeObserver(this.operationRecorder);
+ this.getProject().addIdEObjectCollectionChangeObserver(
+ this.operationRecorder);
this.getProject().addIdEObjectCollectionChangeObserver(statePersister);
if (project instanceof ProjectImpl) {
- ((ProjectImpl) this.getProject()).setUndetachable(operationRecorder);
+ ((ProjectImpl) this.getProject())
+ .setUndetachable(operationRecorder);
((ProjectImpl) this.getProject()).setUndetachable(statePersister);
}
if (getUsersession() != null) {
@@ -1656,7 +1797,8 @@
ACUser acUser = getUsersession().getACUser();
if (acUser != null) {
for (OrgUnitProperty p : acUser.getProperties()) {
- if (p.getProject() != null && p.getProject().equals(getProjectId())) {
+ if (p.getProject() != null
+ && p.getProject().equals(getProjectId())) {
propertyMap.put(p.getName(), p);
}
}
@@ -1681,7 +1823,8 @@
* @generated NOT
*/
public ProjectInfo getProjectInfo() {
- ProjectInfo projectInfo = org.eclipse.emf.emfstore.server.model.ModelFactory.eINSTANCE.createProjectInfo();
+ ProjectInfo projectInfo = org.eclipse.emf.emfstore.server.model.ModelFactory.eINSTANCE
+ .createProjectInfo();
projectInfo.setProjectId(ModelUtil.clone(getProjectId()));
projectInfo.setName(getProjectName());
projectInfo.setDescription(getProjectDescription());
@@ -1696,9 +1839,12 @@
* @throws EmfStoreException
* @generated NOT
*/
- public PrimaryVersionSpec resolveVersionSpec(VersionSpec versionSpec) throws EmfStoreException {
- ConnectionManager connectionManager = WorkspaceManager.getInstance().getConnectionManager();
- return connectionManager.resolveVersionSpec(getUsersession().getSessionId(), getProjectId(), versionSpec);
+ public PrimaryVersionSpec resolveVersionSpec(VersionSpec versionSpec)
+ throws EmfStoreException {
+ ConnectionManager connectionManager = WorkspaceManager.getInstance()
+ .getConnectionManager();
+ return connectionManager.resolveVersionSpec(getUsersession()
+ .getSessionId(), getProjectId(), versionSpec);
}
/**
@@ -1709,20 +1855,25 @@
*/
public void initResources(ResourceSet resourceSet) {
initCompleted = true;
- String projectSpaceFileNamePrefix = Configuration.getWorkspaceDirectory()
- + Configuration.getProjectSpaceDirectoryPrefix() + getIdentifier() + File.separatorChar;
- String projectSpaceFileName = projectSpaceFileNamePrefix + this.getIdentifier()
- + Configuration.getProjectSpaceFileExtension();
- String operationsCompositeFileName = projectSpaceFileNamePrefix + this.getIdentifier()
- + Configuration.getOperationCompositeFileExtension();
- String projectFragementsFileNamePrefix = projectSpaceFileNamePrefix + Configuration.getProjectFolderName()
- + File.separatorChar;
+ String projectSpaceFileNamePrefix = Configuration
+ .getWorkspaceDirectory()
+ + Configuration.getProjectSpaceDirectoryPrefix()
+ + getIdentifier() + File.separatorChar;
+ String projectSpaceFileName = projectSpaceFileNamePrefix
+ + this.getIdentifier()
+ + Configuration.getProjectSpaceFileExtension();
+ String operationsCompositeFileName = projectSpaceFileNamePrefix
+ + this.getIdentifier()
+ + Configuration.getOperationCompositeFileExtension();
+ String projectFragementsFileNamePrefix = projectSpaceFileNamePrefix
+ + Configuration.getProjectFolderName() + File.separatorChar;
URI projectSpaceURI = URI.createFileURI(projectSpaceFileName);
- URI operationCompositeURI = URI.createFileURI(operationsCompositeFileName);
+ URI operationCompositeURI = URI
+ .createFileURI(operationsCompositeFileName);
setResourceCount(0);
String fileName = projectFragementsFileNamePrefix + getResourceCount()
- + Configuration.getProjectFragmentFileExtension();
+ + Configuration.getProjectFragmentFileExtension();
URI fileURI = URI.createFileURI(fileName);
List<Resource> resources = new ArrayList<Resource>();
@@ -1733,21 +1884,26 @@
setResourceCount(getResourceCount() + 1);
if (Configuration.isResourceSplittingEnabled()) {
- splitResources(resourceSet, projectFragementsFileNamePrefix, resources, this.getProject());
+ splitResources(resourceSet, projectFragementsFileNamePrefix,
+ resources, this.getProject());
} else {
for (EObject modelElement : project.getAllModelElements()) {
- ((XMIResource) resource).setID(modelElement, getProject().getModelElementId(modelElement).getId());
+ ((XMIResource) resource).setID(modelElement, getProject()
+ .getModelElementId(modelElement).getId());
}
}
- Resource operationCompositeResource = resourceSet.createResource(operationCompositeURI);
+ Resource operationCompositeResource = resourceSet
+ .createResource(operationCompositeURI);
if (this.getLocalOperations() == null) {
- this.setLocalOperations(ModelFactory.eINSTANCE.createOperationComposite());
+ this.setLocalOperations(ModelFactory.eINSTANCE
+ .createOperationComposite());
}
operationCompositeResource.getContents().add(this.getLocalOperations());
resources.add(operationCompositeResource);
- Resource projectSpaceResource = resourceSet.createResource(projectSpaceURI);
+ Resource projectSpaceResource = resourceSet
+ .createResource(projectSpaceURI);
projectSpaceResource.getContents().add(this);
resources.add(projectSpaceResource);
@@ -1756,7 +1912,8 @@
try {
currentResource.save(Configuration.getResourceSaveOptions());
} catch (IOException e) {
- WorkspaceUtil.logException("Project Space resource init failed!", e);
+ WorkspaceUtil.logException(
+ "Project Space resource init failed!", e);
}
}
@@ -1764,8 +1921,9 @@
init();
}
- private void splitResources(ResourceSet resourceSet, String projectFragementsFileNamePrefix,
- List<Resource> resources, Project project) {
+ private void splitResources(ResourceSet resourceSet,
+ String projectFragementsFileNamePrefix, List<Resource> resources,
+ Project project) {
String fileName;
URI fileURI;
@@ -1775,14 +1933,15 @@
// never split maps
if (modelElement instanceof BasicEMap.Entry) {
- ((XMIResource) modelElement.eContainer().eResource()).setID(modelElement, getProject()
- .getModelElementId(modelElement).getId());
+ ((XMIResource) modelElement.eContainer().eResource()).setID(
+ modelElement,
+ getProject().getModelElementId(modelElement).getId());
continue;
}
if (counter > Configuration.getMaxMECountPerResource()) {
fileName = projectFragementsFileNamePrefix + getResourceCount()
- + Configuration.getProjectFragmentFileExtension();
+ + Configuration.getProjectFragmentFileExtension();
fileURI = URI.createFileURI(fileName);
resource = resourceSet.createResource(fileURI);
setResourceCount(getResourceCount() + 1);
@@ -1798,7 +1957,8 @@
private void assignElementToResource(Resource resource, EObject modelElement) {
resource.getContents().add(modelElement);
// FIXME: this is not nice!
- ((XMIResource) resource).setID(modelElement, getProject().getModelElementId(modelElement).getId());
+ ((XMIResource) resource).setID(modelElement, getProject()
+ .getModelElementId(modelElement).getId());
}
// end of custom code
@@ -1808,7 +1968,8 @@
* @generated
*/
@Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
switch (featureID) {
case ModelPackage.PROJECT_SPACE__PROJECT:
return basicSetProject(null, msgs);
@@ -1821,17 +1982,21 @@
case ModelPackage.PROJECT_SPACE__LOCAL_OPERATIONS:
return basicSetLocalOperations(null, msgs);
case ModelPackage.PROJECT_SPACE__NOTIFICATIONS:
- return ((InternalEList<?>) getNotifications()).basicRemove(otherEnd, msgs);
+ return ((InternalEList<?>) getNotifications()).basicRemove(
+ otherEnd, msgs);
case ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE:
return basicSetEventComposite(null, msgs);
case ModelPackage.PROJECT_SPACE__NOTIFICATION_COMPOSITE:
return basicSetNotificationComposite(null, msgs);
case ModelPackage.PROJECT_SPACE__WAITING_UPLOADS:
- return ((InternalEList<?>) getWaitingUploads()).basicRemove(otherEnd, msgs);
+ return ((InternalEList<?>) getWaitingUploads()).basicRemove(
+ otherEnd, msgs);
case ModelPackage.PROJECT_SPACE__PROPERTIES:
- return ((InternalEList<?>) getProperties()).basicRemove(otherEnd, msgs);
+ return ((InternalEList<?>) getProperties()).basicRemove(otherEnd,
+ msgs);
case ModelPackage.PROJECT_SPACE__CHANGED_SHARED_PROPERTIES:
- return ((InternalEList<?>) getChangedSharedProperties()).basicRemove(otherEnd, msgs);
+ return ((InternalEList<?>) getChangedSharedProperties())
+ .basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@@ -1953,7 +2118,8 @@
return;
case ModelPackage.PROJECT_SPACE__NOTIFICATIONS:
getNotifications().clear();
- getNotifications().addAll((Collection<? extends ESNotification>) newValue);
+ getNotifications().addAll(
+ (Collection<? extends ESNotification>) newValue);
return;
case ModelPackage.PROJECT_SPACE__EVENT_COMPOSITE:
setEventComposite((EventComposite) newValue);
@@ -1963,13 +2129,15 @@
return;
case ModelPackage.PROJECT_SPACE__WAITING_UPLOADS:
getWaitingUploads().clear();
- getWaitingUploads().addAll((Collection<? extends FileIdentifier>) newValue);
+ getWaitingUploads().addAll(
+ (Collection<? extends FileIdentifier>) newValue);
return;
case ModelPackage.PROJECT_SPACE__PROPERTIES:
((EStructuralFeature.Setting) getProperties()).set(newValue);
return;
case ModelPackage.PROJECT_SPACE__CHANGED_SHARED_PROPERTIES:
- ((EStructuralFeature.Setting) getChangedSharedProperties()).set(newValue);
+ ((EStructuralFeature.Setting) getChangedSharedProperties())
+ .set(newValue);
return;
}
super.eSet(featureID, newValue);
@@ -2054,16 +2222,18 @@
case ModelPackage.PROJECT_SPACE__PROJECT_ID:
return projectId != null;
case ModelPackage.PROJECT_SPACE__PROJECT_NAME:
- return PROJECT_NAME_EDEFAULT == null ? projectName != null : !PROJECT_NAME_EDEFAULT.equals(projectName);
+ return PROJECT_NAME_EDEFAULT == null ? projectName != null
+ : !PROJECT_NAME_EDEFAULT.equals(projectName);
case ModelPackage.PROJECT_SPACE__PROJECT_DESCRIPTION:
- return PROJECT_DESCRIPTION_EDEFAULT == null ? projectDescription != null : !PROJECT_DESCRIPTION_EDEFAULT
- .equals(projectDescription);
+ return PROJECT_DESCRIPTION_EDEFAULT == null ? projectDescription != null
+ : !PROJECT_DESCRIPTION_EDEFAULT.equals(projectDescription);
case ModelPackage.PROJECT_SPACE__EVENTS:
return events != null && !events.isEmpty();
case ModelPackage.PROJECT_SPACE__USERSESSION:
return usersession != null;
case ModelPackage.PROJECT_SPACE__LAST_UPDATED:
- return LAST_UPDATED_EDEFAULT == null ? lastUpdated != null : !LAST_UPDATED_EDEFAULT.equals(lastUpdated);
+ return LAST_UPDATED_EDEFAULT == null ? lastUpdated != null
+ : !LAST_UPDATED_EDEFAULT.equals(lastUpdated);
case ModelPackage.PROJECT_SPACE__BASE_VERSION:
return baseVersion != null;
case ModelPackage.PROJECT_SPACE__RESOURCE_COUNT:
@@ -2085,7 +2255,8 @@
case ModelPackage.PROJECT_SPACE__PROPERTIES:
return properties != null && !properties.isEmpty();
case ModelPackage.PROJECT_SPACE__CHANGED_SHARED_PROPERTIES:
- return changedSharedProperties != null && !changedSharedProperties.isEmpty();
+ return changedSharedProperties != null
+ && !changedSharedProperties.isEmpty();
}
return super.eIsSet(featureID);
}
@@ -2146,10 +2317,11 @@
// }
createdProject = WorkspaceManager
- .getInstance()
- .getConnectionManager()
- .createProject(usersession.getSessionId(), this.getProjectName(), this.getProjectDescription(), logMessage,
- this.getProject());
+ .getInstance()
+ .getConnectionManager()
+ .createProject(usersession.getSessionId(),
+ this.getProjectName(), this.getProjectDescription(),
+ logMessage, this.getProject());
statePersister.setAutoSave(true);
statePersister.saveDirtyResources();
startChangeRecording();
@@ -2170,11 +2342,13 @@
private void notifyShareObservers() {
try {
- WorkspaceManager.getObserverBus().notify(ShareObserver.class).shareDone(this);
+ WorkspaceManager.getObserverBus().notify(ShareObserver.class)
+ .shareDone(this);
// BEGIN SUPRESS CATCH EXCEPTION
} catch (RuntimeException e) {
// END SUPRESS CATCH EXCEPTION
- WorkspaceUtil.logException("ShareObserver failed with exception", e);
+ WorkspaceUtil
+ .logException("ShareObserver failed with exception", e);
}
}
@@ -2191,7 +2365,8 @@
* @see org.eclipse.emf.emfstore.client.model.ProjectSpace#exportProject(java.lang.String)
*/
public void exportProject(String absoluteFileName) throws IOException {
- WorkspaceManager.getInstance().getCurrentWorkspace().exportProject(this, absoluteFileName);
+ WorkspaceManager.getInstance().getCurrentWorkspace()
+ .exportProject(this, absoluteFileName);
}
/**
@@ -2204,17 +2379,20 @@
try {
if (resource == null) {
if (!isTransient) {
- WorkspaceUtil.logException("Resources of project space are not properly initialized!",
- new IllegalProjectSpaceStateException("Resource to save is null"));
+ WorkspaceUtil
+ .logException(
+ "Resources of project space are not properly initialized!",
+ new IllegalProjectSpaceStateException(
+ "Resource to save is null"));
}
return;
}
resource.save(Configuration.getResourceSaveOptions());
} catch (IOException e) {
WorkspaceUtil
- .logException(
- "An error in the data was detected during save! The safest way to deal with this problem is to delete this project and checkout again.",
- e);
+ .logException(
+ "An error in the data was detected during save! The safest way to deal with this problem is to delete this project and checkout again.",
+ e);
}
}
@@ -2224,7 +2402,8 @@
* @see org.eclipse.emf.emfstore.client.model.ProjectSpace#exportLocalChanges(java.lang.String)
*/
public void exportLocalChanges(String fileName) throws IOException {
- ResourceHelper.putElementIntoNewResourceWithProject(fileName, getLocalChangePackage(false), this.project);
+ ResourceHelper.putElementIntoNewResourceWithProject(fileName,
+ getLocalChangePackage(false), this.project);
}
/**
@@ -2235,11 +2414,13 @@
public void importLocalChanges(String fileName) throws IOException {
ResourceSetImpl resourceSet = new ResourceSetImpl();
- Resource resource = resourceSet.getResource(URI.createFileURI(fileName), true);
+ Resource resource = resourceSet.getResource(
+ URI.createFileURI(fileName), true);
EList<EObject> directContents = resource.getContents();
// sanity check
- if (directContents.size() != 1 && (!(directContents.get(0) instanceof ChangePackage))) {
+ if (directContents.size() != 1
+ && (!(directContents.get(0) instanceof ChangePackage))) {
throw new IOException("File is corrupt, does not contain Changes.");
}
@@ -2255,7 +2436,8 @@
public void undoLastOperation() {
if (!this.getOperations().isEmpty()) {
List<AbstractOperation> operations = this.getOperations();
- AbstractOperation lastOperation = operations.get(operations.size() - 1);
+ AbstractOperation lastOperation = operations
+ .get(operations.size() - 1);
stopChangeRecording();
try {
lastOperation.reverse().apply(getProject());
@@ -2287,9 +2469,12 @@
*
* @generated NOT
*/
- public void addTag(PrimaryVersionSpec versionSpec, TagVersionSpec tag) throws EmfStoreException {
- final ConnectionManager cm = WorkspaceManager.getInstance().getConnectionManager();
- cm.addTag(getUsersession().getSessionId(), getProjectId(), versionSpec, tag);
+ public void addTag(PrimaryVersionSpec versionSpec, TagVersionSpec tag)
+ throws EmfStoreException {
+ final ConnectionManager cm = WorkspaceManager.getInstance()
+ .getConnectionManager();
+ cm.addTag(getUsersession().getSessionId(), getProjectId(), versionSpec,
+ tag);
}
/**
@@ -2297,9 +2482,12 @@
*
* @generated NOT
*/
- public void removeTag(PrimaryVersionSpec versionSpec, TagVersionSpec tag) throws EmfStoreException {
- final ConnectionManager cm = WorkspaceManager.getInstance().getConnectionManager();
- cm.removeTag(getUsersession().getSessionId(), getProjectId(), versionSpec, tag);
+ public void removeTag(PrimaryVersionSpec versionSpec, TagVersionSpec tag)
+ throws EmfStoreException {
+ final ConnectionManager cm = WorkspaceManager.getInstance()
+ .getConnectionManager();
+ cm.removeTag(getUsersession().getSessionId(), getProjectId(),
+ versionSpec, tag);
}
/**
@@ -2307,8 +2495,10 @@
*
* @see org.eclipse.emf.emfstore.client.model.ProjectSpace#resolve(org.eclipse.emf.emfstore.server.model.url.ModelElementUrlFragment)
*/
- public EObject resolve(ModelElementUrlFragment modelElementUrlFragment) throws MEUrlResolutionException {
- ModelElementId modelElementId = modelElementUrlFragment.getModelElementId();
+ public EObject resolve(ModelElementUrlFragment modelElementUrlFragment)
+ throws MEUrlResolutionException {
+ ModelElementId modelElementId = modelElementUrlFragment
+ .getModelElementId();
EObject modelElement = getProject().getModelElement(modelElementId);
if (modelElement == null) {
throw new MEUrlResolutionException();
@@ -2323,7 +2513,8 @@
*/
public void makeTransient() {
if (initCompleted) {
- throw new IllegalAccessError("Project Space cannot be set to transient after init.");
+ throw new IllegalAccessError(
+ "Project Space cannot be set to transient after init.");
}
isTransient = true;
}
@@ -2335,8 +2526,8 @@
* @see org.eclipse.emf.emfstore.client.model.ProjectSpace#applyMergeResult(java.util.List)
*/
@Deprecated
- public void applyMergeResult(List<AbstractOperation> mergeResult, VersionSpec mergeTargetSpec)
- throws EmfStoreException {
+ public void applyMergeResult(List<AbstractOperation> mergeResult,
+ VersionSpec mergeTargetSpec) throws EmfStoreException {
revert();
update(mergeTargetSpec);
@@ -2361,18 +2552,24 @@
// BEGIN SUPRESS CATCH EXCEPTION
} catch (RuntimeException e) {
// END SUPRESS CATCH EXCEPTION
- WorkspaceUtil.logException("Resuming file transfers or transmitting properties failed!", e);
+ WorkspaceUtil
+ .logException(
+ "Resuming file transfers or transmitting properties failed!",
+ e);
}
}
/**
* {@inheritDoc}
*/
- public void merge(PrimaryVersionSpec target, ConflictResolver conflictResolver) throws EmfStoreException {
+ public void merge(PrimaryVersionSpec target,
+ ConflictResolver conflictResolver) throws EmfStoreException {
// merge the conflicts
ChangePackage myCp = this.getLocalChangePackage(true);
- List<ChangePackage> theirCps = this.getChanges(getBaseVersion(), target);
- if (conflictResolver.resolveConflicts(project, theirCps, myCp, getBaseVersion(), target)) {
+ List<ChangePackage> theirCps = this
+ .getChanges(getBaseVersion(), target);
+ if (conflictResolver.resolveConflicts(project, theirCps, myCp,
+ getBaseVersion(), target)) {
// revert the local operations and apply all their operations
this.revert();
@@ -2382,8 +2579,10 @@
}
// generate merge result and apply to local workspace
- List<AbstractOperation> acceptedMine = conflictResolver.getAcceptedMine();
- List<AbstractOperation> rejectedTheirs = conflictResolver.getRejectedTheirs();
+ List<AbstractOperation> acceptedMine = conflictResolver
+ .getAcceptedMine();
+ List<AbstractOperation> rejectedTheirs = conflictResolver
+ .getRejectedTheirs();
List<AbstractOperation> mergeResult = new ArrayList<AbstractOperation>();
for (AbstractOperation operationToReverse : rejectedTheirs) {
mergeResult.add(0, operationToReverse.reverse());
@@ -2499,7 +2698,8 @@
* @param addOperation
* true if operation should be saved in project space.
*/
- public void applyOperations(List<AbstractOperation> operations, boolean addOperation) {
+ public void applyOperations(List<AbstractOperation> operations,
+ boolean addOperation) {
stopChangeRecording();
try {
for (AbstractOperation operation : operations) {
@@ -2528,13 +2728,18 @@
* @param force
* if true, no exception is thrown if operation.apply failes
* @param semanticApply
- * when true, does a semanticApply if possible (see {@link SemanticCompositeOperation})
+ * when true, does a semanticApply if possible (see
+ * {@link SemanticCompositeOperation})
*/
- public void applyOperationsWithRecording(List<AbstractOperation> operations, boolean force, boolean semanticApply) {
+ public void applyOperationsWithRecording(
+ List<AbstractOperation> operations, boolean force,
+ boolean semanticApply) {
for (AbstractOperation operation : operations) {
try {
- if (semanticApply && operation instanceof SemanticCompositeOperation) {
- ((SemanticCompositeOperation) operation).semanticApply(getProject());
+ if (semanticApply
+ && operation instanceof SemanticCompositeOperation) {
+ ((SemanticCompositeOperation) operation)
+ .semanticApply(getProject());
} else {
operation.apply(getProject());
}
@@ -2547,8 +2752,9 @@
}
/**
- * Applies a list of operations to the project. This method is used by {@link #importLocalChanges(String)}. This
- * method redirects to {@link #applyOperationsWithRecording(List, boolean, boolean)}, using
+ * Applies a list of operations to the project. This method is used by
+ * {@link #importLocalChanges(String)}. This method redirects to
+ * {@link #applyOperationsWithRecording(List, boolean, boolean)}, using
* false for semantic apply.
*
* @param operations
@@ -2556,21 +2762,24 @@
* @param force
* if true, no exception is thrown if operation.apply failes
*/
- public void applyOperationsWithRecording(List<AbstractOperation> operations, boolean force) {
+ public void applyOperationsWithRecording(
+ List<AbstractOperation> operations, boolean force) {
applyOperationsWithRecording(operations, force, false);
}
/**
* {@inheritDoc}
*/
- public OrgUnitProperty getProperty(PropertyKey name) throws PropertyNotFoundException {
+ public OrgUnitProperty getProperty(PropertyKey name)
+ throws PropertyNotFoundException {
return getProperty(name.toString());
}
/**
* getter for a string argument - see {@link #setProperty(OrgUnitProperty)}.
*/
- private OrgUnitProperty getProperty(String name) throws PropertyNotFoundException {
+ private OrgUnitProperty getProperty(String name)
+ throws PropertyNotFoundException {
// sanity checks
if (getUsersession() != null && getUsersession().getACUser() != null) {
OrgUnitProperty orgUnitProperty = propertyMap.get(name);
@@ -2601,9 +2810,10 @@
}
// the properties that have been altered are retained in a separate
// list
- for (OrgUnitProperty changedProperty : getUsersession().getChangedProperties()) {
+ for (OrgUnitProperty changedProperty : getUsersession()
+ .getChangedProperties()) {
if (changedProperty.getName().equals(property.getName())
- && changedProperty.getProject().equals(getProjectId())) {
+ && changedProperty.getProject().equals(getProjectId())) {
changedProperty.setValue(property.getValue());
WorkspaceManager.getInstance().getCurrentWorkspace().save();
return;
@@ -2626,8 +2836,10 @@
*/
public void transmitProperties() {
List<OrgUnitProperty> temp = new ArrayList<OrgUnitProperty>();
- for (OrgUnitProperty changedProperty : getUsersession().getChangedProperties()) {
- if (changedProperty.getProject() != null && changedProperty.getProject().equals(getProjectId())) {
+ for (OrgUnitProperty changedProperty : getUsersession()
+ .getChangedProperties()) {
+ if (changedProperty.getProject() != null
+ && changedProperty.getProject().equals(getProjectId())) {
temp.add(changedProperty);
}
}
@@ -2635,13 +2847,15 @@
while (iterator.hasNext()) {
try {
WorkspaceManager
- .getInstance()
- .getConnectionManager()
- .transmitProperty(getUsersession().getSessionId(), iterator.next(), getUsersession().getACUser(),
- getProjectId());
+ .getInstance()
+ .getConnectionManager()
+ .transmitProperty(getUsersession().getSessionId(),
+ iterator.next(), getUsersession().getACUser(),
+ getProjectId());
iterator.remove();
} catch (EmfStoreException e) {
- WorkspaceUtil.logException("Transmission of properties failed with exception", e);
+ WorkspaceUtil.logException(
+ "Transmission of properties failed with exception", e);
}
}
}
@@ -2660,11 +2874,6 @@
*/
public PrimaryVersionSpec commit() throws EmfStoreException {
LogMessage logMessage = VersioningFactory.eINSTANCE.createLogMessage();
- String commiter = "UNKOWN";
- if (this.getUsersession().getACUser() != null && this.getUsersession().getACUser().getName() != null) {
- commiter = this.getUsersession().getACUser().getName();
- }
- logMessage.setAuthor(commiter);
logMessage.setClientDate(new Date());
logMessage.setMessage("");
return commit(logMessage);
@@ -2694,7 +2903,8 @@
* @see org.eclipse.emf.emfstore.client.model.ProjectSpace#getFile(org.eclipse.emf.emfstore.server.model.FileIdentifier,
* org.eclipse.core.runtime.IProgressMonitor)
*/
- public FileDownloadStatus getFile(FileIdentifier fileIdentifier) throws FileTransferException {
+ public FileDownloadStatus getFile(FileIdentifier fileIdentifier)
+ throws FileTransferException {
return fileTransferManager.getFile(fileIdentifier);
}
diff --git a/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/core/EmfStoreImpl.java b/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/core/EmfStoreImpl.java
index d7352a5..8dd27e1 100644
--- a/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/core/EmfStoreImpl.java
+++ b/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/core/EmfStoreImpl.java
@@ -64,9 +64,8 @@
* @throws FatalEmfStoreException
* in case of failure
*/
- public EmfStoreImpl(ServerSpace serverSpace,
- AuthorizationControl authorizationControl)
- throws FatalEmfStoreException {
+ public EmfStoreImpl(ServerSpace serverSpace, AuthorizationControl authorizationControl)
+ throws FatalEmfStoreException {
super(serverSpace, authorizationControl);
}
@@ -86,221 +85,187 @@
/**
* {@inheritDoc}
*/
- public List<HistoryInfo> getHistoryInfo(SessionId sessionId,
- ProjectId projectId, HistoryQuery historyQuery)
- throws EmfStoreException {
+ public List<HistoryInfo> getHistoryInfo(SessionId sessionId, ProjectId projectId, HistoryQuery historyQuery)
+ throws EmfStoreException {
sanityCheckObjects(sessionId, projectId, historyQuery);
checkReadAccess(sessionId, projectId, null);
- return getSubInterface(HistorySubInterfaceImpl.class).getHistoryInfo(
- projectId, historyQuery);
+ return getSubInterface(HistorySubInterfaceImpl.class).getHistoryInfo(projectId, historyQuery);
}
/**
* {@inheritDoc}
*/
- public void addTag(SessionId sessionId, ProjectId projectId,
- PrimaryVersionSpec versionSpec, TagVersionSpec tag)
- throws EmfStoreException {
+ public void addTag(SessionId sessionId, ProjectId projectId, PrimaryVersionSpec versionSpec, TagVersionSpec tag)
+ throws EmfStoreException {
sanityCheckObjects(sessionId, projectId, versionSpec, tag);
checkProjectAdminAccess(sessionId, projectId);
- getSubInterface(HistorySubInterfaceImpl.class).addTag(projectId,
- versionSpec, tag);
+ getSubInterface(HistorySubInterfaceImpl.class).addTag(projectId, versionSpec, tag);
}
/**
* {@inheritDoc}
*/
- public void removeTag(SessionId sessionId, ProjectId projectId,
- PrimaryVersionSpec versionSpec, TagVersionSpec tag)
- throws EmfStoreException {
+ public void removeTag(SessionId sessionId, ProjectId projectId, PrimaryVersionSpec versionSpec, TagVersionSpec tag)
+ throws EmfStoreException {
sanityCheckObjects(sessionId, projectId, versionSpec, tag);
checkProjectAdminAccess(sessionId, projectId);
- getSubInterface(HistorySubInterfaceImpl.class).removeTag(projectId,
- versionSpec, tag);
+ getSubInterface(HistorySubInterfaceImpl.class).removeTag(projectId, versionSpec, tag);
}
/**
* {@inheritDoc}
*/
- public ProjectInfo createEmptyProject(SessionId sessionId, String name,
- String description, LogMessage logMessage) throws EmfStoreException {
+ public ProjectInfo createEmptyProject(SessionId sessionId, String name, String description, LogMessage logMessage)
+ throws EmfStoreException {
sanityCheckObjects(sessionId, name, description, logMessage);
checkServerAdminAccess(sessionId);
- return getSubInterface(ProjectSubInterfaceImpl.class).createProject(
- name, description, logMessage);
+ return getSubInterface(ProjectSubInterfaceImpl.class).createProject(name, description, logMessage);
}
/**
* {@inheritDoc}
*/
- public ProjectInfo createProject(SessionId sessionId, String name,
- String description, LogMessage logMessage, Project project)
- throws EmfStoreException {
+ public ProjectInfo createProject(SessionId sessionId, String name, String description, LogMessage logMessage,
+ Project project) throws EmfStoreException {
sanityCheckObjects(sessionId, name, description, logMessage, project);
checkServerAdminAccess(sessionId);
- return getSubInterface(ProjectSubInterfaceImpl.class).createProject(
- name, description, logMessage, project);
+ return getSubInterface(ProjectSubInterfaceImpl.class).createProject(name, description, logMessage, project);
}
/**
* {@inheritDoc}
*/
- public void deleteProject(SessionId sessionId, ProjectId projectId,
- boolean deleteFiles) throws EmfStoreException {
+ public void deleteProject(SessionId sessionId, ProjectId projectId, boolean deleteFiles) throws EmfStoreException {
sanityCheckObjects(sessionId, projectId);
checkServerAdminAccess(sessionId);
- getSubInterface(ProjectSubInterfaceImpl.class).deleteProject(projectId,
- deleteFiles);
+ getSubInterface(ProjectSubInterfaceImpl.class).deleteProject(projectId, deleteFiles);
}
/**
* {@inheritDoc}
*/
- public PrimaryVersionSpec createVersion(SessionId sessionId,
- ProjectId projectId, PrimaryVersionSpec baseVersionSpec,
- ChangePackage changePackage, LogMessage logMessage)
- throws EmfStoreException, InvalidVersionSpecException {
- sanityCheckObjects(sessionId, projectId, baseVersionSpec,
- changePackage, logMessage);
+ public PrimaryVersionSpec createVersion(SessionId sessionId, ProjectId projectId,
+ PrimaryVersionSpec baseVersionSpec, ChangePackage changePackage, LogMessage logMessage)
+ throws EmfStoreException, InvalidVersionSpecException {
+ sanityCheckObjects(sessionId, projectId, baseVersionSpec, changePackage, logMessage);
checkWriteAccess(sessionId, projectId, null);
- PrimaryVersionSpec newVersion = getSubInterface(
- VersionSubInterfaceImpl.class).createVersion(projectId,
- baseVersionSpec, changePackage, logMessage);
- EventManager.getInstance().sendEvent(
- EventHelper.createUpdatedProjectEvent(projectId, newVersion));
+ ACUser user = getAuthorizationControl().resolveUser(sessionId);
+ PrimaryVersionSpec newVersion = getSubInterface(VersionSubInterfaceImpl.class).createVersion(projectId,
+ baseVersionSpec, changePackage, logMessage, user);
+ EventManager.getInstance().sendEvent(EventHelper.createUpdatedProjectEvent(projectId, newVersion));
return newVersion;
}
/**
* {@inheritDoc}
*/
- public List<ChangePackage> getChanges(SessionId sessionId,
- ProjectId projectId, VersionSpec source, VersionSpec target)
- throws EmfStoreException {
+ public List<ChangePackage> getChanges(SessionId sessionId, ProjectId projectId, VersionSpec source,
+ VersionSpec target) throws EmfStoreException {
sanityCheckObjects(sessionId, projectId, source, target);
checkReadAccess(sessionId, projectId, null);
- return getSubInterface(VersionSubInterfaceImpl.class).getChanges(
- projectId, source, target);
+ return getSubInterface(VersionSubInterfaceImpl.class).getChanges(projectId, source, target);
}
/**
* {@inheritDoc}
*/
- public PrimaryVersionSpec resolveVersionSpec(SessionId sessionId,
- ProjectId projectId, VersionSpec versionSpec)
- throws EmfStoreException {
+ public PrimaryVersionSpec resolveVersionSpec(SessionId sessionId, ProjectId projectId, VersionSpec versionSpec)
+ throws EmfStoreException {
sanityCheckObjects(sessionId, projectId, versionSpec);
checkReadAccess(sessionId, projectId, null);
- return getSubInterface(VersionSubInterfaceImpl.class)
- .resolveVersionSpec(projectId, versionSpec);
+ return getSubInterface(VersionSubInterfaceImpl.class).resolveVersionSpec(projectId, versionSpec);
}
/**
* {@inheritDoc}
*/
- public Project getProject(SessionId sessionId, ProjectId projectId,
- VersionSpec versionSpec) throws EmfStoreException {
+ public Project getProject(SessionId sessionId, ProjectId projectId, VersionSpec versionSpec)
+ throws EmfStoreException {
sanityCheckObjects(sessionId, projectId, versionSpec);
checkReadAccess(sessionId, projectId, null);
- return getSubInterface(ProjectSubInterfaceImpl.class).getProject(
- projectId, versionSpec);
+ return getSubInterface(ProjectSubInterfaceImpl.class).getProject(projectId, versionSpec);
}
/**
* {@inheritDoc}
*/
- public List<ProjectInfo> getProjectList(SessionId sessionId)
- throws EmfStoreException {
+ public List<ProjectInfo> getProjectList(SessionId sessionId) throws EmfStoreException {
sanityCheckObjects(sessionId);
- return getSubInterface(ProjectSubInterfaceImpl.class).getProjectList(
- sessionId);
+ return getSubInterface(ProjectSubInterfaceImpl.class).getProjectList(sessionId);
}
/**
* {@inheritDoc}
*/
- public ProjectId importProjectHistoryToServer(SessionId sessionId,
- ProjectHistory projectHistory) throws EmfStoreException {
+ public ProjectId importProjectHistoryToServer(SessionId sessionId, ProjectHistory projectHistory)
+ throws EmfStoreException {
sanityCheckObjects(sessionId, projectHistory);
checkServerAdminAccess(sessionId);
- return getSubInterface(ProjectSubInterfaceImpl.class)
- .importProjectHistoryToServer(projectHistory);
+ return getSubInterface(ProjectSubInterfaceImpl.class).importProjectHistoryToServer(projectHistory);
}
/**
* {@inheritDoc}
*/
- public ProjectHistory exportProjectHistoryFromServer(SessionId sessionId,
- ProjectId projectId) throws EmfStoreException {
+ public ProjectHistory exportProjectHistoryFromServer(SessionId sessionId, ProjectId projectId)
+ throws EmfStoreException {
sanityCheckObjects(sessionId, projectId);
checkServerAdminAccess(sessionId);
- return getSubInterface(ProjectSubInterfaceImpl.class)
- .exportProjectHistoryFromServer(projectId);
+ return getSubInterface(ProjectSubInterfaceImpl.class).exportProjectHistoryFromServer(projectId);
}
/**
* {@inheritDoc}
*/
- public ACUser resolveUser(SessionId sessionId, ACOrgUnitId id)
- throws EmfStoreException {
+ public ACUser resolveUser(SessionId sessionId, ACOrgUnitId id) throws EmfStoreException {
sanityCheckObjects(sessionId);
- return getSubInterface(UserSubInterfaceImpl.class).resolveUser(
- sessionId, id);
+ return getSubInterface(UserSubInterfaceImpl.class).resolveUser(sessionId, id);
}
/**
* {@inheritDoc}
*/
- public FileChunk downloadFileChunk(SessionId sessionId,
- ProjectId projectId, FileTransferInformation fileInformation)
- throws EmfStoreException {
+ public FileChunk downloadFileChunk(SessionId sessionId, ProjectId projectId, FileTransferInformation fileInformation)
+ throws EmfStoreException {
sanityCheckObjects(sessionId, projectId, fileInformation);
checkReadAccess(sessionId, projectId, null);
- return getSubInterface(FileTransferSubInterfaceImpl.class).readChunk(
- projectId, fileInformation);
+ return getSubInterface(FileTransferSubInterfaceImpl.class).readChunk(projectId, fileInformation);
}
/**
* {@inheritDoc}
*/
- public FileTransferInformation uploadFileChunk(SessionId sessionId,
- ProjectId projectId, FileChunk fileChunk) throws EmfStoreException {
- sanityCheckObjects(sessionId, projectId, fileChunk,
- fileChunk.getFileInformation());
+ public FileTransferInformation uploadFileChunk(SessionId sessionId, ProjectId projectId, FileChunk fileChunk)
+ throws EmfStoreException {
+ sanityCheckObjects(sessionId, projectId, fileChunk, fileChunk.getFileInformation());
checkWriteAccess(sessionId, projectId, null);
- return getSubInterface(FileTransferSubInterfaceImpl.class).writeChunk(
- fileChunk, projectId);
+ return getSubInterface(FileTransferSubInterfaceImpl.class).writeChunk(fileChunk, projectId);
}
/**
* {@inheritDoc}
*/
- public void transmitProperty(SessionId sessionId,
- OrgUnitProperty changedProperty, ACUser user, ProjectId projectId)
- throws EmfStoreException {
+ public void transmitProperty(SessionId sessionId, OrgUnitProperty changedProperty, ACUser user, ProjectId projectId)
+ throws EmfStoreException {
sanityCheckObjects(projectId, user, changedProperty);
checkWriteAccess(sessionId, projectId, null);
- getSubInterface(ProjectPropertiesSubInterfaceImpl.class).setProperty(
- changedProperty, user, projectId);
+ getSubInterface(ProjectPropertiesSubInterfaceImpl.class).setProperty(changedProperty, user, projectId);
}
/**
* {@inheritDoc}
*/
- public List<EMFStoreProperty> getEMFProperties(SessionId sessionId,
- ProjectId projectId) throws EmfStoreException {
+ public List<EMFStoreProperty> getEMFProperties(SessionId sessionId, ProjectId projectId) throws EmfStoreException {
sanityCheckObjects(sessionId, projectId);
checkReadAccess(sessionId, projectId, null);
- return getSubInterface(EMFStorePropertiesSubInterfaceImpl.class)
- .getProperties(projectId);
+ return getSubInterface(EMFStorePropertiesSubInterfaceImpl.class).getProperties(projectId);
}
/**
* {@inheritDoc}
*/
- public void transmitEMFProperties(SessionId sessionId,
- List<EMFStoreProperty> properties, ProjectId projectId)
- throws EmfStoreException {
+ public void transmitEMFProperties(SessionId sessionId, List<EMFStoreProperty> properties, ProjectId projectId)
+ throws EmfStoreException {
sanityCheckObjects(projectId, properties);
checkWriteAccess(sessionId, projectId, null);
EMFStorePropertiesSubInterfaceImpl temp = getSubInterface(EMFStorePropertiesSubInterfaceImpl.class);
diff --git a/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/core/subinterfaces/VersionSubInterfaceImpl.java b/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/core/subinterfaces/VersionSubInterfaceImpl.java
index 9b4fa5f..b43b3b8 100644
--- a/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/core/subinterfaces/VersionSubInterfaceImpl.java
+++ b/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/core/subinterfaces/VersionSubInterfaceImpl.java
@@ -33,6 +33,7 @@
import org.eclipse.emf.emfstore.server.exceptions.StorageException;
import org.eclipse.emf.emfstore.server.model.ProjectHistory;
import org.eclipse.emf.emfstore.server.model.ProjectId;
+import org.eclipse.emf.emfstore.server.model.accesscontrol.ACUser;
import org.eclipse.emf.emfstore.server.model.versioning.ChangePackage;
import org.eclipse.emf.emfstore.server.model.versioning.DateVersionSpec;
import org.eclipse.emf.emfstore.server.model.versioning.HeadVersionSpec;
@@ -61,8 +62,7 @@
* @throws FatalEmfStoreException
* in case of failure
*/
- public VersionSubInterfaceImpl(AbstractEmfstoreInterface parentInterface)
- throws FatalEmfStoreException {
+ public VersionSubInterfaceImpl(AbstractEmfstoreInterface parentInterface) throws FatalEmfStoreException {
super(parentInterface);
}
@@ -91,22 +91,17 @@
* @throws EmfStoreException
* if versionSpec can't be resolved or other failure
*/
- public PrimaryVersionSpec resolveVersionSpec(ProjectId projectId,
- VersionSpec versionSpec) throws EmfStoreException {
+ public PrimaryVersionSpec resolveVersionSpec(ProjectId projectId, VersionSpec versionSpec) throws EmfStoreException {
synchronized (getMonitor()) {
- ProjectHistory projectHistory = getSubInterface(
- ProjectSubInterfaceImpl.class).getProject(projectId);
+ ProjectHistory projectHistory = getSubInterface(ProjectSubInterfaceImpl.class).getProject(projectId);
// PrimaryVersionSpec
- if (versionSpec instanceof PrimaryVersionSpec
- && 0 <= ((PrimaryVersionSpec) versionSpec).getIdentifier()
- && ((PrimaryVersionSpec) versionSpec).getIdentifier() < projectHistory
- .getVersions().size()) {
+ if (versionSpec instanceof PrimaryVersionSpec && 0 <= ((PrimaryVersionSpec) versionSpec).getIdentifier()
+ && ((PrimaryVersionSpec) versionSpec).getIdentifier() < projectHistory.getVersions().size()) {
return ((PrimaryVersionSpec) versionSpec);
// HeadVersionSpec
} else if (versionSpec instanceof HeadVersionSpec) {
- return EcoreUtil.copy(getSubInterface(
- ProjectSubInterfaceImpl.class).getProject(projectId)
- .getLastVersion().getPrimarySpec());
+ return EcoreUtil.copy(getSubInterface(ProjectSubInterfaceImpl.class).getProject(projectId)
+ .getLastVersion().getPrimarySpec());
// DateVersionSpec
} else if (versionSpec instanceof DateVersionSpec) {
for (Version version : projectHistory.getVersions()) {
@@ -114,12 +109,10 @@
if (logMessage == null || logMessage.getDate() == null) {
continue;
}
- if (((DateVersionSpec) versionSpec).getDate().before(
- logMessage.getDate())) {
+ if (((DateVersionSpec) versionSpec).getDate().before(logMessage.getDate())) {
Version previousVersion = version.getPreviousVersion();
if (previousVersion == null) {
- return VersioningFactory.eINSTANCE
- .createPrimaryVersionSpec();
+ return VersioningFactory.eINSTANCE.createPrimaryVersionSpec();
}
return previousVersion.getPrimarySpec();
}
@@ -143,16 +136,16 @@
/**
* {@inheritDoc}
+ *
+ * @param user
*/
- public PrimaryVersionSpec createVersion(ProjectId projectId,
- PrimaryVersionSpec baseVersionSpec, ChangePackage changePackage,
- LogMessage logMessage) throws EmfStoreException {
+ public PrimaryVersionSpec createVersion(ProjectId projectId, PrimaryVersionSpec baseVersionSpec,
+ ChangePackage changePackage, LogMessage logMessage, ACUser user) throws EmfStoreException {
synchronized (getMonitor()) {
long currentTimeMillis = System.currentTimeMillis();
- ProjectHistory projectHistory = getSubInterface(
- ProjectSubInterfaceImpl.class).getProject(projectId);
+ ProjectHistory projectHistory = getSubInterface(ProjectSubInterfaceImpl.class).getProject(projectId);
List<Version> versions = projectHistory.getVersions();
// OW: check here if base version is valid at all
@@ -161,21 +154,20 @@
throw new BaseVersionOutdatedException();
}
- PrimaryVersionSpec newVersionSpec = VersioningFactory.eINSTANCE
- .createPrimaryVersionSpec();
+ PrimaryVersionSpec newVersionSpec = VersioningFactory.eINSTANCE.createPrimaryVersionSpec();
newVersionSpec.setIdentifier(baseVersionSpec.getIdentifier() + 1);
Version newVersion = VersioningFactory.eINSTANCE.createVersion();
Version previousHeadVersion = versions.get(versions.size() - 1);
- Project newProjectState = ((ProjectImpl) previousHeadVersion
- .getProjectState()).copy();
+ Project newProjectState = ((ProjectImpl) previousHeadVersion.getProjectState()).copy();
changePackage.apply(newProjectState);
newVersion.setProjectState(newProjectState);
newVersion.setChanges(changePackage);
logMessage.setDate(new Date());
+ logMessage.setAuthor(user.getName());
newVersion.setLogMessage(logMessage);
newVersion.setPrimarySpec(newVersionSpec);
newVersion.setNextVersion(null);
@@ -186,19 +178,16 @@
// try to save
try {
try {
- getResourceHelper().createResourceForProject(
- newProjectState, newVersion.getPrimarySpec(),
- projectHistory.getProjectId());
- getResourceHelper().createResourceForChangePackage(
- changePackage, newVersion.getPrimarySpec(),
- projectId);
- getResourceHelper().createResourceForVersion(newVersion,
- projectHistory.getProjectId());
+ getResourceHelper().createResourceForProject(newProjectState, newVersion.getPrimarySpec(),
+ projectHistory.getProjectId());
+ getResourceHelper().createResourceForChangePackage(changePackage, newVersion.getPrimarySpec(),
+ projectId);
+ getResourceHelper().createResourceForVersion(newVersion, projectHistory.getProjectId());
} catch (FatalEmfStoreException e) {
// try to roll back
previousHeadVersion.setNextVersion(null);
versions.remove(newVersion);
- // OW: why do we need to save here, can we remove? do test!!
+ // TODO: OW: why do we need to save here, can we remove? do test!!
save(previousHeadVersion);
save(projectHistory);
throw new StorageException(StorageException.NOSAVE);
@@ -220,8 +209,7 @@
throw new EmfStoreException("Shutting down server.");
}
- ModelUtil.logInfo("Total time for commit: "
- + (System.currentTimeMillis() - currentTimeMillis));
+ ModelUtil.logInfo("Total time for commit: " + (System.currentTimeMillis() - currentTimeMillis));
return newVersionSpec;
}
}
@@ -229,15 +217,13 @@
/**
* {@inheritDoc}
*/
- public PrimaryVersionSpec createVersionForProject(ProjectId projectId,
- PrimaryVersionSpec baseVersionSpec, ChangePackage changePackage,
- LogMessage logMessage) throws EmfStoreException {
+ public PrimaryVersionSpec createVersionForProject(ProjectId projectId, PrimaryVersionSpec baseVersionSpec,
+ ChangePackage changePackage, LogMessage logMessage) throws EmfStoreException {
synchronized (getMonitor()) {
long currentTimeMillis = System.currentTimeMillis();
- ProjectHistory projectHistory = getSubInterface(
- ProjectSubInterfaceImpl.class).getProject(projectId);
+ ProjectHistory projectHistory = getSubInterface(ProjectSubInterfaceImpl.class).getProject(projectId);
List<Version> versions = projectHistory.getVersions();
// OW: check here if base version is valid at all
@@ -246,16 +232,14 @@
throw new BaseVersionOutdatedException();
}
- PrimaryVersionSpec newVersionSpec = VersioningFactory.eINSTANCE
- .createPrimaryVersionSpec();
+ PrimaryVersionSpec newVersionSpec = VersioningFactory.eINSTANCE.createPrimaryVersionSpec();
newVersionSpec.setIdentifier(baseVersionSpec.getIdentifier() + 1);
Version newVersion = VersioningFactory.eINSTANCE.createVersion();
Version previousHeadVersion = versions.get(versions.size() - 1);
- Project newProjectState = ModelUtil.clone(previousHeadVersion
- .getProjectState());
+ Project newProjectState = ModelUtil.clone(previousHeadVersion.getProjectState());
changePackage.apply(newProjectState);
@@ -272,14 +256,11 @@
// try to save
try {
try {
- getResourceHelper().createResourceForProject(
- newProjectState, newVersion.getPrimarySpec(),
- projectHistory.getProjectId());
- getResourceHelper().createResourceForChangePackage(
- changePackage, newVersion.getPrimarySpec(),
- projectId);
- getResourceHelper().createResourceForVersion(newVersion,
- projectHistory.getProjectId());
+ getResourceHelper().createResourceForProject(newProjectState, newVersion.getPrimarySpec(),
+ projectHistory.getProjectId());
+ getResourceHelper().createResourceForChangePackage(changePackage, newVersion.getPrimarySpec(),
+ projectId);
+ getResourceHelper().createResourceForVersion(newVersion, projectHistory.getProjectId());
} catch (FatalEmfStoreException e) {
// try to roll back
previousHeadVersion.setNextVersion(null);
@@ -306,8 +287,7 @@
throw new EmfStoreException("Shutting down server.");
}
- ModelUtil.logInfo("Total time for commit: "
- + (System.currentTimeMillis() - currentTimeMillis));
+ ModelUtil.logInfo("Total time for commit: " + (System.currentTimeMillis() - currentTimeMillis));
return newVersionSpec;
}
}
@@ -320,55 +300,44 @@
* @param previousHeadVersion
* last head version
*/
- private void handleOldProjectState(ProjectId projectId,
- Version previousHeadVersion) {
+ private void handleOldProjectState(ProjectId projectId, Version previousHeadVersion) {
String property = ServerConfiguration.getProperties().getProperty(
- ServerConfiguration.PROJECTSTATE_VERSION_PERSISTENCE,
- ServerConfiguration.PROJECTSPACE_VERSION_PERSISTENCE_DEFAULT);
+ ServerConfiguration.PROJECTSTATE_VERSION_PERSISTENCE,
+ ServerConfiguration.PROJECTSPACE_VERSION_PERSISTENCE_DEFAULT);
- if (property
- .equals(ServerConfiguration.PROJECTSTATE_VERSION_PERSISTENCE_EVERYXVERSIONS)) {
+ if (property.equals(ServerConfiguration.PROJECTSTATE_VERSION_PERSISTENCE_EVERYXVERSIONS)) {
- int x = getResourceHelper()
- .getXFromPolicy(
- ServerConfiguration.PROJECTSTATE_VERSION_PERSISTENCE_EVERYXVERSIONS_X,
- ServerConfiguration.PROJECTSTATE_VERSION_PERSISTENCE_EVERYXVERSIONS_X_DEFAULT,
- false);
+ int x = getResourceHelper().getXFromPolicy(
+ ServerConfiguration.PROJECTSTATE_VERSION_PERSISTENCE_EVERYXVERSIONS_X,
+ ServerConfiguration.PROJECTSTATE_VERSION_PERSISTENCE_EVERYXVERSIONS_X_DEFAULT, false);
// always save projecstate of first version
- int lastVersion = previousHeadVersion.getPrimarySpec()
- .getIdentifier();
+ int lastVersion = previousHeadVersion.getPrimarySpec().getIdentifier();
if (lastVersion != 0 && lastVersion % x != 0) {
previousHeadVersion.setProjectState(null);
- getResourceHelper().deleteProjectState(projectId,
- previousHeadVersion.getPrimarySpec().getIdentifier());
+ getResourceHelper().deleteProjectState(projectId, previousHeadVersion.getPrimarySpec().getIdentifier());
}
} else {
previousHeadVersion.setProjectState(null);
- getResourceHelper().deleteProjectState(projectId,
- previousHeadVersion.getPrimarySpec().getIdentifier());
+ getResourceHelper().deleteProjectState(projectId, previousHeadVersion.getPrimarySpec().getIdentifier());
}
}
/**
* {@inheritDoc}
*/
- public List<ChangePackage> getChanges(ProjectId projectId,
- VersionSpec source, VersionSpec target) throws EmfStoreException {
+ public List<ChangePackage> getChanges(ProjectId projectId, VersionSpec source, VersionSpec target)
+ throws EmfStoreException {
synchronized (getMonitor()) {
- PrimaryVersionSpec resolvedSource = resolveVersionSpec(projectId,
- source);
- PrimaryVersionSpec resolvedTarget = resolveVersionSpec(projectId,
- target);
+ PrimaryVersionSpec resolvedSource = resolveVersionSpec(projectId, source);
+ PrimaryVersionSpec resolvedTarget = resolveVersionSpec(projectId, target);
// if target and source are equal return empty list
- if (resolvedSource.getIdentifier() == resolvedTarget
- .getIdentifier()) {
+ if (resolvedSource.getIdentifier() == resolvedTarget.getIdentifier()) {
return new ArrayList<ChangePackage>();
}
- boolean updateForward = resolvedTarget.getIdentifier() > resolvedSource
- .getIdentifier();
+ boolean updateForward = resolvedTarget.getIdentifier() > resolvedSource.getIdentifier();
// Example: if you want the changes to get from version 5 to 7, you
// need the changes contained in version 6
@@ -379,16 +348,13 @@
// So the lower bound (source and target can be inverse too) has to
// be counted up by one.
if (resolvedSource.getIdentifier() < resolvedTarget.getIdentifier()) {
- resolvedSource
- .setIdentifier(resolvedSource.getIdentifier() + 1);
+ resolvedSource.setIdentifier(resolvedSource.getIdentifier() + 1);
} else {
- resolvedTarget
- .setIdentifier(resolvedTarget.getIdentifier() + 1);
+ resolvedTarget.setIdentifier(resolvedTarget.getIdentifier() + 1);
}
List<ChangePackage> result = new ArrayList<ChangePackage>();
- for (Version version : getVersions(projectId, resolvedSource,
- resolvedTarget)) {
+ for (Version version : getVersions(projectId, resolvedSource, resolvedTarget)) {
ChangePackage changes = version.getChanges();
changes.setLogMessage(EcoreUtil.copy(version.getLogMessage()));
result.add(changes);
@@ -399,13 +365,11 @@
// reverse list and change packages
List<ChangePackage> resultReverse = new ArrayList<ChangePackage>();
for (ChangePackage changePackage : result) {
- ChangePackage changePackageReverse = changePackage
- .reverse();
+ ChangePackage changePackageReverse = changePackage.reverse();
// copy again log message
// reverse() created a new change package without copying
// existent attributes
- changePackageReverse.setLogMessage(EcoreUtil
- .copy(changePackage.getLogMessage()));
+ changePackageReverse.setLogMessage(EcoreUtil.copy(changePackage.getLogMessage()));
resultReverse.add(changePackageReverse);
}
@@ -428,12 +392,9 @@
* @throws EmfStoreException
* if version couldn't be found
*/
- protected Version getVersion(ProjectId projectId,
- PrimaryVersionSpec versionSpec) throws EmfStoreException {
- EList<Version> versions = getSubInterface(ProjectSubInterfaceImpl.class)
- .getProject(projectId).getVersions();
- if (versionSpec.getIdentifier() < 0
- || versionSpec.getIdentifier() > versions.size() - 1) {
+ protected Version getVersion(ProjectId projectId, PrimaryVersionSpec versionSpec) throws EmfStoreException {
+ EList<Version> versions = getSubInterface(ProjectSubInterfaceImpl.class).getProject(projectId).getVersions();
+ if (versionSpec.getIdentifier() < 0 || versionSpec.getIdentifier() > versions.size() - 1) {
throw new InvalidVersionSpecException();
}
return versions.get(versionSpec.getIdentifier());
@@ -455,22 +416,17 @@
* if source or target are out of range or any other problem
* occurs
*/
- protected List<Version> getVersions(ProjectId projectId,
- PrimaryVersionSpec source, PrimaryVersionSpec target)
- throws EmfStoreException {
+ protected List<Version> getVersions(ProjectId projectId, PrimaryVersionSpec source, PrimaryVersionSpec target)
+ throws EmfStoreException {
if (source.compareTo(target) < 1) {
- EList<Version> versions = getSubInterface(
- ProjectSubInterfaceImpl.class).getProject(projectId)
- .getVersions();
- if (source.getIdentifier() < 0
- || source.getIdentifier() > versions.size() - 1
- || target.getIdentifier() < 0
- || target.getIdentifier() > versions.size() - 1) {
+ EList<Version> versions = getSubInterface(ProjectSubInterfaceImpl.class).getProject(projectId)
+ .getVersions();
+ if (source.getIdentifier() < 0 || source.getIdentifier() > versions.size() - 1
+ || target.getIdentifier() < 0 || target.getIdentifier() > versions.size() - 1) {
throw new InvalidVersionSpecException();
}
List<Version> result = new ArrayList<Version>();
- Iterator<Version> iter = versions.listIterator(source
- .getIdentifier());
+ Iterator<Version> iter = versions.listIterator(source.getIdentifier());
int steps = target.getIdentifier() - source.getIdentifier();
while (iter.hasNext() && steps-- >= 0) {
result.add(iter.next());