Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.common')
-rw-r--r--plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.core.resources.prefs6
-rw-r--r--plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.jdt.launching.prefs6
-rw-r--r--plugins/org.eclipse.emf.cdo.common/copyright.txt14
-rw-r--r--plugins/org.eclipse.emf.cdo.common/plugin.properties22
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonSession.java374
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonTransaction.java48
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonView.java198
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranch.java370
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchCreatedEvent.java58
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchHandler.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchManager.java158
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.java118
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchPointRange.java88
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchTag.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchVersion.java106
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/package-info.java40
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeKind.java46
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeKindProvider.java50
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSet.java56
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSetData.java156
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSetDataProvider.java46
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitData.java58
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfo.java74
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoHandler.java48
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoManager.java78
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/BinaryCommitInfoLog.java118
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/TextCommitInfoLog.java130
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java324
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDExternal.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDGenerator.java144
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDObject.java50
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDProvider.java66
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java216
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDTemp.java52
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOReference.java86
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOWithID.java46
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOBlob.java120
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOClob.java120
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLob.java138
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobHandler.java82
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobInfo.java118
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobStore.java156
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobUtil.java118
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockChangeInfo.java158
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockChangeInfoHandler.java46
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockOwner.java74
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockState.java122
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockUtil.java326
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/IDurableLockingManager.java604
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/package-info.java36
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassInfo.java84
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassifierRef.java318
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelConstants.java138
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageInfo.java184
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageRegistry.java162
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageTypeRegistry.java454
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageUnit.java416
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java1026
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/package-info.java36
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/package-info.java42
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOAuthenticator.java90
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocol.java56
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java674
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOAllRevisionsProvider.java56
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOElementProxy.java50
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOIDAndBranch.java60
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOList.java82
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOListFactory.java56
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOListResolver.java74
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisable.java56
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionCache.java166
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionCacheAdder.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionData.java224
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionFactory.java76
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionHandler.java164
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionKey.java52
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionManager.java342
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionProvider.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java1194
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOAddFeatureDelta.java58
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOClearFeatureDelta.java52
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOContainerFeatureDelta.java92
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDeltaVisitor.java76
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOListFeatureDelta.java62
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOMoveFeatureDelta.java68
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORemoveFeatureDelta.java64
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDelta.java176
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDeltaProvider.java50
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOSetFeatureDelta.java78
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOUnsetFeatureDelta.java52
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/package-info.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/BlockingCloseableIterator.java58
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonEventAdapter.java170
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java348
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOException.java80
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOFetchRule.java176
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryInfo.java150
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryQueue.java830
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOTimeProvider.java44
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/PartialCollectionLoadingNotSupportedException.java90
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryStateChangedEvent.java104
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryTypeChangedEvent.java102
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/TransportException.java82
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/package-info.java36
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOQueryInfoImpl.java320
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchImpl.java684
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchManagerImpl.java502
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchPointImpl.java170
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchPointRangeImpl.java96
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchVersionImpl.java146
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/bundle/OM.java116
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOChangeSetDataImpl.java450
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOChangeSetImpl.java96
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitDataImpl.java94
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoImpl.java306
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/CDOCommitInfoManagerImpl.java174
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/DelegatingCommitInfo.java222
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/commit/FailureCommitInfo.java232
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDExternalImpl.java262
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDNullImpl.java250
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectLongImpl.java166
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectLongWithClassifierImpl.java290
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectStringImpl.java162
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectStringWithClassifierImpl.java276
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDObjectUUIDImpl.java208
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempObjectExternalImpl.java66
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDTempObjectImpl.java140
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/lock/CDOLockAreaImpl.java212
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/lock/CDOLockChangeInfoImpl.java186
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/lock/CDOLockOwnerImpl.java182
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/lock/CDOLockStateImpl.java382
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/messages/Messages.java82
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/messages/messages.properties78
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java252
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageInfoImpl.java320
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageRegistryImpl.java1326
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOPackageUnitImpl.java786
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/GenUtil.java426
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOElementProxyImpl.java90
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOFeatureMapEntryImpl.java126
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOIDAndBranchImpl.java156
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOIDAndVersionImpl.java150
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOListImpl.java374
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOListWithElementProxiesImpl.java182
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisableImpl.java180
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionCacheAuditing.java886
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionCacheBranching.java262
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionCacheNonAuditing.java434
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionKeyImpl.java132
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionManagerImpl.java1078
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/EvictionEventImpl.java134
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/NOOPRevisionCache.java202
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOAddFeatureDeltaImpl.java158
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOClearFeatureDeltaImpl.java146
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOContainerFeatureDeltaImpl.java346
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDODetachedRevisionDeltaImpl.java178
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOFeatureDeltaImpl.java180
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java928
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOMoveFeatureDeltaImpl.java414
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORemoveFeatureDeltaImpl.java198
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSetFeatureDeltaImpl.java194
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java370
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOUnsetFeatureDeltaImpl.java146
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/AbstractQueryResult.java208
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOAuthenticationResult.java120
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOLobStoreImpl.java394
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDORawReplicationContext.java58
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOReplicationContext.java50
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/CDOReplicationInfo.java58
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/CDOBranchUtil.java248
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranch.java92
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.java380
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/CDOChangeKindCache.java130
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/CDOChangeSetDataRevisionProvider.java320
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/CDOChangeSetSegment.java174
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/CDOCommitInfoUtil.java204
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/CDORevisionAvailabilityInfo.java146
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/InternalCDOCommitInfoManager.java96
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/commit/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java136
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOIDByteArray.java190
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOIDInteger.java218
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOIDLong.java206
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOIDString.java202
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/InternalCDOIDObject.java48
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/lock/InternalCDOLockState.java62
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/lock/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/model/DelegatingCDOPackageRegistry.java348
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/model/InternalCDOPackageInfo.java92
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/model/InternalCDOPackageRegistry.java210
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/model/InternalCDOPackageUnit.java144
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/model/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/package-info.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOFeatureDeltaVisitorImpl.java196
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOFeatureMapEntry.java50
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOIDMapper.java126
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOReferenceAdjustable.java42
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOReferenceAdjuster.java68
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDORevisionMerger.java172
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevisionManager.java386
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DetachedCDORevision.java138
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDOFeatureDelta.java114
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDOList.java98
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionCache.java74
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionDelta.java102
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevisionManager.java214
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/ManagedRevisionProvider.java98
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/PointerCDORevision.java138
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/SyntheticCDORevision.java140
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/package-info.java30
218 files changed, 19895 insertions, 19895 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.core.resources.prefs
index eb3a08bb14..fadb7e4e05 100644
--- a/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.core.resources.prefs
+++ b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.core.resources.prefs
@@ -1,3 +1,3 @@
-#Mon Jul 04 13:00:51 CEST 2011
-eclipse.preferences.version=1
-encoding//model/org.eclipse.emf.cdo.defs.ecorediag=UTF-8
+#Mon Jul 04 13:00:51 CEST 2011
+eclipse.preferences.version=1
+encoding//model/org.eclipse.emf.cdo.defs.ecorediag=UTF-8
diff --git a/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.jdt.launching.prefs b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.jdt.launching.prefs
index 4658ec1435..556ed07a3c 100644
--- a/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.jdt.launching.prefs
+++ b/plugins/org.eclipse.emf.cdo.common/.settings/org.eclipse.jdt.launching.prefs
@@ -1,3 +1,3 @@
-#Fri Sep 02 05:38:34 CEST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=ignore
+#Fri Sep 02 05:38:34 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=ignore
diff --git a/plugins/org.eclipse.emf.cdo.common/copyright.txt b/plugins/org.eclipse.emf.cdo.common/copyright.txt
index 8f6328980e..0a0f67e6d7 100644
--- a/plugins/org.eclipse.emf.cdo.common/copyright.txt
+++ b/plugins/org.eclipse.emf.cdo.common/copyright.txt
@@ -1,8 +1,8 @@
-Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html
-
-Contributors:
+Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
Eike Stepper - initial API and implementation \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.common/plugin.properties b/plugins/org.eclipse.emf.cdo.common/plugin.properties
index d88708b2b0..51f430cc4b 100644
--- a/plugins/org.eclipse.emf.cdo.common/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.common/plugin.properties
@@ -1,11 +1,11 @@
-# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Eike Stepper - initial API and implementation
-
-pluginName = CDO Model Repository Common
-providerName = Eclipse Modeling Project
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+pluginName = CDO Model Repository Common
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonSession.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonSession.java
index c5a68c63c8..5a76dadf5e 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonSession.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonSession.java
@@ -1,187 +1,187 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common;
-
-import org.eclipse.net4j.util.collection.Closeable;
-import org.eclipse.net4j.util.options.IOptions;
-import org.eclipse.net4j.util.options.IOptionsContainer;
-import org.eclipse.net4j.util.options.IOptionsEvent;
-import org.eclipse.net4j.util.security.IUserAware;
-
-/**
- * Abstracts the information about CDO sessions that is common to both client and server side.
- *
- * @author Eike Stepper
- * @since 2.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.composedOf {@link CDOCommonView} - - views
- * @apiviz.has {@link CDOCommonSession.Options}
- * @apiviz.uses {@link CDOCommonRepository} - - connectsTo
- */
-public interface CDOCommonSession extends IUserAware, IOptionsContainer, Closeable
-{
- public int getSessionID();
-
- public CDOCommonView[] getViews();
-
- public CDOCommonView getView(int viewID);
-
- /**
- * Returns the {@link Options options} of this session.
- */
- public Options options();
-
- /**
- * Encapsulates the configuration options of CDO sessions that are common to both client and server side.
- *
- * @author Simon McDuff
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.has CDOCommonSession.Options.PassiveUpdateMode
- * @apiviz.has CDOCommonSession.Options.LockNotificationMode
- */
- public interface Options extends IOptions
- {
- /**
- * Returns the {@link CDOCommonSession session} of this options object.
- *
- * @since 4.0
- */
- public CDOCommonSession getContainer();
-
- public boolean isPassiveUpdateEnabled();
-
- /**
- * Specifies whether objects will be invalidated due by other users changes.
- * <p>
- * Example:
- * <p>
- * <code>session.setPassiveUpdateEnabled(false);</code>
- * <p>
- * By default this property is enabled. If this property is disabled the latest versions of objects can still be
- * obtained by calling refresh().
- * <p>
- * Passive update can be disabled in cases where more performance is needed and/or more control over when objects
- * will be refreshed.
- * <p>
- * When enabled again, a refresh will be automatically performed to be in sync with the server.
- *
- * @since 3.0
- */
- public void setPassiveUpdateEnabled(boolean enabled);
-
- /**
- * @since 3.0
- */
- public PassiveUpdateMode getPassiveUpdateMode();
-
- /**
- * @since 3.0
- */
- public void setPassiveUpdateMode(PassiveUpdateMode mode);
-
- /**
- * @since 4.1
- */
- public LockNotificationMode getLockNotificationMode();
-
- /**
- * @since 4.1
- */
- public void setLockNotificationMode(LockNotificationMode mode);
-
- /**
- * Enumerates the possible {@link CDOCommonSession.Options#getPassiveUpdateMode() passive update modes} of a CDO
- * session.
- *
- * @author Eike Stepper
- * @since 3.0
- */
- public enum PassiveUpdateMode
- {
- /**
- * This mode delivers change deltas only for change subscriptions, invalidation information for all other objects.
- */
- INVALIDATIONS,
-
- /**
- * This mode delivers change deltas for all changed objects, whether they have change subscriptions or not.
- * Revisions for new objects are not delivered.
- */
- CHANGES,
-
- /**
- * This mode delivers change deltas for all changed objects, whether they have change subscriptions or not. In
- * addition full revisions for new objects are delivered.
- */
- ADDITIONS
- }
-
- /**
- * Enumerates the possible {@link CDOCommonSession.Options#getLockNotificationMode() lock notification modes} of a
- * CDO session.
- *
- * @since 4.1
- */
- public enum LockNotificationMode
- {
- /**
- * This mode delivers no lock notifications
- */
- OFF,
-
- /**
- * This mode delivers lock notifications if one or more views have enabled them.
- */
- IF_REQUIRED_BY_VIEWS,
-
- /**
- * This mode always delivers lock notifications, even if no views have them enabled, and even if no views are
- * open.
- */
- ALWAYS
- }
-
- /**
- * An {@link IOptionsEvent options event} fired when the {@link PassiveUpdateMode passive update mode} of a CDO
- * session has changed.
- *
- * @author Eike Stepper
- * @since 3.0
- */
- public interface PassiveUpdateEvent extends IOptionsEvent
- {
- public boolean getOldEnabled();
-
- public boolean getNewEnabled();
-
- public PassiveUpdateMode getOldMode();
-
- public PassiveUpdateMode getNewMode();
- }
-
- /**
- * An {@link IOptionsEvent options event} fired when the {@link LockNotificationMode lock notification mode} of a
- * CDO session has changed.
- *
- * @author Caspar De Groot
- * @since 4.1
- */
- public interface LockNotificationModeEvent extends IOptionsEvent
- {
- public LockNotificationMode getOldMode();
-
- public LockNotificationMode getNewMode();
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common;
+
+import org.eclipse.net4j.util.collection.Closeable;
+import org.eclipse.net4j.util.options.IOptions;
+import org.eclipse.net4j.util.options.IOptionsContainer;
+import org.eclipse.net4j.util.options.IOptionsEvent;
+import org.eclipse.net4j.util.security.IUserAware;
+
+/**
+ * Abstracts the information about CDO sessions that is common to both client and server side.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.composedOf {@link CDOCommonView} - - views
+ * @apiviz.has {@link CDOCommonSession.Options}
+ * @apiviz.uses {@link CDOCommonRepository} - - connectsTo
+ */
+public interface CDOCommonSession extends IUserAware, IOptionsContainer, Closeable
+{
+ public int getSessionID();
+
+ public CDOCommonView[] getViews();
+
+ public CDOCommonView getView(int viewID);
+
+ /**
+ * Returns the {@link Options options} of this session.
+ */
+ public Options options();
+
+ /**
+ * Encapsulates the configuration options of CDO sessions that are common to both client and server side.
+ *
+ * @author Simon McDuff
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.has CDOCommonSession.Options.PassiveUpdateMode
+ * @apiviz.has CDOCommonSession.Options.LockNotificationMode
+ */
+ public interface Options extends IOptions
+ {
+ /**
+ * Returns the {@link CDOCommonSession session} of this options object.
+ *
+ * @since 4.0
+ */
+ public CDOCommonSession getContainer();
+
+ public boolean isPassiveUpdateEnabled();
+
+ /**
+ * Specifies whether objects will be invalidated due by other users changes.
+ * <p>
+ * Example:
+ * <p>
+ * <code>session.setPassiveUpdateEnabled(false);</code>
+ * <p>
+ * By default this property is enabled. If this property is disabled the latest versions of objects can still be
+ * obtained by calling refresh().
+ * <p>
+ * Passive update can be disabled in cases where more performance is needed and/or more control over when objects
+ * will be refreshed.
+ * <p>
+ * When enabled again, a refresh will be automatically performed to be in sync with the server.
+ *
+ * @since 3.0
+ */
+ public void setPassiveUpdateEnabled(boolean enabled);
+
+ /**
+ * @since 3.0
+ */
+ public PassiveUpdateMode getPassiveUpdateMode();
+
+ /**
+ * @since 3.0
+ */
+ public void setPassiveUpdateMode(PassiveUpdateMode mode);
+
+ /**
+ * @since 4.1
+ */
+ public LockNotificationMode getLockNotificationMode();
+
+ /**
+ * @since 4.1
+ */
+ public void setLockNotificationMode(LockNotificationMode mode);
+
+ /**
+ * Enumerates the possible {@link CDOCommonSession.Options#getPassiveUpdateMode() passive update modes} of a CDO
+ * session.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ */
+ public enum PassiveUpdateMode
+ {
+ /**
+ * This mode delivers change deltas only for change subscriptions, invalidation information for all other objects.
+ */
+ INVALIDATIONS,
+
+ /**
+ * This mode delivers change deltas for all changed objects, whether they have change subscriptions or not.
+ * Revisions for new objects are not delivered.
+ */
+ CHANGES,
+
+ /**
+ * This mode delivers change deltas for all changed objects, whether they have change subscriptions or not. In
+ * addition full revisions for new objects are delivered.
+ */
+ ADDITIONS
+ }
+
+ /**
+ * Enumerates the possible {@link CDOCommonSession.Options#getLockNotificationMode() lock notification modes} of a
+ * CDO session.
+ *
+ * @since 4.1
+ */
+ public enum LockNotificationMode
+ {
+ /**
+ * This mode delivers no lock notifications
+ */
+ OFF,
+
+ /**
+ * This mode delivers lock notifications if one or more views have enabled them.
+ */
+ IF_REQUIRED_BY_VIEWS,
+
+ /**
+ * This mode always delivers lock notifications, even if no views have them enabled, and even if no views are
+ * open.
+ */
+ ALWAYS
+ }
+
+ /**
+ * An {@link IOptionsEvent options event} fired when the {@link PassiveUpdateMode passive update mode} of a CDO
+ * session has changed.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ */
+ public interface PassiveUpdateEvent extends IOptionsEvent
+ {
+ public boolean getOldEnabled();
+
+ public boolean getNewEnabled();
+
+ public PassiveUpdateMode getOldMode();
+
+ public PassiveUpdateMode getNewMode();
+ }
+
+ /**
+ * An {@link IOptionsEvent options event} fired when the {@link LockNotificationMode lock notification mode} of a
+ * CDO session has changed.
+ *
+ * @author Caspar De Groot
+ * @since 4.1
+ */
+ public interface LockNotificationModeEvent extends IOptionsEvent
+ {
+ public LockNotificationMode getOldMode();
+
+ public LockNotificationMode getNewMode();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonTransaction.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonTransaction.java
index ab4a051ff6..5444f45bfe 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonTransaction.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonTransaction.java
@@ -1,24 +1,24 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common;
-
-/**
- * Abstracts the information about CDO transactions that is common to both client and server side.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- */
-public interface CDOCommonTransaction extends CDOCommonView
-{
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common;
+
+/**
+ * Abstracts the information about CDO transactions that is common to both client and server side.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ */
+public interface CDOCommonTransaction extends CDOCommonView
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonView.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonView.java
index 1b499450f0..df15ee87a6 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonView.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonView.java
@@ -1,99 +1,99 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.lock.CDOLockOwner;
-import org.eclipse.emf.cdo.common.lock.CDOLockState;
-import org.eclipse.emf.cdo.common.revision.CDORevisionProvider;
-
-import org.eclipse.net4j.util.collection.Closeable;
-import org.eclipse.net4j.util.event.IListener;
-import org.eclipse.net4j.util.options.IOptions;
-import org.eclipse.net4j.util.options.IOptionsContainer;
-import org.eclipse.net4j.util.options.IOptionsEvent;
-
-/**
- * Abstracts the information about CDO views that is common to both client and server side.
- *
- * @author Eike Stepper
- * @since 2.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.has {@link CDOCommonView.Options}
- */
-public interface CDOCommonView extends CDOLockOwner, CDOBranchPoint, CDORevisionProvider, IOptionsContainer, Closeable
-{
- public int getViewID();
-
- /**
- * @since 3.0
- */
- public boolean isReadOnly();
-
- public CDOCommonSession getSession();
-
- /**
- * @since 4.0
- */
- public String getDurableLockingID();
-
- /**
- * Returns the {@link Options options} of this view.
- *
- * @since 4.1
- */
- public Options options();
-
- /**
- * Encapsulates the configuration options of CDO views that are common to both client and server side.
- *
- * @author Eike Stepper
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @since 4.1
- * @apiviz.uses {@link CDOCommonView.Options.LockNotificationEvent} - - fires
- */
- public interface Options extends IOptions
- {
- /**
- * Returns <code>true</code> if this view will notify its {@link IListener listeners} about changes to the
- * {@link CDOLockState lock states} of the objects in this view (due to lock operations in <i>other</i> views),
- * <code>false</code> otherwise.
- *
- * @see CDOLockState
- */
- public boolean isLockNotificationEnabled();
-
- /**
- * Specifies whether this view will notify its {@link IListener listeners} about changes to the {@link CDOLockState
- * lock states} of the objects in this view (due to lock operations in <i>other</i> views), or not.
- *
- * @see CDOLockState
- */
- public void setLockNotificationEnabled(boolean enabled);
-
- /**
- * An {@link IOptionsEvent options event} fired from common view {@link CDOCommonView#options() options} when the
- * {@link Options#setLockNotificationEnabled(boolean) lock notification enabled} option has changed.
- *
- * @author Caspar De Groot
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @since 4.1
- */
- public interface LockNotificationEvent extends IOptionsEvent
- {
- boolean getEnabled();
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.lock.CDOLockOwner;
+import org.eclipse.emf.cdo.common.lock.CDOLockState;
+import org.eclipse.emf.cdo.common.revision.CDORevisionProvider;
+
+import org.eclipse.net4j.util.collection.Closeable;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.options.IOptions;
+import org.eclipse.net4j.util.options.IOptionsContainer;
+import org.eclipse.net4j.util.options.IOptionsEvent;
+
+/**
+ * Abstracts the information about CDO views that is common to both client and server side.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.has {@link CDOCommonView.Options}
+ */
+public interface CDOCommonView extends CDOLockOwner, CDOBranchPoint, CDORevisionProvider, IOptionsContainer, Closeable
+{
+ public int getViewID();
+
+ /**
+ * @since 3.0
+ */
+ public boolean isReadOnly();
+
+ public CDOCommonSession getSession();
+
+ /**
+ * @since 4.0
+ */
+ public String getDurableLockingID();
+
+ /**
+ * Returns the {@link Options options} of this view.
+ *
+ * @since 4.1
+ */
+ public Options options();
+
+ /**
+ * Encapsulates the configuration options of CDO views that are common to both client and server side.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @since 4.1
+ * @apiviz.uses {@link CDOCommonView.Options.LockNotificationEvent} - - fires
+ */
+ public interface Options extends IOptions
+ {
+ /**
+ * Returns <code>true</code> if this view will notify its {@link IListener listeners} about changes to the
+ * {@link CDOLockState lock states} of the objects in this view (due to lock operations in <i>other</i> views),
+ * <code>false</code> otherwise.
+ *
+ * @see CDOLockState
+ */
+ public boolean isLockNotificationEnabled();
+
+ /**
+ * Specifies whether this view will notify its {@link IListener listeners} about changes to the {@link CDOLockState
+ * lock states} of the objects in this view (due to lock operations in <i>other</i> views), or not.
+ *
+ * @see CDOLockState
+ */
+ public void setLockNotificationEnabled(boolean enabled);
+
+ /**
+ * An {@link IOptionsEvent options event} fired from common view {@link CDOCommonView#options() options} when the
+ * {@link Options#setLockNotificationEnabled(boolean) lock notification enabled} option has changed.
+ *
+ * @author Caspar De Groot
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @since 4.1
+ */
+ public interface LockNotificationEvent extends IOptionsEvent
+ {
+ boolean getEnabled();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranch.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranch.java
index afe328c786..5637fd6382 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranch.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranch.java
@@ -1,185 +1,185 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.branch;
-
-import org.eclipse.emf.cdo.common.CDOCommonRepository;
-import org.eclipse.emf.cdo.common.CDOCommonRepository.State;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
-import org.eclipse.emf.cdo.common.util.CDOTimeProvider;
-
-import org.eclipse.net4j.util.container.IContainer;
-
-/**
- * Represents a <i>stream of changes</i> that is isolated from other streams of changes.
- * <p>
- * A branch starts at a fixed {@link #getBase() base} point and ends at a floating {@link #getHead() head} point.
- * Between these two points there can be a number of other {@link CDOBranchPoint branch points}:
- * <ul>
- * <li> {@link CDOCommitInfo Commit infos} are points in a branch that represent commit operations.
- * <li> {@link CDOBranchTag Branch tags} are named points in a branch.
- * <li> {@link #getBase() Base points } of sub branches of a branch.
- * </ul>
- *
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.has {@link CDOBranchPoint} oneway - - base
- * @apiviz.composedOf {@link CDOBranch} - - subBranches
- */
-public interface CDOBranch extends IContainer<CDOBranch>, Comparable<CDOBranch>
-{
- /**
- * The fixed ID of the {@link CDOBranchManager#getMainBranch() main branch}.
- */
- public static final int MAIN_BRANCH_ID = 0;
-
- /**
- * The fixed name of the {@link CDOBranchManager#getMainBranch() main branch}.
- */
- public static final String MAIN_BRANCH_NAME = "MAIN"; //$NON-NLS-1$
-
- /**
- * The string used to separate the segments of branch paths.
- *
- * @see #getPathName()
- * @see #getBranch(String)
- * @see CDOBranchManager#getBranch(String)
- */
- public static final String PATH_SEPARATOR = "/"; //$NON-NLS-1$
-
- /**
- * Returns <code>true</code> if this branch is the {@link CDOBranchManager#getMainBranch() main branch},
- * <code>false</code> otherwise.
- */
- public boolean isMainBranch();
-
- /**
- * Returns <code>true</code> if this branch is a local branch, <code>false</code> otherwise.
- * <p>
- * Local branches are created on the fly when committing to a
- * {@link org.eclipse.emf.cdo.common.CDOCommonRepository.Type#CLONE clone} repository while it is in
- * {@link State#OFFLINE offline} state and they do not participate in repository replication. They can not be created
- * manually and they have negative {@link #getID() IDs}.
- */
- public boolean isLocal();
-
- /**
- * Returns the ID of this branch.
- * <p>
- * The {@link CDOBranchManager#getMainBranch() main branch} has the fixed ID 0 (zero), {@link #isLocal() Local
- * branches} have negative IDs and normal branches have positive IDs.
- */
- public int getID();
-
- /**
- * Returns the name of this branch as specified when it was created with {@link #createBranch(String, long)
- * createBranch()} or {@link #MAIN_BRANCH_NAME} if this branch is the {@link CDOBranchManager#getMainBranch() main
- * branch}.
- */
- public String getName();
-
- /**
- * Returns the fully qualified path name of this branch, a concatenation of the names of all branches from the
- * {@link CDOBranchManager#getMainBranch() main branch} to this branch, separated by {@link #PATH_SEPARATOR slashes}
- * ("/" characters). Example: "MAIN/team1/smith".
- */
- public String getPathName();
-
- /**
- * Returns an array of the {@link #getBase() base} branch points starting from the base of the
- * {@link CDOBranchManager#getMainBranch() main branch} down to and including the base of this branch.
- */
- public CDOBranchPoint[] getBasePath();
-
- /**
- * Returns the immutable base branch point of this branch, the point in the parent branch that marks the creation of
- * this branch.
- * <p>
- * The base of the {@link CDOBranchManager#getMainBranch() main branch} marks the creation of the
- * {@link CDOCommonRepository repository}.
- *
- * @see CDOBranch#getHead()
- * @see #getPoint(long)
- */
- public CDOBranchPoint getBase();
-
- /**
- * Returns the floating <i>end point</i> of this branch, a pair of this branch and the fixed special time stamp <i>
- * {@link CDOBranchPoint#UNSPECIFIED_DATE unspecified}</i>.
- *
- * @see CDOBranch#getBase()
- * @see #getPoint(long)
- */
- public CDOBranchPoint getHead();
-
- /**
- * Returns the branch point in this branch with the given time stamp.
- * <p>
- * This factory method never returns <code>null</code>.
- *
- * @see CDOBranch#getBase()
- * @see CDOBranch#getHead()
- * @see #getVersion(int)
- */
- public CDOBranchPoint getPoint(long timeStamp);
-
- /**
- * Returns the branch version in this branch with the given version number.
- * <p>
- * This factory method never returns <code>null</code>.
- *
- * @see #getPoint(long)
- */
- public CDOBranchVersion getVersion(int version);
-
- /**
- * Returns the branch manager that manages this branch, never <code>null</code>.
- */
- public CDOBranchManager getBranchManager();
-
- /**
- * Returns an array of the sub branches of this branch, never <code>null</code>.
- */
- public CDOBranch[] getBranches();
-
- /**
- * Returns the sub branch of this branch with the given relative path, or <code>null</code> if no sub branch with this
- * path exists in this branch.
- * <p>
- * The path name is the concatenation of the names of all branches from a direct sub branch of this branch, separated
- * by {@link #PATH_SEPARATOR slashes} ("/" characters). Example: "team1/smith".
- */
- public CDOBranch getBranch(String path);
-
- /**
- * Creates a sub branch of this branch with the given name, {@link #getBase() based} at the {@link CDOBranchPoint
- * branch point} in this branch with the given time stamp.
- * <p>
- *
- * @param name
- * The name of the sub branch to be created. It must not contain the {@link #PATH_SEPARATOR path separator}
- * character (slash).
- * @param timeStamp
- * The time stamp in this branch that the sub branch to be created is supposed to be {@link #getBase() based
- * at}. It must not be before the base time stamp of this branch and it must be different from the fixed
- * special time stamp <i> {@link CDOBranchPoint#UNSPECIFIED_DATE unspecified}</i>
- * @see #createBranch(String)
- */
- public CDOBranch createBranch(String name, long timeStamp);
-
- /**
- * Creates a sub branch of this branch with the given name, {@link #getBase() based} at the {@link CDOTimeProvider
- * current time}.
- */
- public CDOBranch createBranch(String name);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.branch;
+
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.CDOCommonRepository.State;
+import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
+import org.eclipse.emf.cdo.common.util.CDOTimeProvider;
+
+import org.eclipse.net4j.util.container.IContainer;
+
+/**
+ * Represents a <i>stream of changes</i> that is isolated from other streams of changes.
+ * <p>
+ * A branch starts at a fixed {@link #getBase() base} point and ends at a floating {@link #getHead() head} point.
+ * Between these two points there can be a number of other {@link CDOBranchPoint branch points}:
+ * <ul>
+ * <li> {@link CDOCommitInfo Commit infos} are points in a branch that represent commit operations.
+ * <li> {@link CDOBranchTag Branch tags} are named points in a branch.
+ * <li> {@link #getBase() Base points } of sub branches of a branch.
+ * </ul>
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.has {@link CDOBranchPoint} oneway - - base
+ * @apiviz.composedOf {@link CDOBranch} - - subBranches
+ */
+public interface CDOBranch extends IContainer<CDOBranch>, Comparable<CDOBranch>
+{
+ /**
+ * The fixed ID of the {@link CDOBranchManager#getMainBranch() main branch}.
+ */
+ public static final int MAIN_BRANCH_ID = 0;
+
+ /**
+ * The fixed name of the {@link CDOBranchManager#getMainBranch() main branch}.
+ */
+ public static final String MAIN_BRANCH_NAME = "MAIN"; //$NON-NLS-1$
+
+ /**
+ * The string used to separate the segments of branch paths.
+ *
+ * @see #getPathName()
+ * @see #getBranch(String)
+ * @see CDOBranchManager#getBranch(String)
+ */
+ public static final String PATH_SEPARATOR = "/"; //$NON-NLS-1$
+
+ /**
+ * Returns <code>true</code> if this branch is the {@link CDOBranchManager#getMainBranch() main branch},
+ * <code>false</code> otherwise.
+ */
+ public boolean isMainBranch();
+
+ /**
+ * Returns <code>true</code> if this branch is a local branch, <code>false</code> otherwise.
+ * <p>
+ * Local branches are created on the fly when committing to a
+ * {@link org.eclipse.emf.cdo.common.CDOCommonRepository.Type#CLONE clone} repository while it is in
+ * {@link State#OFFLINE offline} state and they do not participate in repository replication. They can not be created
+ * manually and they have negative {@link #getID() IDs}.
+ */
+ public boolean isLocal();
+
+ /**
+ * Returns the ID of this branch.
+ * <p>
+ * The {@link CDOBranchManager#getMainBranch() main branch} has the fixed ID 0 (zero), {@link #isLocal() Local
+ * branches} have negative IDs and normal branches have positive IDs.
+ */
+ public int getID();
+
+ /**
+ * Returns the name of this branch as specified when it was created with {@link #createBranch(String, long)
+ * createBranch()} or {@link #MAIN_BRANCH_NAME} if this branch is the {@link CDOBranchManager#getMainBranch() main
+ * branch}.
+ */
+ public String getName();
+
+ /**
+ * Returns the fully qualified path name of this branch, a concatenation of the names of all branches from the
+ * {@link CDOBranchManager#getMainBranch() main branch} to this branch, separated by {@link #PATH_SEPARATOR slashes}
+ * ("/" characters). Example: "MAIN/team1/smith".
+ */
+ public String getPathName();
+
+ /**
+ * Returns an array of the {@link #getBase() base} branch points starting from the base of the
+ * {@link CDOBranchManager#getMainBranch() main branch} down to and including the base of this branch.
+ */
+ public CDOBranchPoint[] getBasePath();
+
+ /**
+ * Returns the immutable base branch point of this branch, the point in the parent branch that marks the creation of
+ * this branch.
+ * <p>
+ * The base of the {@link CDOBranchManager#getMainBranch() main branch} marks the creation of the
+ * {@link CDOCommonRepository repository}.
+ *
+ * @see CDOBranch#getHead()
+ * @see #getPoint(long)
+ */
+ public CDOBranchPoint getBase();
+
+ /**
+ * Returns the floating <i>end point</i> of this branch, a pair of this branch and the fixed special time stamp <i>
+ * {@link CDOBranchPoint#UNSPECIFIED_DATE unspecified}</i>.
+ *
+ * @see CDOBranch#getBase()
+ * @see #getPoint(long)
+ */
+ public CDOBranchPoint getHead();
+
+ /**
+ * Returns the branch point in this branch with the given time stamp.
+ * <p>
+ * This factory method never returns <code>null</code>.
+ *
+ * @see CDOBranch#getBase()
+ * @see CDOBranch#getHead()
+ * @see #getVersion(int)
+ */
+ public CDOBranchPoint getPoint(long timeStamp);
+
+ /**
+ * Returns the branch version in this branch with the given version number.
+ * <p>
+ * This factory method never returns <code>null</code>.
+ *
+ * @see #getPoint(long)
+ */
+ public CDOBranchVersion getVersion(int version);
+
+ /**
+ * Returns the branch manager that manages this branch, never <code>null</code>.
+ */
+ public CDOBranchManager getBranchManager();
+
+ /**
+ * Returns an array of the sub branches of this branch, never <code>null</code>.
+ */
+ public CDOBranch[] getBranches();
+
+ /**
+ * Returns the sub branch of this branch with the given relative path, or <code>null</code> if no sub branch with this
+ * path exists in this branch.
+ * <p>
+ * The path name is the concatenation of the names of all branches from a direct sub branch of this branch, separated
+ * by {@link #PATH_SEPARATOR slashes} ("/" characters). Example: "team1/smith".
+ */
+ public CDOBranch getBranch(String path);
+
+ /**
+ * Creates a sub branch of this branch with the given name, {@link #getBase() based} at the {@link CDOBranchPoint
+ * branch point} in this branch with the given time stamp.
+ * <p>
+ *
+ * @param name
+ * The name of the sub branch to be created. It must not contain the {@link #PATH_SEPARATOR path separator}
+ * character (slash).
+ * @param timeStamp
+ * The time stamp in this branch that the sub branch to be created is supposed to be {@link #getBase() based
+ * at}. It must not be before the base time stamp of this branch and it must be different from the fixed
+ * special time stamp <i> {@link CDOBranchPoint#UNSPECIFIED_DATE unspecified}</i>
+ * @see #createBranch(String)
+ */
+ public CDOBranch createBranch(String name, long timeStamp);
+
+ /**
+ * Creates a sub branch of this branch with the given name, {@link #getBase() based} at the {@link CDOTimeProvider
+ * current time}.
+ */
+ public CDOBranch createBranch(String name);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchCreatedEvent.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchCreatedEvent.java
index f0f755ee9e..dcf680aee7 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchCreatedEvent.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchCreatedEvent.java
@@ -1,29 +1,29 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.branch;
-
-import org.eclipse.net4j.util.event.IEvent;
-
-/**
- * An {@link IEvent event} fired from a {@link CDOBranchManager branch manager} when a new {@link CDOBranch branch} has
- * been created.
- *
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOBranchCreatedEvent extends IEvent
-{
- public CDOBranchManager getSource();
-
- public CDOBranch getBranch();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.branch;
+
+import org.eclipse.net4j.util.event.IEvent;
+
+/**
+ * An {@link IEvent event} fired from a {@link CDOBranchManager branch manager} when a new {@link CDOBranch branch} has
+ * been created.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOBranchCreatedEvent extends IEvent
+{
+ public CDOBranchManager getSource();
+
+ public CDOBranch getBranch();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchHandler.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchHandler.java
index 4299176b90..149f6e4b5c 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchHandler.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchHandler.java
@@ -1,27 +1,27 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.branch;
-
-/**
- * A call-back interface that indicates the ability to <i>handle</i> branches that are passed from other entities.
- *
- * @see CDOBranchManager#getBranches(int, int, CDOBranchHandler)
- * @author Eike Stepper
- * @since 3.0
- * @apiviz.uses {@link CDOBranch} - - handles
- */
-public interface CDOBranchHandler
-{
- /**
- * A call-back method that other entities can pass branches to.
- */
- public void handleBranch(CDOBranch branch);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.branch;
+
+/**
+ * A call-back interface that indicates the ability to <i>handle</i> branches that are passed from other entities.
+ *
+ * @see CDOBranchManager#getBranches(int, int, CDOBranchHandler)
+ * @author Eike Stepper
+ * @since 3.0
+ * @apiviz.uses {@link CDOBranch} - - handles
+ */
+public interface CDOBranchHandler
+{
+ /**
+ * A call-back method that other entities can pass branches to.
+ */
+ public void handleBranch(CDOBranch branch);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchManager.java
index 4274ca75e0..fadf832806 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchManager.java
@@ -1,79 +1,79 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.branch;
-
-import org.eclipse.net4j.util.event.INotifier;
-
-/**
- * Manages a tree of {@link CDOBranch branches} and notifies about changes in this branch tree.
- * <p>
- * The branch tree is represented by a {@link #getMainBranch() main} branch, which, like all
- * {@link CDOBranch#getBranches() sub} branches, offers the major part of the branching functionality. A branch manager
- * provides additional methods to find branches by their unique integer ID or by their fully qualified path name, as
- * well as asynchronous bulk queries.
- * <p>
- * A branch manager can fire the following events:
- * <ul>
- * <li> {@link CDOBranchCreatedEvent} after a new branch has been created.
- * </ul>
- * <p>
- * Branch managers are usually associated with the following entities:
- * <ul>
- * <li> <code>org.eclipse.emf.cdo.session.CDOSession</code>
- * <li> <code>org.eclipse.emf.cdo.server.IRepository</code>
- * </ul>
- *
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.has {@link CDOBranch} oneway - - mainBranch
- * @apiviz.uses {@link CDOBranchCreatedEvent} - - fires
- */
-public interface CDOBranchManager extends INotifier
-{
- /**
- * Returns the main branch of the branch tree managed by this branch manager.
- * <p>
- * The main branch has the fixed {@link CDOBranch#MAIN_BRANCH_NAME name} "MAIN" and the fixed
- * {@link CDOBranch#MAIN_BRANCH_ID ID} 0 (zero).
- */
- public CDOBranch getMainBranch();
-
- /**
- * Returns the branch with the given unique integer ID.
- * <p>
- * Note that this method never returns <code>null</code>. Due to the lazy loading nature of branch managers this
- * method returns a transparent <i>branch proxy</i> if the branch is not already loaded in the internal <i>branch
- * cache</i>. This can result in unchecked exceptions being thrown from calls to arbitrary branch methods if the ID
- * that the proxy was created with does not exist in the branch tree.
- */
- public CDOBranch getBranch(int branchID);
-
- /**
- * Returns the branch with the given absolute path.
- *
- * @param path
- * A concatenation of the names of all branches from the {@link #getMainBranch() main branch} to the
- * requested branch, separated by {@link CDOBranch#PATH_SEPARATOR slashes} ("/" characters). Example:
- * "MAIN/team1/smith".
- */
- public CDOBranch getBranch(String path);
-
- /**
- * Passes all branches with IDs in the given range to the given {@link CDOBranchHandler#handleBranch(CDOBranch) branch
- * handler} and returns the number of handler invocations.
- * <p>
- * This is a blocking call.
- */
- public int getBranches(int startID, int endID, CDOBranchHandler handler);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.branch;
+
+import org.eclipse.net4j.util.event.INotifier;
+
+/**
+ * Manages a tree of {@link CDOBranch branches} and notifies about changes in this branch tree.
+ * <p>
+ * The branch tree is represented by a {@link #getMainBranch() main} branch, which, like all
+ * {@link CDOBranch#getBranches() sub} branches, offers the major part of the branching functionality. A branch manager
+ * provides additional methods to find branches by their unique integer ID or by their fully qualified path name, as
+ * well as asynchronous bulk queries.
+ * <p>
+ * A branch manager can fire the following events:
+ * <ul>
+ * <li> {@link CDOBranchCreatedEvent} after a new branch has been created.
+ * </ul>
+ * <p>
+ * Branch managers are usually associated with the following entities:
+ * <ul>
+ * <li> <code>org.eclipse.emf.cdo.session.CDOSession</code>
+ * <li> <code>org.eclipse.emf.cdo.server.IRepository</code>
+ * </ul>
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.has {@link CDOBranch} oneway - - mainBranch
+ * @apiviz.uses {@link CDOBranchCreatedEvent} - - fires
+ */
+public interface CDOBranchManager extends INotifier
+{
+ /**
+ * Returns the main branch of the branch tree managed by this branch manager.
+ * <p>
+ * The main branch has the fixed {@link CDOBranch#MAIN_BRANCH_NAME name} "MAIN" and the fixed
+ * {@link CDOBranch#MAIN_BRANCH_ID ID} 0 (zero).
+ */
+ public CDOBranch getMainBranch();
+
+ /**
+ * Returns the branch with the given unique integer ID.
+ * <p>
+ * Note that this method never returns <code>null</code>. Due to the lazy loading nature of branch managers this
+ * method returns a transparent <i>branch proxy</i> if the branch is not already loaded in the internal <i>branch
+ * cache</i>. This can result in unchecked exceptions being thrown from calls to arbitrary branch methods if the ID
+ * that the proxy was created with does not exist in the branch tree.
+ */
+ public CDOBranch getBranch(int branchID);
+
+ /**
+ * Returns the branch with the given absolute path.
+ *
+ * @param path
+ * A concatenation of the names of all branches from the {@link #getMainBranch() main branch} to the
+ * requested branch, separated by {@link CDOBranch#PATH_SEPARATOR slashes} ("/" characters). Example:
+ * "MAIN/team1/smith".
+ */
+ public CDOBranch getBranch(String path);
+
+ /**
+ * Passes all branches with IDs in the given range to the given {@link CDOBranchHandler#handleBranch(CDOBranch) branch
+ * handler} and returns the number of handler invocations.
+ * <p>
+ * This is a blocking call.
+ */
+ public int getBranches(int startID, int endID, CDOBranchHandler handler);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.java
index ac4ba9b7dd..639597a9d6 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchPoint.java
@@ -1,59 +1,59 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.branch;
-
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
-import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
-
-/**
- * A {@link #getTimeStamp() point in time} in a particular {@link #getBranch() branch}.
- *
- * @see CDOCommitInfo
- * @see CDOBranchTag
- * @see CDOBranch#getBase()
- * @see CDOBranch#getHead()
- * @see CDOBranch#getPoint(long)
- * @see CDOBranchUtil#copyBranchPoint(CDOBranchPoint)
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.has {@link CDOBranch}
- */
-public interface CDOBranchPoint
-{
- /**
- * The fixed special time stamp <i>unspecified</i>.
- *
- * @see CDOBranch#getHead()
- */
- public static final long UNSPECIFIED_DATE = 0;
-
- /**
- * The fixed special time stamp <i>invalid</i>.
- *
- * @since 4.0
- */
- public static final long INVALID_DATE = -1;
-
- /**
- * Returns the branch of this branch point, or <code>null</code> if this branch point is the
- * {@link CDOBranch#getBase() base} of the {@link CDOBranchManager#getMainBranch() main branch}.
- */
- public CDOBranch getBranch();
-
- /**
- * Returns the time stamp of this branch point, or the fixed special time stamp <i>
- * {@link CDOBranchPoint#UNSPECIFIED_DATE unspecified}</i> if this branch point marks the {@link CDOBranch#getHead()
- * head} of a branch.
- */
- public long getTimeStamp();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.branch;
+
+import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
+import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
+
+/**
+ * A {@link #getTimeStamp() point in time} in a particular {@link #getBranch() branch}.
+ *
+ * @see CDOCommitInfo
+ * @see CDOBranchTag
+ * @see CDOBranch#getBase()
+ * @see CDOBranch#getHead()
+ * @see CDOBranch#getPoint(long)
+ * @see CDOBranchUtil#copyBranchPoint(CDOBranchPoint)
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.has {@link CDOBranch}
+ */
+public interface CDOBranchPoint
+{
+ /**
+ * The fixed special time stamp <i>unspecified</i>.
+ *
+ * @see CDOBranch#getHead()
+ */
+ public static final long UNSPECIFIED_DATE = 0;
+
+ /**
+ * The fixed special time stamp <i>invalid</i>.
+ *
+ * @since 4.0
+ */
+ public static final long INVALID_DATE = -1;
+
+ /**
+ * Returns the branch of this branch point, or <code>null</code> if this branch point is the
+ * {@link CDOBranch#getBase() base} of the {@link CDOBranchManager#getMainBranch() main branch}.
+ */
+ public CDOBranch getBranch();
+
+ /**
+ * Returns the time stamp of this branch point, or the fixed special time stamp <i>
+ * {@link CDOBranchPoint#UNSPECIFIED_DATE unspecified}</i> if this branch point marks the {@link CDOBranch#getHead()
+ * head} of a branch.
+ */
+ public long getTimeStamp();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchPointRange.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchPointRange.java
index dd80e94871..538863090e 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchPointRange.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchPointRange.java
@@ -1,44 +1,44 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.branch;
-
-import org.eclipse.emf.cdo.common.commit.CDOChangeSet;
-import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
-
-/**
- * A range between the {@link CDOBranch#getBase() base} of the {@link CDOBranchManager#getMainBranch() main branch} and
- * the {@link CDOBranch#getHead() head} of any branch that is demarkated by a {@link #getStartPoint() start point} and
- * an {@link #getEndPoint() end point}.
- * <p>
- * The start point and the end point of a branch point range may have different branches or not.
- * <p>
- * Branch point ranges are usually created with {@link CDOBranchUtil#createRange(CDOBranchPoint, CDOBranchPoint)
- * CDOBranchUtil.createRange()} and often used in the context of {@link CDOChangeSet change sets}.
- *
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.has {@link CDOBranchPoint} oneway - - start
- * @apiviz.has {@link CDOBranchPoint} oneway - - end
- */
-public interface CDOBranchPointRange
-{
- /**
- * Returns the start point of this branch point range, never <code>null</code>.
- */
- public CDOBranchPoint getStartPoint();
-
- /**
- * Returns the end point of this branch point range, never <code>null</code>.
- */
- public CDOBranchPoint getEndPoint();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.branch;
+
+import org.eclipse.emf.cdo.common.commit.CDOChangeSet;
+import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
+
+/**
+ * A range between the {@link CDOBranch#getBase() base} of the {@link CDOBranchManager#getMainBranch() main branch} and
+ * the {@link CDOBranch#getHead() head} of any branch that is demarkated by a {@link #getStartPoint() start point} and
+ * an {@link #getEndPoint() end point}.
+ * <p>
+ * The start point and the end point of a branch point range may have different branches or not.
+ * <p>
+ * Branch point ranges are usually created with {@link CDOBranchUtil#createRange(CDOBranchPoint, CDOBranchPoint)
+ * CDOBranchUtil.createRange()} and often used in the context of {@link CDOChangeSet change sets}.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.has {@link CDOBranchPoint} oneway - - start
+ * @apiviz.has {@link CDOBranchPoint} oneway - - end
+ */
+public interface CDOBranchPointRange
+{
+ /**
+ * Returns the start point of this branch point range, never <code>null</code>.
+ */
+ public CDOBranchPoint getStartPoint();
+
+ /**
+ * Returns the end point of this branch point range, never <code>null</code>.
+ */
+ public CDOBranchPoint getEndPoint();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchTag.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchTag.java
index 7ba2e64fd0..41b7d4f3e1 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchTag.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchTag.java
@@ -1,27 +1,27 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.branch;
-
-/**
- * A named {@link CDOBranchPoint branch point}.
- *
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOBranchTag extends CDOBranchPoint
-{
- /**
- * Returns the name of this branch tag.
- */
- public String getName();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.branch;
+
+/**
+ * A named {@link CDOBranchPoint branch point}.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOBranchTag extends CDOBranchPoint
+{
+ /**
+ * Returns the name of this branch tag.
+ */
+ public String getName();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchVersion.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchVersion.java
index 78f1153c41..dc9ecd1a80 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchVersion.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchVersion.java
@@ -1,53 +1,53 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.branch;
-
-import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.common.revision.CDORevisionManager;
-
-/**
- * A pair of a {@link #getBranch() branch} and an integer {@link #getVersion() version} number.
- * <p>
- * It is often used in the context of
- * {@link CDORevisionManager#getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
- * CDORevisionManager.getRevisionByVersion()}.
- *
- * @see CDOBranch#getVersion(int)
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.has {@link CDOBranch}
- */
-public interface CDOBranchVersion
-{
- /**
- * The fixed special version number <i>unspecified</i>.
- */
- public static final int UNSPECIFIED_VERSION = 0;
-
- /**
- * The fixed version number that is assigned to the first {@link CDORevision revision} of an {@link CDOID object} that
- * is committed to a particular branch .
- */
- public static final int FIRST_VERSION = 1;
-
- /**
- * Returns the branch of this branch version.
- */
- public CDOBranch getBranch();
-
- /**
- * Returns the version number of this branch version.
- */
- public int getVersion();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.branch;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.revision.CDORevision;
+import org.eclipse.emf.cdo.common.revision.CDORevisionManager;
+
+/**
+ * A pair of a {@link #getBranch() branch} and an integer {@link #getVersion() version} number.
+ * <p>
+ * It is often used in the context of
+ * {@link CDORevisionManager#getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
+ * CDORevisionManager.getRevisionByVersion()}.
+ *
+ * @see CDOBranch#getVersion(int)
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.has {@link CDOBranch}
+ */
+public interface CDOBranchVersion
+{
+ /**
+ * The fixed special version number <i>unspecified</i>.
+ */
+ public static final int UNSPECIFIED_VERSION = 0;
+
+ /**
+ * The fixed version number that is assigned to the first {@link CDORevision revision} of an {@link CDOID object} that
+ * is committed to a particular branch .
+ */
+ public static final int FIRST_VERSION = 1;
+
+ /**
+ * Returns the branch of this branch version.
+ */
+ public CDOBranch getBranch();
+
+ /**
+ * Returns the version number of this branch version.
+ */
+ public int getVersion();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/package-info.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/package-info.java
index e30279294b..2a44e199a5 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/package-info.java
@@ -1,20 +1,20 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-
-/**
- * Common concepts for dealing with branches.
- *
- * @apiviz.exclude .*\.IContainer
- * @apiviz.exclude .*\.INotifier
- * @apiviz.exclude .*Event
- */
-package org.eclipse.emf.cdo.common.branch;
-
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Common concepts for dealing with branches.
+ *
+ * @apiviz.exclude .*\.IContainer
+ * @apiviz.exclude .*\.INotifier
+ * @apiviz.exclude .*Event
+ */
+package org.eclipse.emf.cdo.common.branch;
+
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeKind.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeKind.java
index 4fdabd758b..c565f8f419 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeKind.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeKind.java
@@ -1,23 +1,23 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit;
-
-/**
- * Enumerates possible change kinds.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- */
-public enum CDOChangeKind
-{
- NEW, CHANGED, DETACHED
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.commit;
+
+/**
+ * Enumerates possible change kinds.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ */
+public enum CDOChangeKind
+{
+ NEW, CHANGED, DETACHED
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeKindProvider.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeKindProvider.java
index 2c76354da2..f12db6193d 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeKindProvider.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeKindProvider.java
@@ -1,25 +1,25 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit;
-
-import org.eclipse.emf.cdo.common.id.CDOID;
-
-/**
- * Generic provider for the kinds of changes that have been applied to objects.
- *
- * @author Eike Stepper
- * @since 4.0
- * @apiviz.uses {@link CDOChangeKind} - - provides
- */
-public interface CDOChangeKindProvider
-{
- public CDOChangeKind getChangeKind(CDOID id);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.commit;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+
+/**
+ * Generic provider for the kinds of changes that have been applied to objects.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @apiviz.uses {@link CDOChangeKind} - - provides
+ */
+public interface CDOChangeKindProvider
+{
+ public CDOChangeKind getChangeKind(CDOID id);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSet.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSet.java
index c36e8a6c48..262430c71e 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSet.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSet.java
@@ -1,28 +1,28 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.branch.CDOBranchPointRange;
-
-/**
- * The {@link CDOChangeSetData change set data} between two {@link CDOBranchPointRange branch points} with a common
- * ancestor.
- *
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOChangeSet extends CDOBranchPointRange, CDOChangeSetData
-{
- public CDOBranchPoint getAncestorPoint();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.commit;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPointRange;
+
+/**
+ * The {@link CDOChangeSetData change set data} between two {@link CDOBranchPointRange branch points} with a common
+ * ancestor.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOChangeSet extends CDOBranchPointRange, CDOChangeSetData
+{
+ public CDOBranchPoint getAncestorPoint();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSetData.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSetData.java
index b9cdb068e4..e5333de082 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSetData.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSetData.java
@@ -1,78 +1,78 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
-import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
-import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * A {@link CDOChangeKindProvider change kind provider} with detailed information about {@link #getNewObjects() new},
- * {@link #getChangedObjects() changed} and {@link #getDetachedObjects() detached} objects.
- *
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOChangeSetData extends CDOChangeKindProvider
-{
- /**
- * Returns <code>true</code>, if this change set data does not contain any changes, <code>false</code> otherwise.
- */
- public boolean isEmpty();
-
- /**
- * Returns a deep copy of this change set data.
- *
- * @since 4.0
- */
- public CDOChangeSetData copy();
-
- /**
- * Changes the internal state of this change set data by adding the changes of the given change set data.
- *
- * @since 4.0
- */
- public void merge(CDOChangeSetData changeSetData);
-
- /**
- * Returns a collection of keys denoting which revisions have been added in the context of a commit operation.
- * Depending on various conditions like change subscriptions particular elements can also be full {@link CDORevision
- * revisions}.
- */
- public List<CDOIDAndVersion> getNewObjects();
-
- /**
- * Returns a collection of revision keys denoting which (original) revisions have been changed in the context of a
- * commit operation. Depending on various conditions like change subscriptions particular elements can also be full
- * {@link CDORevisionDelta revision deltas}.
- */
- public List<CDORevisionKey> getChangedObjects();
-
- /**
- * Returns a collection of keys denoting which revisions have been revised (corresponds to detached objects) in the
- * context of a commit operation. Depending on various conditions the version part of particular elements can be
- * {@link CDOBranchVersion#UNSPECIFIED_VERSION unspecified}.
- */
- public List<CDOIDAndVersion> getDetachedObjects();
-
- /**
- * @since 4.1
- */
- public Map<CDOID, CDOChangeKind> getChangeKinds();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.commit;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.revision.CDORevision;
+import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
+import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A {@link CDOChangeKindProvider change kind provider} with detailed information about {@link #getNewObjects() new},
+ * {@link #getChangedObjects() changed} and {@link #getDetachedObjects() detached} objects.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOChangeSetData extends CDOChangeKindProvider
+{
+ /**
+ * Returns <code>true</code>, if this change set data does not contain any changes, <code>false</code> otherwise.
+ */
+ public boolean isEmpty();
+
+ /**
+ * Returns a deep copy of this change set data.
+ *
+ * @since 4.0
+ */
+ public CDOChangeSetData copy();
+
+ /**
+ * Changes the internal state of this change set data by adding the changes of the given change set data.
+ *
+ * @since 4.0
+ */
+ public void merge(CDOChangeSetData changeSetData);
+
+ /**
+ * Returns a collection of keys denoting which revisions have been added in the context of a commit operation.
+ * Depending on various conditions like change subscriptions particular elements can also be full {@link CDORevision
+ * revisions}.
+ */
+ public List<CDOIDAndVersion> getNewObjects();
+
+ /**
+ * Returns a collection of revision keys denoting which (original) revisions have been changed in the context of a
+ * commit operation. Depending on various conditions like change subscriptions particular elements can also be full
+ * {@link CDORevisionDelta revision deltas}.
+ */
+ public List<CDORevisionKey> getChangedObjects();
+
+ /**
+ * Returns a collection of keys denoting which revisions have been revised (corresponds to detached objects) in the
+ * context of a commit operation. Depending on various conditions the version part of particular elements can be
+ * {@link CDOBranchVersion#UNSPECIFIED_VERSION unspecified}.
+ */
+ public List<CDOIDAndVersion> getDetachedObjects();
+
+ /**
+ * @since 4.1
+ */
+ public Map<CDOID, CDOChangeKind> getChangeKinds();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSetDataProvider.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSetDataProvider.java
index a9122c0ecf..6a5b43a2c6 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSetDataProvider.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOChangeSetDataProvider.java
@@ -1,23 +1,23 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit;
-
-/**
- * Provides consumers with {@link CDOChangeSetData change set data} structures.
- *
- * @author Eike Stepper
- * @since 4.0
- * @apiviz.uses {@link CDOChangeSetData} - - provides
- */
-public interface CDOChangeSetDataProvider
-{
- public CDOChangeSetData getChangeSetData();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.commit;
+
+/**
+ * Provides consumers with {@link CDOChangeSetData change set data} structures.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @apiviz.uses {@link CDOChangeSetData} - - provides
+ */
+public interface CDOChangeSetDataProvider
+{
+ public CDOChangeSetData getChangeSetData();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitData.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitData.java
index 41ea320c6d..5f57741d0d 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitData.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitData.java
@@ -1,29 +1,29 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit;
-
-import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
-
-import java.util.List;
-
-/**
- * {@link CDOChangeSetData Change set data} with detailed information about new {@link #getNewPackageUnits() package
- * units}.
- *
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOCommitData extends CDOChangeSetData
-{
- public List<CDOPackageUnit> getNewPackageUnits();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.commit;
+
+import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
+
+import java.util.List;
+
+/**
+ * {@link CDOChangeSetData Change set data} with detailed information about new {@link #getNewPackageUnits() package
+ * units}.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOCommitData extends CDOChangeSetData
+{
+ public List<CDOPackageUnit> getNewPackageUnits();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfo.java
index 1b93982d3a..101c6f1768 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfo.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfo.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-
-/**
- * {@link CDOCommitData Commit data} in the context of a {@link CDOCommitInfoManager commit info manager} with
- * additional commit informations.
- *
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- */
-public interface CDOCommitInfo extends CDOBranchPoint, CDOCommitData
-{
- public CDOCommitInfoManager getCommitInfoManager();
-
- /**
- * @since 4.0
- */
- public long getPreviousTimeStamp();
-
- public String getUserID();
-
- public String getComment();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.commit;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+
+/**
+ * {@link CDOCommitData Commit data} in the context of a {@link CDOCommitInfoManager commit info manager} with
+ * additional commit informations.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ */
+public interface CDOCommitInfo extends CDOBranchPoint, CDOCommitData
+{
+ public CDOCommitInfoManager getCommitInfoManager();
+
+ /**
+ * @since 4.0
+ */
+ public long getPreviousTimeStamp();
+
+ public String getUserID();
+
+ public String getComment();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoHandler.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoHandler.java
index 800ccc5bb5..5866ab1791 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoHandler.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoHandler.java
@@ -1,24 +1,24 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit;
-
-/**
- * A call-back interface that indicates the ability to <i>handle</i> {@link CDOCommitInfo commit infos} that are passed
- * from other entities.
- *
- * @author Eike Stepper
- * @since 3.0
- * @apiviz.uses {@link CDOCommitInfo} - - handles
- */
-public interface CDOCommitInfoHandler
-{
- public void handleCommitInfo(CDOCommitInfo commitInfo);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.commit;
+
+/**
+ * A call-back interface that indicates the ability to <i>handle</i> {@link CDOCommitInfo commit infos} that are passed
+ * from other entities.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @apiviz.uses {@link CDOCommitInfo} - - handles
+ */
+public interface CDOCommitInfoHandler
+{
+ public void handleCommitInfo(CDOCommitInfo commitInfo);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoManager.java
index 58b7dee9de..c895f81d7d 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/CDOCommitInfoManager.java
@@ -1,39 +1,39 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Andre Dietisheim - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-
-/**
- * Loads, provides and possible manages {@link CDOCommitInfo commit info} objects.
- *
- * @author Andre Dietisheim
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.uses {@link CDOCommitInfo} - - manages
- */
-public interface CDOCommitInfoManager
-{
- /**
- * @since 4.0
- */
- public CDOCommitInfo getCommitInfo(long timeStamp);
-
- public void getCommitInfos(CDOBranch branch, long startTime, long endTime, CDOCommitInfoHandler handler);
-
- /**
- * @since 4.0
- */
- public void getCommitInfos(CDOBranch branch, long startTime, String userID, String comment, int count,
- CDOCommitInfoHandler handler);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andre Dietisheim - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.commit;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+
+/**
+ * Loads, provides and possible manages {@link CDOCommitInfo commit info} objects.
+ *
+ * @author Andre Dietisheim
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.uses {@link CDOCommitInfo} - - manages
+ */
+public interface CDOCommitInfoManager
+{
+ /**
+ * @since 4.0
+ */
+ public CDOCommitInfo getCommitInfo(long timeStamp);
+
+ public void getCommitInfos(CDOBranch branch, long startTime, long endTime, CDOCommitInfoHandler handler);
+
+ /**
+ * @since 4.0
+ */
+ public void getCommitInfos(CDOBranch branch, long startTime, String userID, String comment, int count,
+ CDOCommitInfoHandler handler);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/BinaryCommitInfoLog.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/BinaryCommitInfoLog.java
index 011db925db..8ea201196b 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/BinaryCommitInfoLog.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/BinaryCommitInfoLog.java
@@ -1,59 +1,59 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit.handler;
-
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
-import org.eclipse.emf.cdo.common.id.CDOIDProvider;
-import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
-import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
-import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
-import org.eclipse.emf.cdo.internal.common.bundle.OM;
-
-import org.eclipse.net4j.util.io.ExtendedDataOutput;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.OutputStream;
-
-/**
- * A {@link CDOCommitInfoHandler commit info handler} that synchronously writes {@link CDOCommitInfo commit infos} to a
- * binary log.
- *
- * @author Eike Stepper
- * @since 4.0
- */
-public class BinaryCommitInfoLog implements CDOCommitInfoHandler
-{
- private CDODataOutput out;
-
- public BinaryCommitInfoLog(OutputStream stream, CDOPackageRegistry packageRegistry)
- {
- ExtendedDataOutput eod = ExtendedDataOutputStream.wrap(stream);
- out = CDOCommonUtil.createCDODataOutput(eod, packageRegistry, CDOIDProvider.NOOP);
- }
-
- public void handleCommitInfo(CDOCommitInfo commitInfo)
- {
- try
- {
- out.writeCDOCommitInfo(commitInfo);
- }
- catch (Exception ex)
- {
- handleException(ex);
- }
- }
-
- protected void handleException(Exception ex)
- {
- OM.LOG.error(ex);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.commit.handler;
+
+import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
+import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
+import org.eclipse.emf.cdo.common.id.CDOIDProvider;
+import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
+import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
+import org.eclipse.emf.cdo.internal.common.bundle.OM;
+
+import org.eclipse.net4j.util.io.ExtendedDataOutput;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+
+import java.io.OutputStream;
+
+/**
+ * A {@link CDOCommitInfoHandler commit info handler} that synchronously writes {@link CDOCommitInfo commit infos} to a
+ * binary log.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ */
+public class BinaryCommitInfoLog implements CDOCommitInfoHandler
+{
+ private CDODataOutput out;
+
+ public BinaryCommitInfoLog(OutputStream stream, CDOPackageRegistry packageRegistry)
+ {
+ ExtendedDataOutput eod = ExtendedDataOutputStream.wrap(stream);
+ out = CDOCommonUtil.createCDODataOutput(eod, packageRegistry, CDOIDProvider.NOOP);
+ }
+
+ public void handleCommitInfo(CDOCommitInfo commitInfo)
+ {
+ try
+ {
+ out.writeCDOCommitInfo(commitInfo);
+ }
+ catch (Exception ex)
+ {
+ handleException(ex);
+ }
+ }
+
+ protected void handleException(Exception ex)
+ {
+ OM.LOG.error(ex);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/TextCommitInfoLog.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/TextCommitInfoLog.java
index ca4e5c16d5..16871550d4 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/TextCommitInfoLog.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/TextCommitInfoLog.java
@@ -1,65 +1,65 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.commit.handler;
-
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
-import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
-import org.eclipse.emf.cdo.internal.common.bundle.OM;
-import org.eclipse.emf.cdo.spi.common.commit.CDOCommitInfoUtil;
-
-import java.io.OutputStream;
-import java.io.PrintStream;
-
-/**
- * A {@link CDOCommitInfoHandler commit info handler} that synchronously writes {@link CDOCommitInfo commit infos} to a
- * text log.
- *
- * @author Eike Stepper
- * @since 4.0
- */
-public class TextCommitInfoLog implements CDOCommitInfoHandler
-{
- private PrintStream printStream;
-
- public TextCommitInfoLog(OutputStream stream)
- {
- printStream = stream instanceof PrintStream ? (PrintStream)stream : new PrintStream(stream);
- }
-
- public void handleCommitInfo(CDOCommitInfo commitInfo)
- {
- try
- {
- if (printStream != null)
- {
- printStream.println(commitInfo);
-
- for (CDOPackageUnit packageUnit : commitInfo.getNewPackageUnits())
- {
- printStream.println(" P " + packageUnit.getID());
- }
-
- CDOCommitInfoUtil.dump(printStream, commitInfo);
- printStream.flush();
- }
- }
- catch (Exception ex)
- {
- handleException(ex);
- }
- }
-
- protected void handleException(Exception ex)
- {
- OM.LOG.error(ex);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.commit.handler;
+
+import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
+import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
+import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
+import org.eclipse.emf.cdo.internal.common.bundle.OM;
+import org.eclipse.emf.cdo.spi.common.commit.CDOCommitInfoUtil;
+
+import java.io.OutputStream;
+import java.io.PrintStream;
+
+/**
+ * A {@link CDOCommitInfoHandler commit info handler} that synchronously writes {@link CDOCommitInfo commit infos} to a
+ * text log.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ */
+public class TextCommitInfoLog implements CDOCommitInfoHandler
+{
+ private PrintStream printStream;
+
+ public TextCommitInfoLog(OutputStream stream)
+ {
+ printStream = stream instanceof PrintStream ? (PrintStream)stream : new PrintStream(stream);
+ }
+
+ public void handleCommitInfo(CDOCommitInfo commitInfo)
+ {
+ try
+ {
+ if (printStream != null)
+ {
+ printStream.println(commitInfo);
+
+ for (CDOPackageUnit packageUnit : commitInfo.getNewPackageUnits())
+ {
+ printStream.println(" P " + packageUnit.getID());
+ }
+
+ CDOCommitInfoUtil.dump(printStream, commitInfo);
+ printStream.flush();
+ }
+ }
+ catch (Exception ex)
+ {
+ handleException(ex);
+ }
+ }
+
+ protected void handleException(Exception ex)
+ {
+ OM.LOG.error(ex);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/package-info.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/package-info.java
index 132c167e63..606d26a8c8 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/handler/package-info.java
@@ -1,15 +1,15 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-
-/**
- * Some useful commit info handler implementations.
- */
-package org.eclipse.emf.cdo.common.commit.handler;
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Some useful commit info handler implementations.
+ */
+package org.eclipse.emf.cdo.common.commit.handler;
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/package-info.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/package-info.java
index 8c68efd5ef..700bb031e1 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/commit/package-info.java
@@ -1,15 +1,15 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-
-/**
- * Common concepts for dealing with commits and change sets.
- */
-package org.eclipse.emf.cdo.common.commit;
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Common concepts for dealing with commits and change sets.
+ */
+package org.eclipse.emf.cdo.common.commit;
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java
index 054fef251e..be107471c3 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java
@@ -1,162 +1,162 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Simon McDuff - bug 226778
- * Simon McDuff - bug 213402
- */
-package org.eclipse.emf.cdo.common.id;
-
-import org.eclipse.emf.cdo.common.CDOCommonRepository;
-
-import org.eclipse.net4j.util.ImplementationError;
-
-import java.io.Serializable;
-import java.lang.reflect.Array;
-
-/**
- * Identifies CDO objects uniquely in a CDO {@link CDOCommonRepository repository}.
- *
- * @author Eike Stepper
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.has {@link CDOID.Type}
- */
-public interface CDOID extends Serializable, Comparable<CDOID>
-{
- public static final CDOID NULL = org.eclipse.emf.cdo.internal.common.id.CDOIDNullImpl.INSTANCE;
-
- public Type getType();
-
- public boolean isNull();
-
- public boolean isObject();
-
- public boolean isTemporary();
-
- /**
- * @since 3.0
- */
- public boolean isDangling();
-
- /**
- * @since 2.0
- */
- public boolean isExternal();
-
- /**
- * @since 2.0
- */
- public String toURIFragment();
-
- /**
- * Enumerates the possible types of CDO {@link CDOID IDs}.
- *
- * @author Eike Stepper
- */
- public enum Type
- {
- NULL('N'), //
- OBJECT(' '), // Superceded by ObjectType.getID()
-
- /**
- * @since 2.0
- */
- EXTERNAL_OBJECT('E'),
-
- /**
- * @since 3.0
- */
- DANGLING_OBJECT('D'),
-
- /**
- * @since 2.0
- */
- EXTERNAL_TEMP_OBJECT('e'), //
- TEMP_OBJECT('t');
-
- private static Enum<?>[] chars;
-
- private char id;
-
- private Type(char id)
- {
- registerChar(id, this);
- this.id = id;
- }
-
- private static void registerChar(char id, Enum<?> literal)
- {
- if (chars == null)
- {
- chars = (Enum<?>[])Array.newInstance(Enum.class, id + 1);
- }
- else if (chars.length < id)
- {
- Enum<?>[] newChars = (Enum<?>[])Array.newInstance(Enum.class, id + 1);
- System.arraycopy(chars, 0, newChars, 0, chars.length);
- chars = newChars;
- }
-
- if (chars[id] != null)
- {
- throw new ImplementationError("Duplicate id: " + id);
- }
-
- chars[id] = literal;
- }
-
- /**
- * @since 4.0
- */
- public static Enum<?> getLiteral(char id)
- {
- return chars[id];
- }
-
- /**
- * @since 4.0
- */
- public char getID()
- {
- return id;
- }
- }
-
- /**
- * Enumerates the possible <b>sub</b> types of CDO {@link CDOID IDs} with the main type {@link Type#OBJECT OBJECT}.
- *
- * @author Eike Stepper
- * @since 3.0
- */
- public enum ObjectType
- {
- LONG('L'), //
- STRING('S'), //
- LONG_WITH_CLASSIFIER('l'), //
- STRING_WITH_CLASSIFIER('s'), //
- UUID('U');
-
- private char id;
-
- private ObjectType(char id)
- {
- Type.registerChar(id, this);
- this.id = id;
- }
-
- /**
- * @since 4.0
- */
- public char getID()
- {
- return id;
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Simon McDuff - bug 226778
+ * Simon McDuff - bug 213402
+ */
+package org.eclipse.emf.cdo.common.id;
+
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
+
+import org.eclipse.net4j.util.ImplementationError;
+
+import java.io.Serializable;
+import java.lang.reflect.Array;
+
+/**
+ * Identifies CDO objects uniquely in a CDO {@link CDOCommonRepository repository}.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.has {@link CDOID.Type}
+ */
+public interface CDOID extends Serializable, Comparable<CDOID>
+{
+ public static final CDOID NULL = org.eclipse.emf.cdo.internal.common.id.CDOIDNullImpl.INSTANCE;
+
+ public Type getType();
+
+ public boolean isNull();
+
+ public boolean isObject();
+
+ public boolean isTemporary();
+
+ /**
+ * @since 3.0
+ */
+ public boolean isDangling();
+
+ /**
+ * @since 2.0
+ */
+ public boolean isExternal();
+
+ /**
+ * @since 2.0
+ */
+ public String toURIFragment();
+
+ /**
+ * Enumerates the possible types of CDO {@link CDOID IDs}.
+ *
+ * @author Eike Stepper
+ */
+ public enum Type
+ {
+ NULL('N'), //
+ OBJECT(' '), // Superceded by ObjectType.getID()
+
+ /**
+ * @since 2.0
+ */
+ EXTERNAL_OBJECT('E'),
+
+ /**
+ * @since 3.0
+ */
+ DANGLING_OBJECT('D'),
+
+ /**
+ * @since 2.0
+ */
+ EXTERNAL_TEMP_OBJECT('e'), //
+ TEMP_OBJECT('t');
+
+ private static Enum<?>[] chars;
+
+ private char id;
+
+ private Type(char id)
+ {
+ registerChar(id, this);
+ this.id = id;
+ }
+
+ private static void registerChar(char id, Enum<?> literal)
+ {
+ if (chars == null)
+ {
+ chars = (Enum<?>[])Array.newInstance(Enum.class, id + 1);
+ }
+ else if (chars.length < id)
+ {
+ Enum<?>[] newChars = (Enum<?>[])Array.newInstance(Enum.class, id + 1);
+ System.arraycopy(chars, 0, newChars, 0, chars.length);
+ chars = newChars;
+ }
+
+ if (chars[id] != null)
+ {
+ throw new ImplementationError("Duplicate id: " + id);
+ }
+
+ chars[id] = literal;
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static Enum<?> getLiteral(char id)
+ {
+ return chars[id];
+ }
+
+ /**
+ * @since 4.0
+ */
+ public char getID()
+ {
+ return id;
+ }
+ }
+
+ /**
+ * Enumerates the possible <b>sub</b> types of CDO {@link CDOID IDs} with the main type {@link Type#OBJECT OBJECT}.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ */
+ public enum ObjectType
+ {
+ LONG('L'), //
+ STRING('S'), //
+ LONG_WITH_CLASSIFIER('l'), //
+ STRING_WITH_CLASSIFIER('s'), //
+ UUID('U');
+
+ private char id;
+
+ private ObjectType(char id)
+ {
+ Type.registerChar(id, this);
+ this.id = id;
+ }
+
+ /**
+ * @since 4.0
+ */
+ public char getID()
+ {
+ return id;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDExternal.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDExternal.java
index 7b52e8340d..a4ff3c7593 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDExternal.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDExternal.java
@@ -1,27 +1,27 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.id;
-
-import org.eclipse.emf.cdo.common.CDOCommonRepository;
-
-/**
- * The {@link CDOID ID} of a CDO object that is external to a CDO {@link CDOCommonRepository repository}.
- *
- * @author Simon McDuff
- * @since 2.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOIDExternal extends CDOID
-{
- public String getURI();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.id;
+
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
+
+/**
+ * The {@link CDOID ID} of a CDO object that is external to a CDO {@link CDOCommonRepository repository}.
+ *
+ * @author Simon McDuff
+ * @since 2.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOIDExternal extends CDOID
+{
+ public String getURI();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDGenerator.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDGenerator.java
index b929df6373..1f16ff9b32 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDGenerator.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDGenerator.java
@@ -1,72 +1,72 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.id;
-
-import org.eclipse.net4j.util.UUIDGenerator;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-/**
- * Generates {@link CDOID IDs}.
- *
- * @author Eike Stepper
- * @since 4.1
- */
-public interface CDOIDGenerator
-{
- /**
- * Generates {@link CDOID#NULL NULL} values.
- */
- public static final CDOIDGenerator NULL = new CDOIDGenerator()
- {
- public CDOID generateCDOID(EObject object)
- {
- return CDOID.NULL;
- }
-
- public void reset()
- {
- // Do nothing
- }
- };
-
- /**
- * Generates {@link EcoreUtil#generateUUID(byte[]) UUID} values.
- */
- public static final CDOIDGenerator UUID = new CDOIDGenerator()
- {
- public CDOID generateCDOID(EObject object)
- {
- byte[] bytes = new byte[16];
- UUIDGenerator.DEFAULT.generate(bytes);
- return CDOIDUtil.createUUID(bytes);
- }
-
- public void reset()
- {
- // Do nothing
- }
- };
-
- /**
- * Generates a {@link CDOID}.
- *
- * @param object
- * the object to generate a new CDOID for if available, <code>null</code> otherwise.
- */
- public CDOID generateCDOID(EObject object);
-
- /**
- * Called at the end of a commit operation to give this ID generator a chance to reset its sequence of IDs.
- */
- public void reset();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.id;
+
+import org.eclipse.net4j.util.UUIDGenerator;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+/**
+ * Generates {@link CDOID IDs}.
+ *
+ * @author Eike Stepper
+ * @since 4.1
+ */
+public interface CDOIDGenerator
+{
+ /**
+ * Generates {@link CDOID#NULL NULL} values.
+ */
+ public static final CDOIDGenerator NULL = new CDOIDGenerator()
+ {
+ public CDOID generateCDOID(EObject object)
+ {
+ return CDOID.NULL;
+ }
+
+ public void reset()
+ {
+ // Do nothing
+ }
+ };
+
+ /**
+ * Generates {@link EcoreUtil#generateUUID(byte[]) UUID} values.
+ */
+ public static final CDOIDGenerator UUID = new CDOIDGenerator()
+ {
+ public CDOID generateCDOID(EObject object)
+ {
+ byte[] bytes = new byte[16];
+ UUIDGenerator.DEFAULT.generate(bytes);
+ return CDOIDUtil.createUUID(bytes);
+ }
+
+ public void reset()
+ {
+ // Do nothing
+ }
+ };
+
+ /**
+ * Generates a {@link CDOID}.
+ *
+ * @param object
+ * the object to generate a new CDOID for if available, <code>null</code> otherwise.
+ */
+ public CDOID generateCDOID(EObject object);
+
+ /**
+ * Called at the end of a commit operation to give this ID generator a chance to reset its sequence of IDs.
+ */
+ public void reset();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDObject.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDObject.java
index 19d9ec4c96..e87e24c083 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDObject.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDObject.java
@@ -1,25 +1,25 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.id;
-
-import org.eclipse.emf.cdo.common.CDOCommonRepository;
-
-/**
- * The {@link CDOID ID} of a CDO object that is persistent in a CDO {@link CDOCommonRepository repository}.
- *
- * @author Eike Stepper
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.has {@link CDOID.ObjectType}
- */
-public interface CDOIDObject extends CDOID
-{
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.id;
+
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
+
+/**
+ * The {@link CDOID ID} of a CDO object that is persistent in a CDO {@link CDOCommonRepository repository}.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.has {@link CDOID.ObjectType}
+ */
+public interface CDOIDObject extends CDOID
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDProvider.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDProvider.java
index 8914221b5b..5c46f096ba 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDProvider.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDProvider.java
@@ -1,33 +1,33 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.id;
-
-/**
- * Provides the {@link CDOID IDs} of passed objects.
- *
- * @author Eike Stepper
- * @apiviz.uses {@link CDOID} - - provides
- */
-public interface CDOIDProvider
-{
- /**
- * @since 3.0
- */
- public static final CDOIDProvider NOOP = new CDOIDProvider()
- {
- public CDOID provideCDOID(Object id)
- {
- return (CDOID)id;
- }
- };
-
- public CDOID provideCDOID(Object idOrObject);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.id;
+
+/**
+ * Provides the {@link CDOID IDs} of passed objects.
+ *
+ * @author Eike Stepper
+ * @apiviz.uses {@link CDOID} - - provides
+ */
+public interface CDOIDProvider
+{
+ /**
+ * @since 3.0
+ */
+ public static final CDOIDProvider NOOP = new CDOIDProvider()
+ {
+ public CDOID provideCDOID(Object id)
+ {
+ return (CDOID)id;
+ }
+ };
+
+ public CDOID provideCDOID(Object idOrObject);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java
index 775ab10c69..c6fbed79fa 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java
@@ -1,108 +1,108 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.id;
-
-import org.eclipse.emf.cdo.common.protocol.CDODataInput;
-import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import java.io.IOException;
-
-/**
- * Represents a {@link CDOID} typed reference from one object to another object.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- * @apiviz.has {@link CDOID} oneway - - source
- * @apiviz.has {@link CDOID} oneway - - target
- */
-public class CDOIDReference implements CDOReference<CDOID>
-{
- private CDOID targetID;
-
- private CDOID sourceID;
-
- private EStructuralFeature sourceFeature;
-
- private int sourceIndex;
-
- public CDOIDReference(CDOID targetID, CDOID sourceID, EStructuralFeature sourceFeature, int sourceIndex)
- {
- this.targetID = targetID;
- this.sourceID = sourceID;
- this.sourceFeature = sourceFeature;
- this.sourceIndex = sourceIndex;
- }
-
- public CDOIDReference(CDODataInput in) throws IOException
- {
- targetID = in.readCDOID();
- sourceID = in.readCDOID();
-
- EClass eClass = (EClass)in.readCDOClassifierRefAndResolve();
- String featureName = in.readString();
- sourceFeature = eClass.getEStructuralFeature(featureName);
-
- sourceIndex = in.readInt();
- }
-
- public void write(CDODataOutput out) throws IOException
- {
- out.writeCDOID(targetID);
- out.writeCDOID(sourceID);
- out.writeCDOClassifierRef(sourceFeature.getEContainingClass());
- out.writeString(sourceFeature.getName());
- out.writeInt(sourceIndex);
- }
-
- public CDOID getTargetObject()
- {
- return targetID;
- }
-
- public CDOID getSourceObject()
- {
- return sourceID;
- }
-
- public EStructuralFeature getSourceFeature()
- {
- return sourceFeature;
- }
-
- public int getSourceIndex()
- {
- return sourceIndex;
- }
-
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append(sourceID);
- builder.append(".");
- builder.append(sourceFeature.getName());
- if (sourceIndex != NO_INDEX)
- {
- builder.append("[");
- builder.append(sourceIndex);
- builder.append("]");
- }
-
- builder.append(" --> ");
- builder.append(targetID);
- return builder.toString();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.id;
+
+import org.eclipse.emf.cdo.common.protocol.CDODataInput;
+import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import java.io.IOException;
+
+/**
+ * Represents a {@link CDOID} typed reference from one object to another object.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ * @apiviz.has {@link CDOID} oneway - - source
+ * @apiviz.has {@link CDOID} oneway - - target
+ */
+public class CDOIDReference implements CDOReference<CDOID>
+{
+ private CDOID targetID;
+
+ private CDOID sourceID;
+
+ private EStructuralFeature sourceFeature;
+
+ private int sourceIndex;
+
+ public CDOIDReference(CDOID targetID, CDOID sourceID, EStructuralFeature sourceFeature, int sourceIndex)
+ {
+ this.targetID = targetID;
+ this.sourceID = sourceID;
+ this.sourceFeature = sourceFeature;
+ this.sourceIndex = sourceIndex;
+ }
+
+ public CDOIDReference(CDODataInput in) throws IOException
+ {
+ targetID = in.readCDOID();
+ sourceID = in.readCDOID();
+
+ EClass eClass = (EClass)in.readCDOClassifierRefAndResolve();
+ String featureName = in.readString();
+ sourceFeature = eClass.getEStructuralFeature(featureName);
+
+ sourceIndex = in.readInt();
+ }
+
+ public void write(CDODataOutput out) throws IOException
+ {
+ out.writeCDOID(targetID);
+ out.writeCDOID(sourceID);
+ out.writeCDOClassifierRef(sourceFeature.getEContainingClass());
+ out.writeString(sourceFeature.getName());
+ out.writeInt(sourceIndex);
+ }
+
+ public CDOID getTargetObject()
+ {
+ return targetID;
+ }
+
+ public CDOID getSourceObject()
+ {
+ return sourceID;
+ }
+
+ public EStructuralFeature getSourceFeature()
+ {
+ return sourceFeature;
+ }
+
+ public int getSourceIndex()
+ {
+ return sourceIndex;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append(sourceID);
+ builder.append(".");
+ builder.append(sourceFeature.getName());
+ if (sourceIndex != NO_INDEX)
+ {
+ builder.append("[");
+ builder.append(sourceIndex);
+ builder.append("]");
+ }
+
+ builder.append(" --> ");
+ builder.append(targetID);
+ return builder.toString();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDTemp.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDTemp.java
index bec16fbfa9..681d9d22ad 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDTemp.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDTemp.java
@@ -1,26 +1,26 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Simon McDuff - bug 213402
- */
-package org.eclipse.emf.cdo.common.id;
-
-import org.eclipse.emf.cdo.common.CDOCommonTransaction;
-
-/**
- * The {@link CDOID ID} of a CDO object that is new in a dirty (uncommitted) CDO {@link CDOCommonTransaction
- * transaction}.
- *
- * @author Eike Stepper
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOIDTemp extends CDOID
-{
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Simon McDuff - bug 213402
+ */
+package org.eclipse.emf.cdo.common.id;
+
+import org.eclipse.emf.cdo.common.CDOCommonTransaction;
+
+/**
+ * The {@link CDOID ID} of a CDO object that is new in a dirty (uncommitted) CDO {@link CDOCommonTransaction
+ * transaction}.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOIDTemp extends CDOID
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOReference.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOReference.java
index a6af2693bc..4701c3181d 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOReference.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOReference.java
@@ -1,43 +1,43 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.id;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.FeatureMap;
-
-/**
- * Represents a reference from one object to another object, possibly {@link CDOID} or CDOObject typed.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.has {@link org.eclipse.emf.ecore.EStructuralFeature}
- */
-public interface CDOReference<OBJECT>
-{
- public static final int NO_INDEX = Notification.NO_INDEX;
-
- public OBJECT getTargetObject();
-
- public OBJECT getSourceObject();
-
- /**
- * Returns the source {@link EReference} or the source {@link EAttribute} if the source feature is a
- * {@link FeatureMap}.
- */
- public EStructuralFeature getSourceFeature();
-
- public int getSourceIndex();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.id;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.FeatureMap;
+
+/**
+ * Represents a reference from one object to another object, possibly {@link CDOID} or CDOObject typed.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.has {@link org.eclipse.emf.ecore.EStructuralFeature}
+ */
+public interface CDOReference<OBJECT>
+{
+ public static final int NO_INDEX = Notification.NO_INDEX;
+
+ public OBJECT getTargetObject();
+
+ public OBJECT getSourceObject();
+
+ /**
+ * Returns the source {@link EReference} or the source {@link EAttribute} if the source feature is a
+ * {@link FeatureMap}.
+ */
+ public EStructuralFeature getSourceFeature();
+
+ public int getSourceIndex();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOWithID.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOWithID.java
index 1868346cdf..de9ac93aa6 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOWithID.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOWithID.java
@@ -1,23 +1,23 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.id;
-
-/**
- * An identifiable object.
- *
- * @author Eike Stepper
- * @since 4.0
- * @apiviz.has {@link CDOID}
- */
-public interface CDOWithID
-{
- public CDOID cdoID();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.id;
+
+/**
+ * An identifiable object.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @apiviz.has {@link CDOID}
+ */
+public interface CDOWithID
+{
+ public CDOID cdoID();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/package-info.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/package-info.java
index 67bb822de0..a7b2bd498d 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/package-info.java
@@ -1,15 +1,15 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-
-/**
- * Common concepts for dealing with object and revision IDs.
- */
-package org.eclipse.emf.cdo.common.id;
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Common concepts for dealing with object and revision IDs.
+ */
+package org.eclipse.emf.cdo.common.id;
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOBlob.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOBlob.java
index c3c2bb78f1..538e30ba74 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOBlob.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOBlob.java
@@ -1,60 +1,60 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lob;
-
-import org.eclipse.emf.cdo.spi.common.CDOLobStoreImpl;
-
-import org.eclipse.net4j.util.io.ExtendedDataInput;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * A identifiable binary large object with streaming support.
- *
- * @author Eike Stepper
- * @since 4.0
- * @apiviz.landmark
- */
-public final class CDOBlob extends CDOLob<InputStream>
-{
- public CDOBlob(InputStream contents) throws IOException
- {
- super(contents, CDOLobStoreImpl.INSTANCE);
- }
-
- public CDOBlob(InputStream contents, CDOLobStore store) throws IOException
- {
- super(contents, store);
- }
-
- CDOBlob(byte[] id, long size)
- {
- super(id, size);
- }
-
- CDOBlob(ExtendedDataInput in) throws IOException
- {
- super(in);
- }
-
- @Override
- public InputStream getContents() throws IOException
- {
- return getStore().getBinary(this);
- }
-
- @Override
- protected CDOLobInfo put(InputStream contents) throws IOException
- {
- return getStore().putBinary(contents);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lob;
+
+import org.eclipse.emf.cdo.spi.common.CDOLobStoreImpl;
+
+import org.eclipse.net4j.util.io.ExtendedDataInput;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * A identifiable binary large object with streaming support.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @apiviz.landmark
+ */
+public final class CDOBlob extends CDOLob<InputStream>
+{
+ public CDOBlob(InputStream contents) throws IOException
+ {
+ super(contents, CDOLobStoreImpl.INSTANCE);
+ }
+
+ public CDOBlob(InputStream contents, CDOLobStore store) throws IOException
+ {
+ super(contents, store);
+ }
+
+ CDOBlob(byte[] id, long size)
+ {
+ super(id, size);
+ }
+
+ CDOBlob(ExtendedDataInput in) throws IOException
+ {
+ super(in);
+ }
+
+ @Override
+ public InputStream getContents() throws IOException
+ {
+ return getStore().getBinary(this);
+ }
+
+ @Override
+ protected CDOLobInfo put(InputStream contents) throws IOException
+ {
+ return getStore().putBinary(contents);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOClob.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOClob.java
index 8d195a4605..7f33031113 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOClob.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOClob.java
@@ -1,60 +1,60 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lob;
-
-import org.eclipse.emf.cdo.spi.common.CDOLobStoreImpl;
-
-import org.eclipse.net4j.util.io.ExtendedDataInput;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/**
- * A identifiable character large object with streaming support.
- *
- * @author Eike Stepper
- * @since 4.0
- * @apiviz.landmark
- */
-public final class CDOClob extends CDOLob<Reader>
-{
- public CDOClob(Reader contents) throws IOException
- {
- super(contents, CDOLobStoreImpl.INSTANCE);
- }
-
- public CDOClob(Reader contents, CDOLobStore store) throws IOException
- {
- super(contents, store);
- }
-
- CDOClob(byte[] id, long size)
- {
- super(id, size);
- }
-
- CDOClob(ExtendedDataInput in) throws IOException
- {
- super(in);
- }
-
- @Override
- public Reader getContents() throws IOException
- {
- return getStore().getCharacter(this);
- }
-
- @Override
- protected CDOLobInfo put(Reader contents) throws IOException
- {
- return getStore().putCharacter(contents);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lob;
+
+import org.eclipse.emf.cdo.spi.common.CDOLobStoreImpl;
+
+import org.eclipse.net4j.util.io.ExtendedDataInput;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * A identifiable character large object with streaming support.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @apiviz.landmark
+ */
+public final class CDOClob extends CDOLob<Reader>
+{
+ public CDOClob(Reader contents) throws IOException
+ {
+ super(contents, CDOLobStoreImpl.INSTANCE);
+ }
+
+ public CDOClob(Reader contents, CDOLobStore store) throws IOException
+ {
+ super(contents, store);
+ }
+
+ CDOClob(byte[] id, long size)
+ {
+ super(id, size);
+ }
+
+ CDOClob(ExtendedDataInput in) throws IOException
+ {
+ super(in);
+ }
+
+ @Override
+ public Reader getContents() throws IOException
+ {
+ return getStore().getCharacter(this);
+ }
+
+ @Override
+ protected CDOLobInfo put(Reader contents) throws IOException
+ {
+ return getStore().putCharacter(contents);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLob.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLob.java
index e1621d76ef..9089ee4a54 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLob.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLob.java
@@ -1,69 +1,69 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lob;
-
-import org.eclipse.net4j.util.io.ExtendedDataInput;
-import org.eclipse.net4j.util.io.ExtendedDataOutput;
-
-import java.io.IOException;
-
-/**
- * A identifiable large object with streaming support.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public abstract class CDOLob<IO> extends CDOLobInfo
-{
- private CDOLobStore store;
-
- CDOLob(byte[] id, long size)
- {
- this.id = id;
- this.size = size;
- }
-
- CDOLob(IO contents, CDOLobStore store) throws IOException
- {
- this.store = store;
- CDOLobInfo info = put(contents);
- id = info.getID();
- size = info.getSize();
- }
-
- CDOLob(ExtendedDataInput in) throws IOException
- {
- id = in.readByteArray();
- size = in.readLong();
- }
-
- final void write(ExtendedDataOutput out) throws IOException
- {
- out.writeByteArray(id);
- out.writeLong(size);
- }
-
- final void setStore(CDOLobStore store)
- {
- this.store = store;
- }
-
- public final CDOLobStore getStore()
- {
- return store;
- }
-
- public abstract IO getContents() throws IOException;
-
- protected abstract CDOLobInfo put(IO contents) throws IOException;
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lob;
+
+import org.eclipse.net4j.util.io.ExtendedDataInput;
+import org.eclipse.net4j.util.io.ExtendedDataOutput;
+
+import java.io.IOException;
+
+/**
+ * A identifiable large object with streaming support.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public abstract class CDOLob<IO> extends CDOLobInfo
+{
+ private CDOLobStore store;
+
+ CDOLob(byte[] id, long size)
+ {
+ this.id = id;
+ this.size = size;
+ }
+
+ CDOLob(IO contents, CDOLobStore store) throws IOException
+ {
+ this.store = store;
+ CDOLobInfo info = put(contents);
+ id = info.getID();
+ size = info.getSize();
+ }
+
+ CDOLob(ExtendedDataInput in) throws IOException
+ {
+ id = in.readByteArray();
+ size = in.readLong();
+ }
+
+ final void write(ExtendedDataOutput out) throws IOException
+ {
+ out.writeByteArray(id);
+ out.writeLong(size);
+ }
+
+ final void setStore(CDOLobStore store)
+ {
+ this.store = store;
+ }
+
+ public final CDOLobStore getStore()
+ {
+ return store;
+ }
+
+ public abstract IO getContents() throws IOException;
+
+ protected abstract CDOLobInfo put(IO contents) throws IOException;
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobHandler.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobHandler.java
index 0262df1275..be95179dc3 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobHandler.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobHandler.java
@@ -1,41 +1,41 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lob;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-/**
- * A callback interface for handling large objects.
- *
- * @author Eike Stepper
- * @since 4.0
- * @apiviz.uses {@link CDOLob} - - handles
- */
-public interface CDOLobHandler
-{
- /**
- * A callback method for handling a {@link CDOBlob binary large object}. The {@link CDOLob#getID() ID} and
- * {@link CDOLob#getSize() size} of the blob are passed by the caller. The implementor may return a
- * {@link OutputStream stream} that the blob content will be written to by the caller of this method, or
- * <code>null</code> to indicate that the content is not needed.
- */
- public OutputStream handleBlob(byte[] id, long size) throws IOException;
-
- /**
- * A callback method for handling a {@link CDOClob character large object}. The {@link CDOLob#getID() ID} and
- * {@link CDOLob#getSize() size} of the blob are passed by the caller. The implementor may return a {@link Writer
- * writer} that the blob content will be written to by the caller of this method, or <code>null</code> to indicate
- * that the content is not needed.
- */
- public Writer handleClob(byte[] id, long size) throws IOException;
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lob;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+
+/**
+ * A callback interface for handling large objects.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @apiviz.uses {@link CDOLob} - - handles
+ */
+public interface CDOLobHandler
+{
+ /**
+ * A callback method for handling a {@link CDOBlob binary large object}. The {@link CDOLob#getID() ID} and
+ * {@link CDOLob#getSize() size} of the blob are passed by the caller. The implementor may return a
+ * {@link OutputStream stream} that the blob content will be written to by the caller of this method, or
+ * <code>null</code> to indicate that the content is not needed.
+ */
+ public OutputStream handleBlob(byte[] id, long size) throws IOException;
+
+ /**
+ * A callback method for handling a {@link CDOClob character large object}. The {@link CDOLob#getID() ID} and
+ * {@link CDOLob#getSize() size} of the blob are passed by the caller. The implementor may return a {@link Writer
+ * writer} that the blob content will be written to by the caller of this method, or <code>null</code> to indicate
+ * that the content is not needed.
+ */
+ public Writer handleClob(byte[] id, long size) throws IOException;
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobInfo.java
index 05a4319be0..e106edfa17 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobInfo.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobInfo.java
@@ -1,59 +1,59 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lob;
-
-import org.eclipse.net4j.util.HexUtil;
-
-import java.text.MessageFormat;
-
-/**
- * Encapsulates {@link #getID() ID} and {@link #getSize() size} of a {@link CDOLob large object}.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class CDOLobInfo
-{
- byte[] id;
-
- long size;
-
- CDOLobInfo()
- {
- }
-
- public CDOLobInfo(byte[] id, long size)
- {
- this.id = id;
- this.size = size;
- }
-
- /**
- * The identifier of this large object. A SHA-1 digest of the content of this large object.
- */
- public final byte[] getID()
- {
- return id;
- }
-
- public final long getSize()
- {
- return size;
- }
-
- @Override
- public String toString()
- {
- return MessageFormat.format("{0}[id={1}, size={2}]", getClass().getSimpleName(), HexUtil.bytesToHex(id), size);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lob;
+
+import org.eclipse.net4j.util.HexUtil;
+
+import java.text.MessageFormat;
+
+/**
+ * Encapsulates {@link #getID() ID} and {@link #getSize() size} of a {@link CDOLob large object}.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ */
+public class CDOLobInfo
+{
+ byte[] id;
+
+ long size;
+
+ CDOLobInfo()
+ {
+ }
+
+ public CDOLobInfo(byte[] id, long size)
+ {
+ this.id = id;
+ this.size = size;
+ }
+
+ /**
+ * The identifier of this large object. A SHA-1 digest of the content of this large object.
+ */
+ public final byte[] getID()
+ {
+ return id;
+ }
+
+ public final long getSize()
+ {
+ return size;
+ }
+
+ @Override
+ public String toString()
+ {
+ return MessageFormat.format("{0}[id={1}, size={2}]", getClass().getSimpleName(), HexUtil.bytesToHex(id), size);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobStore.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobStore.java
index 66d3a421a8..16680ceb09 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobStore.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobStore.java
@@ -1,78 +1,78 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lob;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-/**
- * Stores and loads {@link CDOLob large objects}.
- *
- * @author Eike Stepper
- * @since 4.0
- * @apiviz.composedOf {@link CDOLob}
- */
-public interface CDOLobStore
-{
- public File getBinaryFile(byte[] id);
-
- public InputStream getBinary(CDOLobInfo info) throws IOException;
-
- public CDOLobInfo putBinary(InputStream contents) throws IOException;
-
- public File getCharacterFile(byte[] id);
-
- public Reader getCharacter(CDOLobInfo info) throws IOException;
-
- public CDOLobInfo putCharacter(Reader contents) throws IOException;
-
- /**
- * An abstract {@link CDOLobStore large object store} that delegates all method calls to a delegate.
- *
- * @author Eike Stepper
- */
- public static abstract class Delegating implements CDOLobStore
- {
- public File getBinaryFile(byte[] id)
- {
- return getDelegate().getBinaryFile(id);
- }
-
- public InputStream getBinary(CDOLobInfo info) throws IOException
- {
- return getDelegate().getBinary(info);
- }
-
- public CDOLobInfo putBinary(InputStream contents) throws IOException
- {
- return getDelegate().putBinary(contents);
- }
-
- public File getCharacterFile(byte[] id)
- {
- return getDelegate().getCharacterFile(id);
- }
-
- public Reader getCharacter(CDOLobInfo info) throws IOException
- {
- return getDelegate().getCharacter(info);
- }
-
- public CDOLobInfo putCharacter(Reader contents) throws IOException
- {
- return getDelegate().putCharacter(contents);
- }
-
- protected abstract CDOLobStore getDelegate();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lob;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+/**
+ * Stores and loads {@link CDOLob large objects}.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @apiviz.composedOf {@link CDOLob}
+ */
+public interface CDOLobStore
+{
+ public File getBinaryFile(byte[] id);
+
+ public InputStream getBinary(CDOLobInfo info) throws IOException;
+
+ public CDOLobInfo putBinary(InputStream contents) throws IOException;
+
+ public File getCharacterFile(byte[] id);
+
+ public Reader getCharacter(CDOLobInfo info) throws IOException;
+
+ public CDOLobInfo putCharacter(Reader contents) throws IOException;
+
+ /**
+ * An abstract {@link CDOLobStore large object store} that delegates all method calls to a delegate.
+ *
+ * @author Eike Stepper
+ */
+ public static abstract class Delegating implements CDOLobStore
+ {
+ public File getBinaryFile(byte[] id)
+ {
+ return getDelegate().getBinaryFile(id);
+ }
+
+ public InputStream getBinary(CDOLobInfo info) throws IOException
+ {
+ return getDelegate().getBinary(info);
+ }
+
+ public CDOLobInfo putBinary(InputStream contents) throws IOException
+ {
+ return getDelegate().putBinary(contents);
+ }
+
+ public File getCharacterFile(byte[] id)
+ {
+ return getDelegate().getCharacterFile(id);
+ }
+
+ public Reader getCharacter(CDOLobInfo info) throws IOException
+ {
+ return getDelegate().getCharacter(info);
+ }
+
+ public CDOLobInfo putCharacter(Reader contents) throws IOException
+ {
+ return getDelegate().putCharacter(contents);
+ }
+
+ protected abstract CDOLobStore getDelegate();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobUtil.java
index 132c763fc8..ff352f4861 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/CDOLobUtil.java
@@ -1,59 +1,59 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lob;
-
-import org.eclipse.net4j.util.io.ExtendedDataInput;
-import org.eclipse.net4j.util.io.ExtendedDataOutput;
-
-import java.io.IOException;
-
-/**
- * Some useful helpers for dealing with {@link CDOLob large objects}.
- *
- * @author Eike Stepper
- * @since 4.0
- */
-public final class CDOLobUtil
-{
- private CDOLobUtil()
- {
- }
-
- public static CDOBlob readBlob(ExtendedDataInput in) throws IOException
- {
- return new CDOBlob(in);
- }
-
- public static CDOClob readClob(ExtendedDataInput in) throws IOException
- {
- return new CDOClob(in);
- }
-
- public static void write(ExtendedDataOutput out, CDOLob<?> lob) throws IOException
- {
- lob.write(out);
- }
-
- public static CDOBlob createBlob(byte[] id, long size)
- {
- return new CDOBlob(id, size);
- }
-
- public static CDOClob createClob(byte[] id, long size)
- {
- return new CDOClob(id, size);
- }
-
- public static void setStore(CDOLobStore store, CDOLob<?> lob) throws IOException
- {
- lob.setStore(store);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lob;
+
+import org.eclipse.net4j.util.io.ExtendedDataInput;
+import org.eclipse.net4j.util.io.ExtendedDataOutput;
+
+import java.io.IOException;
+
+/**
+ * Some useful helpers for dealing with {@link CDOLob large objects}.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ */
+public final class CDOLobUtil
+{
+ private CDOLobUtil()
+ {
+ }
+
+ public static CDOBlob readBlob(ExtendedDataInput in) throws IOException
+ {
+ return new CDOBlob(in);
+ }
+
+ public static CDOClob readClob(ExtendedDataInput in) throws IOException
+ {
+ return new CDOClob(in);
+ }
+
+ public static void write(ExtendedDataOutput out, CDOLob<?> lob) throws IOException
+ {
+ lob.write(out);
+ }
+
+ public static CDOBlob createBlob(byte[] id, long size)
+ {
+ return new CDOBlob(id, size);
+ }
+
+ public static CDOClob createClob(byte[] id, long size)
+ {
+ return new CDOClob(id, size);
+ }
+
+ public static void setStore(CDOLobStore store, CDOLob<?> lob) throws IOException
+ {
+ lob.setStore(store);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/package-info.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/package-info.java
index 6d80513cc1..6e5296c977 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lob/package-info.java
@@ -1,15 +1,15 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-
-/**
- * Common concepts for dealing with large binary objects and large character objects.
- */
-package org.eclipse.emf.cdo.common.lob;
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Common concepts for dealing with large binary objects and large character objects.
+ */
+package org.eclipse.emf.cdo.common.lob;
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockChangeInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockChangeInfo.java
index 117f8bb176..54042c3f86 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockChangeInfo.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockChangeInfo.java
@@ -1,79 +1,79 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Caspar De Groot - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lock;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-
-import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
-
-/**
- * Represents a change in the lock state of a set of objects. Instances are meant to be sent from the server to the
- * client for the purpose of notifying the latter.
- *
- * @author Caspar De Groot
- * @since 4.1
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.has {@link CDOLockOwner}
- * @apiviz.has {@link CDOLockChangeInfo.Operation}
- * @apiviz.has {@link org.eclipse.net4j.util.concurrent.IRWLockManager.LockType}
- * @apiviz.composedOf {@link CDOLockState}
- */
-public interface CDOLockChangeInfo extends CDOBranchPoint
-{
- /**
- * @return <code>true</code> if this instance signals that all {@link CDOLockState lockstates} must be invalidated,
- * <code>false</code> otherwise
- */
- public boolean isInvalidateAll();
-
- /**
- * @return The branch at which the lock changes took place, same as <code>getView().getBranch()</code>.
- */
- public CDOBranch getBranch();
-
- /**
- * @return The repository time at which the lock changes took place. This is only an informal indication; no formal
- * relation (e.g. an ordering) with commit timestamps is guaranteed.
- */
- public long getTimeStamp();
-
- /**
- * @return The view, represented as a {@link CDOLockOwner}, that authored the lock changes.
- */
- public CDOLockOwner getLockOwner();
-
- /**
- * @return The new lock states of the objects that were affected by the change
- */
- public CDOLockState[] getLockStates();
-
- /**
- * @return the type of lock operation that caused the lock changes
- */
- public Operation getOperation();
-
- /**
- * @return the type of locks that were affected by the lock operation
- */
- public LockType getLockType();
-
- /**
- * Enumerates the possible locking operations.
- *
- * @author Caspar De Groot
- */
- public enum Operation
- {
- LOCK, UNLOCK
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Caspar De Groot - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lock;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+
+import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
+
+/**
+ * Represents a change in the lock state of a set of objects. Instances are meant to be sent from the server to the
+ * client for the purpose of notifying the latter.
+ *
+ * @author Caspar De Groot
+ * @since 4.1
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.has {@link CDOLockOwner}
+ * @apiviz.has {@link CDOLockChangeInfo.Operation}
+ * @apiviz.has {@link org.eclipse.net4j.util.concurrent.IRWLockManager.LockType}
+ * @apiviz.composedOf {@link CDOLockState}
+ */
+public interface CDOLockChangeInfo extends CDOBranchPoint
+{
+ /**
+ * @return <code>true</code> if this instance signals that all {@link CDOLockState lockstates} must be invalidated,
+ * <code>false</code> otherwise
+ */
+ public boolean isInvalidateAll();
+
+ /**
+ * @return The branch at which the lock changes took place, same as <code>getView().getBranch()</code>.
+ */
+ public CDOBranch getBranch();
+
+ /**
+ * @return The repository time at which the lock changes took place. This is only an informal indication; no formal
+ * relation (e.g. an ordering) with commit timestamps is guaranteed.
+ */
+ public long getTimeStamp();
+
+ /**
+ * @return The view, represented as a {@link CDOLockOwner}, that authored the lock changes.
+ */
+ public CDOLockOwner getLockOwner();
+
+ /**
+ * @return The new lock states of the objects that were affected by the change
+ */
+ public CDOLockState[] getLockStates();
+
+ /**
+ * @return the type of lock operation that caused the lock changes
+ */
+ public Operation getOperation();
+
+ /**
+ * @return the type of locks that were affected by the lock operation
+ */
+ public LockType getLockType();
+
+ /**
+ * Enumerates the possible locking operations.
+ *
+ * @author Caspar De Groot
+ */
+ public enum Operation
+ {
+ LOCK, UNLOCK
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockChangeInfoHandler.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockChangeInfoHandler.java
index e2a0047760..d7e283823d 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockChangeInfoHandler.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockChangeInfoHandler.java
@@ -1,23 +1,23 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Caspar De Groot - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lock;
-
-/**
- * A call-back interface that indicates the ability to <i>handle</i> {@link CDOLockChangeInfo lock-change infos} that
- * are passed from other entities.
- *
- * @author Caspar De Groot
- * @since 4.1
- */
-public interface CDOLockChangeInfoHandler
-{
- public void handleLockChangeInfo(CDOLockChangeInfo lockChangeInfo);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Caspar De Groot - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lock;
+
+/**
+ * A call-back interface that indicates the ability to <i>handle</i> {@link CDOLockChangeInfo lock-change infos} that
+ * are passed from other entities.
+ *
+ * @author Caspar De Groot
+ * @since 4.1
+ */
+public interface CDOLockChangeInfoHandler
+{
+ public void handleLockChangeInfo(CDOLockChangeInfo lockChangeInfo);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockOwner.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockOwner.java
index fda27b77a8..1a5b5ed2c5 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockOwner.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockOwner.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Caspar De Groot - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lock;
-
-/**
- * A client-side representation of a view owning locks.
- * <p>
- *
- * @author Caspar De Groot
- * @since 4.1
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOLockOwner
-{
- /**
- * @return the ID identifying the session that owns the view
- */
- public int getSessionID();
-
- /**
- * @return the ID identifying the view within the session
- */
- public int getViewID();
-
- public String getDurableLockingID();
-
- public boolean isDurableView();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Caspar De Groot - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lock;
+
+/**
+ * A client-side representation of a view owning locks.
+ * <p>
+ *
+ * @author Caspar De Groot
+ * @since 4.1
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOLockOwner
+{
+ /**
+ * @return the ID identifying the session that owns the view
+ */
+ public int getSessionID();
+
+ /**
+ * @return the ID identifying the view within the session
+ */
+ public int getViewID();
+
+ public String getDurableLockingID();
+
+ public boolean isDurableView();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockState.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockState.java
index 78f423c7c4..b959340c39 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockState.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockState.java
@@ -1,61 +1,61 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Caspar De Groot - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lock;
-
-import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.revision.CDOIDAndBranch;
-
-import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
-
-import java.util.Set;
-
-/**
- * A client-side representation of <i>all</i> the locks on a single CDOObject.
- * <p>
- * As an individual lock is always owned by view, which in turn is owned by a session, the methods on this interface
- * return instances of {@link CDOLockOwner} which carry that information.
- * <p>
- *
- * @author Caspar De Groot
- * @since 4.1
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.has {@link java.lang.Object} oneway - - lockedObject
- * @apiviz.owns {@link CDOLockOwner} - - readLockOwners
- * @apiviz.has {@link CDOLockOwner} oneway - - writeLockOwner
- * @apiviz.has {@link CDOLockOwner} oneway - - writeOptionOwner
- */
-public interface CDOLockState
-{
- /**
- * Gets a unique identifier for the object that is locked; typically a {@link CDOID} or a {@link CDOIDAndBranch},
- * depending on whether branching support is enabled or not
- *
- * @return the identifier
- */
- public Object getLockedObject();
-
- /**
- * If the 'others' argument is <code>false</code>, this method returns <code>true</code> if this lock is currently
- * held by the <i>requesting</i> CDOView, <code>false</code> otherwise.
- * <p>
- * If the 'others' argument is <code>true</code>, this method returns <code>true</code> if this lock is currently held
- * by <i>another</i> view (i.e. any view different from the requesting one), <code>false</code> otherwise.
- */
- public boolean isLocked(LockType lockType, CDOLockOwner lockOwner, boolean others);
-
- public Set<CDOLockOwner> getReadLockOwners();
-
- public CDOLockOwner getWriteLockOwner();
-
- public CDOLockOwner getWriteOptionOwner();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Caspar De Groot - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lock;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.revision.CDOIDAndBranch;
+
+import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
+
+import java.util.Set;
+
+/**
+ * A client-side representation of <i>all</i> the locks on a single CDOObject.
+ * <p>
+ * As an individual lock is always owned by view, which in turn is owned by a session, the methods on this interface
+ * return instances of {@link CDOLockOwner} which carry that information.
+ * <p>
+ *
+ * @author Caspar De Groot
+ * @since 4.1
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.has {@link java.lang.Object} oneway - - lockedObject
+ * @apiviz.owns {@link CDOLockOwner} - - readLockOwners
+ * @apiviz.has {@link CDOLockOwner} oneway - - writeLockOwner
+ * @apiviz.has {@link CDOLockOwner} oneway - - writeOptionOwner
+ */
+public interface CDOLockState
+{
+ /**
+ * Gets a unique identifier for the object that is locked; typically a {@link CDOID} or a {@link CDOIDAndBranch},
+ * depending on whether branching support is enabled or not
+ *
+ * @return the identifier
+ */
+ public Object getLockedObject();
+
+ /**
+ * If the 'others' argument is <code>false</code>, this method returns <code>true</code> if this lock is currently
+ * held by the <i>requesting</i> CDOView, <code>false</code> otherwise.
+ * <p>
+ * If the 'others' argument is <code>true</code>, this method returns <code>true</code> if this lock is currently held
+ * by <i>another</i> view (i.e. any view different from the requesting one), <code>false</code> otherwise.
+ */
+ public boolean isLocked(LockType lockType, CDOLockOwner lockOwner, boolean others);
+
+ public Set<CDOLockOwner> getReadLockOwners();
+
+ public CDOLockOwner getWriteLockOwner();
+
+ public CDOLockOwner getWriteOptionOwner();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockUtil.java
index 03ef04127e..59a50452ac 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/CDOLockUtil.java
@@ -1,163 +1,163 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Caspar De Groot - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lock;
-
-import org.eclipse.emf.cdo.common.CDOCommonSession;
-import org.eclipse.emf.cdo.common.CDOCommonView;
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo.Operation;
-import org.eclipse.emf.cdo.common.lock.IDurableLockingManager.LockArea;
-import org.eclipse.emf.cdo.common.lock.IDurableLockingManager.LockGrade;
-import org.eclipse.emf.cdo.internal.common.lock.CDOLockAreaImpl;
-import org.eclipse.emf.cdo.internal.common.lock.CDOLockChangeInfoImpl;
-import org.eclipse.emf.cdo.internal.common.lock.CDOLockOwnerImpl;
-import org.eclipse.emf.cdo.internal.common.lock.CDOLockStateImpl;
-import org.eclipse.emf.cdo.spi.common.lock.InternalCDOLockState;
-
-import org.eclipse.net4j.util.CheckUtil;
-import org.eclipse.net4j.util.HexUtil;
-import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
-import org.eclipse.net4j.util.concurrent.RWOLockManager.LockState;
-
-import java.util.Map;
-import java.util.Random;
-
-/**
- * Various static methods that may help with classes related to CDO locks.
- *
- * @author Caspar De Groot
- * @since 4.1
- */
-public final class CDOLockUtil
-{
- private static final int DURABLE_SESSION_ID = 0;
-
- private static final int DURABLE_VIEW_ID = 0;
-
- private CDOLockUtil()
- {
- }
-
- public static CDOLockState copyLockState(CDOLockState lockState)
- {
- CheckUtil.checkArg(lockState instanceof CDOLockStateImpl, "lockState instanceof CDOLockStateImpl");
- return ((CDOLockStateImpl)lockState).copy();
- }
-
- public static CDOLockState createLockState(Object target)
- {
- return new CDOLockStateImpl(target);
- }
-
- public static CDOLockState createLockState(LockState<Object, ? extends CDOCommonView> lockState)
- {
- CheckUtil.checkArg(lockState, "lockState");
- InternalCDOLockState cdoLockState = new CDOLockStateImpl(lockState.getLockedObject());
-
- for (CDOCommonView view : lockState.getReadLockOwners())
- {
- String durableLockingID = view.getDurableLockingID();
- int sessionID, viewID;
- CDOCommonSession session = view.getSession();
- boolean isDurableView = session == null;
- if (isDurableView)
- {
- sessionID = DURABLE_SESSION_ID;
- viewID = DURABLE_VIEW_ID;
- }
- else
- {
- sessionID = session.getSessionID();
- viewID = view.getViewID();
- }
-
- CDOLockOwner owner = new CDOLockOwnerImpl(sessionID, viewID, durableLockingID, isDurableView);
- cdoLockState.addReadLockOwner(owner);
- }
-
- CDOCommonView writeLockOwner = lockState.getWriteLockOwner();
- if (writeLockOwner != null)
- {
- CDOLockOwner owner = createLockOwner(writeLockOwner);
- cdoLockState.setWriteLockOwner(owner);
- }
-
- CDOCommonView writeOptionOwner = lockState.getWriteOptionOwner();
- if (writeOptionOwner != null)
- {
- CDOLockOwner owner = createLockOwner(writeOptionOwner);
- cdoLockState.setWriteOptionOwner(owner);
- }
-
- return cdoLockState;
- }
-
- public static CDOLockOwner createLockOwner(CDOCommonView view)
- {
- CDOCommonSession session = view.getSession();
- String durableLockingID = view.getDurableLockingID();
- if (session != null)
- {
- int sessionID = session.getSessionID();
- int viewID = view.getViewID();
- return new CDOLockOwnerImpl(sessionID, viewID, durableLockingID, false);
- }
-
- CheckUtil.checkNull(durableLockingID, "durableLockingID");
- return new CDOLockOwnerImpl(DURABLE_SESSION_ID, DURABLE_VIEW_ID, durableLockingID, true);
- }
-
- public static CDOLockChangeInfo createLockChangeInfo(long timestamp, CDOLockOwner lockOwner, CDOBranch branch,
- Operation op, LockType lockType, CDOLockState[] cdoLockStates)
- {
- return new CDOLockChangeInfoImpl(branch.getPoint(timestamp), lockOwner, cdoLockStates, op, lockType);
- }
-
- public static CDOLockChangeInfo createLockChangeInfo()
- {
- return new CDOLockChangeInfoImpl();
- }
-
- public static CDOLockChangeInfo createLockChangeInfo(long timestamp, CDOCommonView view, CDOBranch viewedBranch,
- Operation op, LockType lockType, CDOLockState[] cdoLockStates)
- {
- CDOLockOwner lockOwner = createLockOwner(view);
- return createLockChangeInfo(timestamp, lockOwner, viewedBranch, op, lockType, cdoLockStates);
- }
-
- public static LockArea createLockArea(String durableLockingID, String userID, CDOBranchPoint branchPoint,
- boolean readOnly, Map<CDOID, LockGrade> locks)
- {
- return new CDOLockAreaImpl(durableLockingID, userID, branchPoint, readOnly, locks);
- }
-
- public static LockArea createLockArea(String durableLockingID)
- {
- return new CDOLockAreaImpl(durableLockingID);
- }
-
- public static String createDurableLockingID()
- {
- return createDurableLockingID(LockArea.DEFAULT_DURABLE_LOCKING_ID_BYTES);
- }
-
- public static String createDurableLockingID(int bytes)
- {
- byte[] buffer = new byte[bytes];
-
- Random random = new Random(System.currentTimeMillis());
- random.nextBytes(buffer);
-
- return HexUtil.bytesToHex(buffer);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Caspar De Groot - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lock;
+
+import org.eclipse.emf.cdo.common.CDOCommonSession;
+import org.eclipse.emf.cdo.common.CDOCommonView;
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo.Operation;
+import org.eclipse.emf.cdo.common.lock.IDurableLockingManager.LockArea;
+import org.eclipse.emf.cdo.common.lock.IDurableLockingManager.LockGrade;
+import org.eclipse.emf.cdo.internal.common.lock.CDOLockAreaImpl;
+import org.eclipse.emf.cdo.internal.common.lock.CDOLockChangeInfoImpl;
+import org.eclipse.emf.cdo.internal.common.lock.CDOLockOwnerImpl;
+import org.eclipse.emf.cdo.internal.common.lock.CDOLockStateImpl;
+import org.eclipse.emf.cdo.spi.common.lock.InternalCDOLockState;
+
+import org.eclipse.net4j.util.CheckUtil;
+import org.eclipse.net4j.util.HexUtil;
+import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
+import org.eclipse.net4j.util.concurrent.RWOLockManager.LockState;
+
+import java.util.Map;
+import java.util.Random;
+
+/**
+ * Various static methods that may help with classes related to CDO locks.
+ *
+ * @author Caspar De Groot
+ * @since 4.1
+ */
+public final class CDOLockUtil
+{
+ private static final int DURABLE_SESSION_ID = 0;
+
+ private static final int DURABLE_VIEW_ID = 0;
+
+ private CDOLockUtil()
+ {
+ }
+
+ public static CDOLockState copyLockState(CDOLockState lockState)
+ {
+ CheckUtil.checkArg(lockState instanceof CDOLockStateImpl, "lockState instanceof CDOLockStateImpl");
+ return ((CDOLockStateImpl)lockState).copy();
+ }
+
+ public static CDOLockState createLockState(Object target)
+ {
+ return new CDOLockStateImpl(target);
+ }
+
+ public static CDOLockState createLockState(LockState<Object, ? extends CDOCommonView> lockState)
+ {
+ CheckUtil.checkArg(lockState, "lockState");
+ InternalCDOLockState cdoLockState = new CDOLockStateImpl(lockState.getLockedObject());
+
+ for (CDOCommonView view : lockState.getReadLockOwners())
+ {
+ String durableLockingID = view.getDurableLockingID();
+ int sessionID, viewID;
+ CDOCommonSession session = view.getSession();
+ boolean isDurableView = session == null;
+ if (isDurableView)
+ {
+ sessionID = DURABLE_SESSION_ID;
+ viewID = DURABLE_VIEW_ID;
+ }
+ else
+ {
+ sessionID = session.getSessionID();
+ viewID = view.getViewID();
+ }
+
+ CDOLockOwner owner = new CDOLockOwnerImpl(sessionID, viewID, durableLockingID, isDurableView);
+ cdoLockState.addReadLockOwner(owner);
+ }
+
+ CDOCommonView writeLockOwner = lockState.getWriteLockOwner();
+ if (writeLockOwner != null)
+ {
+ CDOLockOwner owner = createLockOwner(writeLockOwner);
+ cdoLockState.setWriteLockOwner(owner);
+ }
+
+ CDOCommonView writeOptionOwner = lockState.getWriteOptionOwner();
+ if (writeOptionOwner != null)
+ {
+ CDOLockOwner owner = createLockOwner(writeOptionOwner);
+ cdoLockState.setWriteOptionOwner(owner);
+ }
+
+ return cdoLockState;
+ }
+
+ public static CDOLockOwner createLockOwner(CDOCommonView view)
+ {
+ CDOCommonSession session = view.getSession();
+ String durableLockingID = view.getDurableLockingID();
+ if (session != null)
+ {
+ int sessionID = session.getSessionID();
+ int viewID = view.getViewID();
+ return new CDOLockOwnerImpl(sessionID, viewID, durableLockingID, false);
+ }
+
+ CheckUtil.checkNull(durableLockingID, "durableLockingID");
+ return new CDOLockOwnerImpl(DURABLE_SESSION_ID, DURABLE_VIEW_ID, durableLockingID, true);
+ }
+
+ public static CDOLockChangeInfo createLockChangeInfo(long timestamp, CDOLockOwner lockOwner, CDOBranch branch,
+ Operation op, LockType lockType, CDOLockState[] cdoLockStates)
+ {
+ return new CDOLockChangeInfoImpl(branch.getPoint(timestamp), lockOwner, cdoLockStates, op, lockType);
+ }
+
+ public static CDOLockChangeInfo createLockChangeInfo()
+ {
+ return new CDOLockChangeInfoImpl();
+ }
+
+ public static CDOLockChangeInfo createLockChangeInfo(long timestamp, CDOCommonView view, CDOBranch viewedBranch,
+ Operation op, LockType lockType, CDOLockState[] cdoLockStates)
+ {
+ CDOLockOwner lockOwner = createLockOwner(view);
+ return createLockChangeInfo(timestamp, lockOwner, viewedBranch, op, lockType, cdoLockStates);
+ }
+
+ public static LockArea createLockArea(String durableLockingID, String userID, CDOBranchPoint branchPoint,
+ boolean readOnly, Map<CDOID, LockGrade> locks)
+ {
+ return new CDOLockAreaImpl(durableLockingID, userID, branchPoint, readOnly, locks);
+ }
+
+ public static LockArea createLockArea(String durableLockingID)
+ {
+ return new CDOLockAreaImpl(durableLockingID);
+ }
+
+ public static String createDurableLockingID()
+ {
+ return createDurableLockingID(LockArea.DEFAULT_DURABLE_LOCKING_ID_BYTES);
+ }
+
+ public static String createDurableLockingID(int bytes)
+ {
+ byte[] buffer = new byte[bytes];
+
+ Random random = new Random(System.currentTimeMillis());
+ random.nextBytes(buffer);
+
+ return HexUtil.bytesToHex(buffer);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/IDurableLockingManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/IDurableLockingManager.java
index 7f3620a187..c08df3294c 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/IDurableLockingManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/IDurableLockingManager.java
@@ -1,302 +1,302 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.lock;
-
-import org.eclipse.emf.cdo.common.CDOCommonRepository;
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.id.CDOID;
-
-import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
-
-import java.util.Map;
-
-/**
- * Manages all persistent aspects of durable CDO views such as {@link CDOBranchPoint branch point} and acquired locks.
- *
- * @author Eike Stepper
- * @since 4.0
- * @apiviz.uses {@link IDurableLockingManager.LockArea} - - manages
- */
-public interface IDurableLockingManager
-{
- public LockArea createLockArea(String userID, CDOBranchPoint branchPoint, boolean readOnly,
- Map<CDOID, LockGrade> locks) throws LockAreaAlreadyExistsException;
-
- /**
- * Returns the {@link LockArea lock area} specified by the given durableLockingID, never <code>null</code>.
- *
- * @throws LockAreaNotFoundException
- * if the given durableLockingID is unknown.
- */
- public LockArea getLockArea(String durableLockingID) throws LockAreaNotFoundException;
-
- public void getLockAreas(String userIDPrefix, LockArea.Handler handler);
-
- public void deleteLockArea(String durableLockingID);
-
- /**
- * Encapsulates the persistable information about a single durable CDO view like {@link CDOBranchPoint branch point}
- * and acquired locks.
- *
- * @author Eike Stepper
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.composedOf {@link IDurableLockingManager.LockGrade} - - locks
- */
- public interface LockArea extends CDOBranchPoint
- {
- /**
- * @since 4.1
- */
- public static final int DEFAULT_DURABLE_LOCKING_ID_BYTES = 32;
-
- public String getDurableLockingID();
-
- public String getUserID();
-
- public boolean isReadOnly();
-
- public Map<CDOID, LockGrade> getLocks();
-
- /**
- * Returns <code>true</code> if this instance represents a lock area that is known to be missing (not present) on a
- * master server. (Relevant only in a replicating configuration.)
- *
- * @since 4.1
- */
- public boolean isMissing();
-
- /**
- * A call-back interface for <em>handling</em> {@link LockArea lock area} objects.
- *
- * @author Eike Stepper
- * @apiviz.uses {@link IDurableLockingManager.LockArea} - - handles
- */
- public interface Handler
- {
- public boolean handleLockArea(LockArea area);
- }
- }
-
- /**
- * Thrown if a {@link LockArea lock area} is spcified that does not exist in a CDO {@link CDOCommonRepository
- * repository}.
- *
- * @author Eike Stepper
- */
- public static class LockAreaNotFoundException extends IllegalStateException
- {
- private static final long serialVersionUID = 1L;
-
- private String durableLockingID;
-
- public LockAreaNotFoundException(String durableLockingID)
- {
- super("No lock area for ID=" + durableLockingID);
- this.durableLockingID = durableLockingID;
- }
-
- public LockAreaNotFoundException(String message, Throwable cause, String durableLockingID)
- {
- super(message, cause);
- this.durableLockingID = durableLockingID;
- }
-
- public String getDurableLockingID()
- {
- return durableLockingID;
- }
- }
-
- /**
- * Exception occurs when attempting to create a durable {@link LockArea} that already exists.
- *
- * @author Caspar De Groot
- * @since 4.1
- */
- public static class LockAreaAlreadyExistsException extends IllegalStateException
- {
- private static final long serialVersionUID = 1L;
-
- private String durableLockingID;
-
- public LockAreaAlreadyExistsException(String durableLockingID)
- {
- super("A lock area with ID=" + durableLockingID + " already exists");
- this.durableLockingID = durableLockingID;
- }
-
- public String getDurableLockingID()
- {
- return durableLockingID;
- }
- }
-
- /**
- * Enumerates the possible combinations of read and write locks on a single CDO object.
- *
- * @author Eike Stepper
- * @noextend This interface is not intended to be extended by clients.
- */
- public enum LockGrade
- {
- NONE(0), READ(1), WRITE(2), READ_WRITE(READ.getValue() | WRITE.getValue()),
-
- /**
- * @since 4.1
- */
- OPTION(4),
-
- /**
- * @since 4.1
- */
- READ_OPTION(READ.getValue() | OPTION.getValue()),
-
- /**
- * @since 4.1
- */
- WRITE_OPTION(WRITE.getValue() | OPTION.getValue()),
-
- /**
- * @since 4.1
- */
- READ_WRITE_OPTION(READ.getValue() | WRITE.getValue() | OPTION.getValue());
-
- private final int value;
-
- private LockGrade(int value)
- {
- this.value = value;
- }
-
- public int getValue()
- {
- return value;
- }
-
- public boolean isRead()
- {
- return (value & 1) != 0;
- }
-
- public boolean isWrite()
- {
- return (value & 2) != 0;
- }
-
- /**
- * @since 4.1
- */
- public boolean isOption()
- {
- return (value & 4) != 0;
- }
-
- public LockGrade getUpdated(LockType type, boolean on)
- {
- int mask = getMask(type);
-
- if (on)
- {
- return get(value | mask);
- }
-
- return get(value & ~mask);
- }
-
- private int getMask(LockType type)
- {
- switch (type)
- {
- case READ:
- return 1;
-
- case WRITE:
- return 2;
-
- case OPTION:
- return 4;
- }
-
- return 0;
- }
-
- public static LockGrade get(LockType type)
- {
- if (type == LockType.READ)
- {
- return READ;
- }
-
- if (type == LockType.WRITE)
- {
- return WRITE;
- }
-
- if (type == LockType.OPTION)
- {
- return OPTION;
- }
-
- return NONE;
- }
-
- /**
- * @deprecated Use {@link #get(boolean, boolean, boolean)}
- */
- @Deprecated
- public static LockGrade get(boolean read, boolean write)
- {
- return get((read ? 1 : 0) | (write ? 2 : 0));
- }
-
- /**
- * @since 4.1
- */
- public static LockGrade get(boolean read, boolean write, boolean option)
- {
- return get((read ? 1 : 0) | (write ? 2 : 0) | (option ? 4 : 0));
- }
-
- public static LockGrade get(int value)
- {
- switch (value)
- {
- case 0:
- return NONE;
-
- case 1:
- return READ;
-
- case 2:
- return WRITE;
-
- case 3:
- return READ_WRITE;
-
- case 4:
- return OPTION;
-
- case 1 | 4:
- return READ_OPTION;
-
- case 2 | 4:
- return WRITE_OPTION;
-
- case 1 | 2 | 4:
- return READ_WRITE_OPTION;
-
- default:
- throw new IllegalArgumentException("Invalid lock grade: " + value);
- }
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.lock;
+
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.id.CDOID;
+
+import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
+
+import java.util.Map;
+
+/**
+ * Manages all persistent aspects of durable CDO views such as {@link CDOBranchPoint branch point} and acquired locks.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @apiviz.uses {@link IDurableLockingManager.LockArea} - - manages
+ */
+public interface IDurableLockingManager
+{
+ public LockArea createLockArea(String userID, CDOBranchPoint branchPoint, boolean readOnly,
+ Map<CDOID, LockGrade> locks) throws LockAreaAlreadyExistsException;
+
+ /**
+ * Returns the {@link LockArea lock area} specified by the given durableLockingID, never <code>null</code>.
+ *
+ * @throws LockAreaNotFoundException
+ * if the given durableLockingID is unknown.
+ */
+ public LockArea getLockArea(String durableLockingID) throws LockAreaNotFoundException;
+
+ public void getLockAreas(String userIDPrefix, LockArea.Handler handler);
+
+ public void deleteLockArea(String durableLockingID);
+
+ /**
+ * Encapsulates the persistable information about a single durable CDO view like {@link CDOBranchPoint branch point}
+ * and acquired locks.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.composedOf {@link IDurableLockingManager.LockGrade} - - locks
+ */
+ public interface LockArea extends CDOBranchPoint
+ {
+ /**
+ * @since 4.1
+ */
+ public static final int DEFAULT_DURABLE_LOCKING_ID_BYTES = 32;
+
+ public String getDurableLockingID();
+
+ public String getUserID();
+
+ public boolean isReadOnly();
+
+ public Map<CDOID, LockGrade> getLocks();
+
+ /**
+ * Returns <code>true</code> if this instance represents a lock area that is known to be missing (not present) on a
+ * master server. (Relevant only in a replicating configuration.)
+ *
+ * @since 4.1
+ */
+ public boolean isMissing();
+
+ /**
+ * A call-back interface for <em>handling</em> {@link LockArea lock area} objects.
+ *
+ * @author Eike Stepper
+ * @apiviz.uses {@link IDurableLockingManager.LockArea} - - handles
+ */
+ public interface Handler
+ {
+ public boolean handleLockArea(LockArea area);
+ }
+ }
+
+ /**
+ * Thrown if a {@link LockArea lock area} is spcified that does not exist in a CDO {@link CDOCommonRepository
+ * repository}.
+ *
+ * @author Eike Stepper
+ */
+ public static class LockAreaNotFoundException extends IllegalStateException
+ {
+ private static final long serialVersionUID = 1L;
+
+ private String durableLockingID;
+
+ public LockAreaNotFoundException(String durableLockingID)
+ {
+ super("No lock area for ID=" + durableLockingID);
+ this.durableLockingID = durableLockingID;
+ }
+
+ public LockAreaNotFoundException(String message, Throwable cause, String durableLockingID)
+ {
+ super(message, cause);
+ this.durableLockingID = durableLockingID;
+ }
+
+ public String getDurableLockingID()
+ {
+ return durableLockingID;
+ }
+ }
+
+ /**
+ * Exception occurs when attempting to create a durable {@link LockArea} that already exists.
+ *
+ * @author Caspar De Groot
+ * @since 4.1
+ */
+ public static class LockAreaAlreadyExistsException extends IllegalStateException
+ {
+ private static final long serialVersionUID = 1L;
+
+ private String durableLockingID;
+
+ public LockAreaAlreadyExistsException(String durableLockingID)
+ {
+ super("A lock area with ID=" + durableLockingID + " already exists");
+ this.durableLockingID = durableLockingID;
+ }
+
+ public String getDurableLockingID()
+ {
+ return durableLockingID;
+ }
+ }
+
+ /**
+ * Enumerates the possible combinations of read and write locks on a single CDO object.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ */
+ public enum LockGrade
+ {
+ NONE(0), READ(1), WRITE(2), READ_WRITE(READ.getValue() | WRITE.getValue()),
+
+ /**
+ * @since 4.1
+ */
+ OPTION(4),
+
+ /**
+ * @since 4.1
+ */
+ READ_OPTION(READ.getValue() | OPTION.getValue()),
+
+ /**
+ * @since 4.1
+ */
+ WRITE_OPTION(WRITE.getValue() | OPTION.getValue()),
+
+ /**
+ * @since 4.1
+ */
+ READ_WRITE_OPTION(READ.getValue() | WRITE.getValue() | OPTION.getValue());
+
+ private final int value;
+
+ private LockGrade(int value)
+ {
+ this.value = value;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public boolean isRead()
+ {
+ return (value & 1) != 0;
+ }
+
+ public boolean isWrite()
+ {
+ return (value & 2) != 0;
+ }
+
+ /**
+ * @since 4.1
+ */
+ public boolean isOption()
+ {
+ return (value & 4) != 0;
+ }
+
+ public LockGrade getUpdated(LockType type, boolean on)
+ {
+ int mask = getMask(type);
+
+ if (on)
+ {
+ return get(value | mask);
+ }
+
+ return get(value & ~mask);
+ }
+
+ private int getMask(LockType type)
+ {
+ switch (type)
+ {
+ case READ:
+ return 1;
+
+ case WRITE:
+ return 2;
+
+ case OPTION:
+ return 4;
+ }
+
+ return 0;
+ }
+
+ public static LockGrade get(LockType type)
+ {
+ if (type == LockType.READ)
+ {
+ return READ;
+ }
+
+ if (type == LockType.WRITE)
+ {
+ return WRITE;
+ }
+
+ if (type == LockType.OPTION)
+ {
+ return OPTION;
+ }
+
+ return NONE;
+ }
+
+ /**
+ * @deprecated Use {@link #get(boolean, boolean, boolean)}
+ */
+ @Deprecated
+ public static LockGrade get(boolean read, boolean write)
+ {
+ return get((read ? 1 : 0) | (write ? 2 : 0));
+ }
+
+ /**
+ * @since 4.1
+ */
+ public static LockGrade get(boolean read, boolean write, boolean option)
+ {
+ return get((read ? 1 : 0) | (write ? 2 : 0) | (option ? 4 : 0));
+ }
+
+ public static LockGrade get(int value)
+ {
+ switch (value)
+ {
+ case 0:
+ return NONE;
+
+ case 1:
+ return READ;
+
+ case 2:
+ return WRITE;
+
+ case 3:
+ return READ_WRITE;
+
+ case 4:
+ return OPTION;
+
+ case 1 | 4:
+ return READ_OPTION;
+
+ case 2 | 4:
+ return WRITE_OPTION;
+
+ case 1 | 2 | 4:
+ return READ_WRITE_OPTION;
+
+ default:
+ throw new IllegalArgumentException("Invalid lock grade: " + value);
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/package-info.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/package-info.java
index daf76d03b3..f2d6965c6a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/package-info.java
@@ -1,18 +1,18 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-
-/**
- * Common concepts for dealing with durable locks and views.
- *
- * @apiviz.exclude .*Exception
- */
-package org.eclipse.emf.cdo.common.lock;
-
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Common concepts for dealing with durable locks and views.
+ *
+ * @apiviz.exclude .*Exception
+ */
+package org.eclipse.emf.cdo.common.lock;
+
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassInfo.java
index 7ec16a3dbe..75a3f31ded 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassInfo.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassInfo.java
@@ -1,42 +1,42 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.model;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * An EMF {@link Adapter adapter} that encapsulates CDO specific information about an {@link EClass}.
- *
- * @author Eike Stepper
- * @since 2.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.has {@link org.eclipse.emf.ecore.EClass}
- */
-public interface CDOClassInfo extends Adapter
-{
- public EClass getEClass();
-
- public boolean isResourceNode();
-
- public boolean isResourceFolder();
-
- public boolean isResource();
-
- public EStructuralFeature[] getAllPersistentFeatures();
-
- public int getFeatureIndex(EStructuralFeature feature);
-
- public int getFeatureIndex(int featureID);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.model;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * An EMF {@link Adapter adapter} that encapsulates CDO specific information about an {@link EClass}.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.has {@link org.eclipse.emf.ecore.EClass}
+ */
+public interface CDOClassInfo extends Adapter
+{
+ public EClass getEClass();
+
+ public boolean isResourceNode();
+
+ public boolean isResourceFolder();
+
+ public boolean isResource();
+
+ public EStructuralFeature[] getAllPersistentFeatures();
+
+ public int getFeatureIndex(EStructuralFeature feature);
+
+ public int getFeatureIndex(int featureID);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassifierRef.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassifierRef.java
index 1a050de87f..7d7f8cfa71 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassifierRef.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassifierRef.java
@@ -1,159 +1,159 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.model;
-
-import org.eclipse.emf.cdo.common.protocol.CDODataInput;
-import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
-import org.eclipse.emf.cdo.internal.common.messages.Messages;
-
-import org.eclipse.net4j.util.ObjectUtil;
-
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EPackage;
-
-import java.io.IOException;
-import java.text.MessageFormat;
-
-/**
- * References an {@link EClassifier}.
- *
- * @author Eike Stepper
- * @since 2.0
- */
-public final class CDOClassifierRef
-{
- public static final String URI_SEPARATOR = "#"; //$NON-NLS-1$
-
- private String packageURI;
-
- private String classifierName;
-
- public CDOClassifierRef()
- {
- }
-
- public CDOClassifierRef(EClassifier classifier)
- {
- this(classifier.getEPackage().getNsURI(), classifier.getName());
- }
-
- public CDOClassifierRef(String packageURI, String classifierName)
- {
- this.packageURI = packageURI.intern();
- this.classifierName = classifierName.intern();
- }
-
- /**
- * @since 4.0
- */
- public CDOClassifierRef(String uri)
- {
- if (uri == null)
- {
- throw new IllegalArgumentException(Messages.getString("CDOClassifierRef.1") + uri); //$NON-NLS-1$
- }
-
- int hash = uri.lastIndexOf(URI_SEPARATOR);
- if (hash == -1)
- {
- throw new IllegalArgumentException(Messages.getString("CDOClassifierRef.1") + uri); //$NON-NLS-1$
- }
-
- packageURI = uri.substring(0, hash);
- classifierName = uri.substring(hash + 1);
- }
-
- /**
- * @since 3.0
- */
- public CDOClassifierRef(CDODataInput in) throws IOException
- {
- this(in.readCDOPackageURI());
- }
-
- /**
- * @since 3.0
- */
- public void write(CDODataOutput out) throws IOException
- {
- out.writeCDOPackageURI(getURI());
- }
-
- /**
- * @since 4.0
- */
- public String getURI()
- {
- return packageURI + URI_SEPARATOR + classifierName;
- }
-
- public String getPackageURI()
- {
- return packageURI;
- }
-
- public String getClassifierName()
- {
- return classifierName;
- }
-
- public EClassifier resolve(EPackage.Registry packageRegistry)
- {
- EPackage ePackage = packageRegistry.getEPackage(packageURI);
- if (ePackage == null)
- {
- throw new IllegalStateException(MessageFormat.format(Messages.getString("CDOClassifierRef.0"), packageURI)); //$NON-NLS-1$
- }
-
- return ePackage.getEClassifier(classifierName);
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
-
- if (obj != null && obj.getClass() == CDOClassifierRef.class)
- {
- CDOClassifierRef that = (CDOClassifierRef)obj;
- return ObjectUtil.equals(packageURI, that.packageURI) && ObjectUtil.equals(classifierName, that.classifierName);
- }
-
- return false;
- }
-
- @Override
- public int hashCode()
- {
- return packageURI.hashCode() ^ classifierName.hashCode();
- }
-
- @Override
- public String toString()
- {
- return MessageFormat.format("CDOClassifierRef({0}, {1})", packageURI, classifierName); //$NON-NLS-1$
- }
-
- /**
- * Provides {@link CDOClassifierRef classifier references}.
- *
- * @author Eike Stepper
- * @since 3.0
- * @apiviz.uses {@link CDOClassifierRef} - - provides
- */
- public interface Provider
- {
- public CDOClassifierRef getClassifierRef();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.model;
+
+import org.eclipse.emf.cdo.common.protocol.CDODataInput;
+import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+import org.eclipse.emf.cdo.internal.common.messages.Messages;
+
+import org.eclipse.net4j.util.ObjectUtil;
+
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EPackage;
+
+import java.io.IOException;
+import java.text.MessageFormat;
+
+/**
+ * References an {@link EClassifier}.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ */
+public final class CDOClassifierRef
+{
+ public static final String URI_SEPARATOR = "#"; //$NON-NLS-1$
+
+ private String packageURI;
+
+ private String classifierName;
+
+ public CDOClassifierRef()
+ {
+ }
+
+ public CDOClassifierRef(EClassifier classifier)
+ {
+ this(classifier.getEPackage().getNsURI(), classifier.getName());
+ }
+
+ public CDOClassifierRef(String packageURI, String classifierName)
+ {
+ this.packageURI = packageURI.intern();
+ this.classifierName = classifierName.intern();
+ }
+
+ /**
+ * @since 4.0
+ */
+ public CDOClassifierRef(String uri)
+ {
+ if (uri == null)
+ {
+ throw new IllegalArgumentException(Messages.getString("CDOClassifierRef.1") + uri); //$NON-NLS-1$
+ }
+
+ int hash = uri.lastIndexOf(URI_SEPARATOR);
+ if (hash == -1)
+ {
+ throw new IllegalArgumentException(Messages.getString("CDOClassifierRef.1") + uri); //$NON-NLS-1$
+ }
+
+ packageURI = uri.substring(0, hash);
+ classifierName = uri.substring(hash + 1);
+ }
+
+ /**
+ * @since 3.0
+ */
+ public CDOClassifierRef(CDODataInput in) throws IOException
+ {
+ this(in.readCDOPackageURI());
+ }
+
+ /**
+ * @since 3.0
+ */
+ public void write(CDODataOutput out) throws IOException
+ {
+ out.writeCDOPackageURI(getURI());
+ }
+
+ /**
+ * @since 4.0
+ */
+ public String getURI()
+ {
+ return packageURI + URI_SEPARATOR + classifierName;
+ }
+
+ public String getPackageURI()
+ {
+ return packageURI;
+ }
+
+ public String getClassifierName()
+ {
+ return classifierName;
+ }
+
+ public EClassifier resolve(EPackage.Registry packageRegistry)
+ {
+ EPackage ePackage = packageRegistry.getEPackage(packageURI);
+ if (ePackage == null)
+ {
+ throw new IllegalStateException(MessageFormat.format(Messages.getString("CDOClassifierRef.0"), packageURI)); //$NON-NLS-1$
+ }
+
+ return ePackage.getEClassifier(classifierName);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+
+ if (obj != null && obj.getClass() == CDOClassifierRef.class)
+ {
+ CDOClassifierRef that = (CDOClassifierRef)obj;
+ return ObjectUtil.equals(packageURI, that.packageURI) && ObjectUtil.equals(classifierName, that.classifierName);
+ }
+
+ return false;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return packageURI.hashCode() ^ classifierName.hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return MessageFormat.format("CDOClassifierRef({0}, {1})", packageURI, classifierName); //$NON-NLS-1$
+ }
+
+ /**
+ * Provides {@link CDOClassifierRef classifier references}.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @apiviz.uses {@link CDOClassifierRef} - - provides
+ */
+ public interface Provider
+ {
+ public CDOClassifierRef getClassifierRef();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelConstants.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelConstants.java
index c786f72657..373c7eecc1 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelConstants.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelConstants.java
@@ -1,69 +1,69 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.model;
-
-/**
- * Symbolic model constants commonly used in CDO.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOModelConstants
-{
- public static final String RESOURCE_NODE_NAME_ATTRIBUTE = "name"; //$NON-NLS-1$
-
- /**
- * @since 4.0
- */
- public static final String CORE_PACKAGE_URI = "http://www.eclipse.org/emf/2002/Ecore"; //$NON-NLS-1$
-
- /**
- * @since 4.0
- */
- public static final String ROOT_CLASS_NAME = "EObject"; //$NON-NLS-1$
-
- /**
- * @since 4.0
- */
- public static final String RESOURCE_PACKAGE_URI = "http://www.eclipse.org/emf/CDO/Eresource/4.0.0"; //$NON-NLS-1$
-
- /**
- * @since 4.0
- */
- public static final String RESOURCE_NODE_CLASS_NAME = "CDOResourceNode"; //$NON-NLS-1$
-
- /**
- * @since 4.0
- */
- public static final String RESOURCE_FOLDER_CLASS_NAME = "CDOResourceFolder"; //$NON-NLS-1$
-
- /**
- * @since 4.0
- */
- public static final String RESOURCE_CLASS_NAME = "CDOResource"; //$NON-NLS-1$
-
- /**
- * @since 4.0
- */
- public static final String TYPES_PACKAGE_URI = "http://www.eclipse.org/emf/CDO/Etypes/4.0.0"; //$NON-NLS-1$
-
- /**
- * @since 4.0
- */
- public static final String BLOB_CLASS_NAME = "Blob"; //$NON-NLS-1$
-
- /**
- * @since 4.0
- */
- public static final String CLOB_CLASS_NAME = "Clob"; //$NON-NLS-1$
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.model;
+
+/**
+ * Symbolic model constants commonly used in CDO.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOModelConstants
+{
+ public static final String RESOURCE_NODE_NAME_ATTRIBUTE = "name"; //$NON-NLS-1$
+
+ /**
+ * @since 4.0
+ */
+ public static final String CORE_PACKAGE_URI = "http://www.eclipse.org/emf/2002/Ecore"; //$NON-NLS-1$
+
+ /**
+ * @since 4.0
+ */
+ public static final String ROOT_CLASS_NAME = "EObject"; //$NON-NLS-1$
+
+ /**
+ * @since 4.0
+ */
+ public static final String RESOURCE_PACKAGE_URI = "http://www.eclipse.org/emf/CDO/Eresource/4.0.0"; //$NON-NLS-1$
+
+ /**
+ * @since 4.0
+ */
+ public static final String RESOURCE_NODE_CLASS_NAME = "CDOResourceNode"; //$NON-NLS-1$
+
+ /**
+ * @since 4.0
+ */
+ public static final String RESOURCE_FOLDER_CLASS_NAME = "CDOResourceFolder"; //$NON-NLS-1$
+
+ /**
+ * @since 4.0
+ */
+ public static final String RESOURCE_CLASS_NAME = "CDOResource"; //$NON-NLS-1$
+
+ /**
+ * @since 4.0
+ */
+ public static final String TYPES_PACKAGE_URI = "http://www.eclipse.org/emf/CDO/Etypes/4.0.0"; //$NON-NLS-1$
+
+ /**
+ * @since 4.0
+ */
+ public static final String BLOB_CLASS_NAME = "Blob"; //$NON-NLS-1$
+
+ /**
+ * @since 4.0
+ */
+ public static final String CLOB_CLASS_NAME = "Clob"; //$NON-NLS-1$
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageInfo.java
index 269d38f507..c0b649eb18 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageInfo.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageInfo.java
@@ -1,92 +1,92 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.model;
-
-import org.eclipse.emf.cdo.common.model.CDOPackageUnit.State;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EPackage.Descriptor;
-
-/**
- * Describes a single {@link EPackage package } instance of the nested package tree strucure represented by the
- * containing {@link CDOPackageUnit package unit}.
- * <p>
- * While the containing package unit is in the {@link CDOPackageUnit.State#PROXY PROXY} state this package info acts as
- * a {@link Descriptor package descriptor} in the associated {@link CDOPackageRegistry package registry}. When that
- * package unit is loaded all contained package infos/descriptors are resolved and replaced by their actual packages. At
- * the same time the describing package info objects are attached as adapters to the resolved packages. This way the
- * descriptive information is available before and after loading the packages.
- *
- * @author Eike Stepper
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.has {@link org.eclipse.emf.ecore.EPackage}
- * @apiviz.composedOf {@link CDOClassInfo}
- */
-public interface CDOPackageInfo extends Adapter, EPackage.Descriptor, Comparable<CDOPackageInfo>
-{
- /**
- * Returns the package unit containing this package info.
- */
- public CDOPackageUnit getPackageUnit();
-
- /**
- * Returns the namespace URI of the package described by this package info.
- */
- public String getPackageURI();
-
- /**
- * Returns the namespace URI of the {@link EPackage#getESuperPackage() super package} of the package described by this
- * package info.
- */
- public String getParentURI();
-
- /**
- * Returns the {@link EPackage package} described by this package info.
- *
- * @param loadOnDemand
- * If <code>true</code> and the containing {@link CDOPackageUnit package unit} is not {@link State#LOADED
- * LOADED} the package unit is implicitely loaded. If <code>false</code> and this package unit is not
- * {@link State#LOADED LOADED} <code>null</code> is returned.
- */
- public EPackage getEPackage(boolean loadOnDemand);
-
- /**
- * Returnes <code>true</code> if the package described by this package info is the <i>Ecore</i> model,
- * <code>false</code> oterwise.
- */
- public boolean isCorePackage();
-
- /**
- * Returnes <code>true</code> if the package described by this package info is the <i>Eresource</i> model,
- * <code>false</code> oterwise.
- */
- public boolean isResourcePackage();
-
- /**
- * Returnes <code>true</code> if the package described by this package info is the <i>Etypes</i> model,
- * <code>false</code> oterwise.
- *
- * @since 4.0
- */
- public boolean isTypePackage();
-
- /**
- * Returns <code>true</code> is this package info describes one of the models <i>Ecore</i>, <i>Eresource</i> or
- * <i>Etypes</i>, <code>false</code> otherwise.
- * <p>
- * Note that the models <i>Ecore</i>, <i>Eresource</i> and <i>Etypes</i> are expected to present as generated
- * {@link CDOPackageUnit.Type#NATIVE NATIVE} models in all deployments.
- */
- public boolean isSystemPackage();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.model;
+
+import org.eclipse.emf.cdo.common.model.CDOPackageUnit.State;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EPackage.Descriptor;
+
+/**
+ * Describes a single {@link EPackage package } instance of the nested package tree strucure represented by the
+ * containing {@link CDOPackageUnit package unit}.
+ * <p>
+ * While the containing package unit is in the {@link CDOPackageUnit.State#PROXY PROXY} state this package info acts as
+ * a {@link Descriptor package descriptor} in the associated {@link CDOPackageRegistry package registry}. When that
+ * package unit is loaded all contained package infos/descriptors are resolved and replaced by their actual packages. At
+ * the same time the describing package info objects are attached as adapters to the resolved packages. This way the
+ * descriptive information is available before and after loading the packages.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.has {@link org.eclipse.emf.ecore.EPackage}
+ * @apiviz.composedOf {@link CDOClassInfo}
+ */
+public interface CDOPackageInfo extends Adapter, EPackage.Descriptor, Comparable<CDOPackageInfo>
+{
+ /**
+ * Returns the package unit containing this package info.
+ */
+ public CDOPackageUnit getPackageUnit();
+
+ /**
+ * Returns the namespace URI of the package described by this package info.
+ */
+ public String getPackageURI();
+
+ /**
+ * Returns the namespace URI of the {@link EPackage#getESuperPackage() super package} of the package described by this
+ * package info.
+ */
+ public String getParentURI();
+
+ /**
+ * Returns the {@link EPackage package} described by this package info.
+ *
+ * @param loadOnDemand
+ * If <code>true</code> and the containing {@link CDOPackageUnit package unit} is not {@link State#LOADED
+ * LOADED} the package unit is implicitely loaded. If <code>false</code> and this package unit is not
+ * {@link State#LOADED LOADED} <code>null</code> is returned.
+ */
+ public EPackage getEPackage(boolean loadOnDemand);
+
+ /**
+ * Returnes <code>true</code> if the package described by this package info is the <i>Ecore</i> model,
+ * <code>false</code> oterwise.
+ */
+ public boolean isCorePackage();
+
+ /**
+ * Returnes <code>true</code> if the package described by this package info is the <i>Eresource</i> model,
+ * <code>false</code> oterwise.
+ */
+ public boolean isResourcePackage();
+
+ /**
+ * Returnes <code>true</code> if the package described by this package info is the <i>Etypes</i> model,
+ * <code>false</code> oterwise.
+ *
+ * @since 4.0
+ */
+ public boolean isTypePackage();
+
+ /**
+ * Returns <code>true</code> is this package info describes one of the models <i>Ecore</i>, <i>Eresource</i> or
+ * <i>Etypes</i>, <code>false</code> otherwise.
+ * <p>
+ * Note that the models <i>Ecore</i>, <i>Eresource</i> and <i>Etypes</i> are expected to present as generated
+ * {@link CDOPackageUnit.Type#NATIVE NATIVE} models in all deployments.
+ */
+ public boolean isSystemPackage();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageRegistry.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageRegistry.java
index 96f6bdac67..5018fcdbc5 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageRegistry.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageRegistry.java
@@ -1,81 +1,81 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Stefan Winkler - Bug 332912 - Caching subtype-relationships in the CDOPackageRegistry
- */
-package org.eclipse.emf.cdo.common.model;
-
-import org.eclipse.emf.cdo.common.CDOCommonRepository;
-import org.eclipse.emf.cdo.common.CDOCommonSession;
-
-import org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EPackage.Registry;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * An EMF {@link Registry package registry} that is used by CDO {@link CDOCommonRepository repositories} and
- * {@link CDOCommonSession sessions}.
- *
- * @author Eike Stepper
- * @since 2.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.composedOf {@link CDOPackageUnit}
- */
-public interface CDOPackageRegistry extends EPackage.Registry
-{
- public boolean isReplacingDescriptors();
-
- /**
- * Registers an {@link EPackage} with this package registry.
- */
- public Object putEPackage(EPackage ePackage);
-
- /**
- * @since 3.0
- */
- public CDOPackageUnit getPackageUnit(String id);
-
- public CDOPackageUnit getPackageUnit(EPackage ePackage);
-
- /**
- * Returns all package units that are registered in this package registry.
- *
- * @since 3.0
- */
- public CDOPackageUnit[] getPackageUnits();
-
- /**
- * @since 3.0
- */
- public CDOPackageUnit[] getPackageUnits(long startTime, long endTime);
-
- public CDOPackageInfo getPackageInfo(EPackage ePackage);
-
- /**
- * Returns all package infos that are registered in this package registry.
- */
- public CDOPackageInfo[] getPackageInfos();
-
- /**
- * @since 4.0
- */
- public Map<EClass, List<EClass>> getSubTypes();
-
- /**
- * @since 4.0
- */
- public EEnumLiteral getEnumLiteralFor(Enumerator value);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Stefan Winkler - Bug 332912 - Caching subtype-relationships in the CDOPackageRegistry
+ */
+package org.eclipse.emf.cdo.common.model;
+
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.CDOCommonSession;
+
+import org.eclipse.emf.common.util.Enumerator;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EPackage.Registry;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * An EMF {@link Registry package registry} that is used by CDO {@link CDOCommonRepository repositories} and
+ * {@link CDOCommonSession sessions}.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.composedOf {@link CDOPackageUnit}
+ */
+public interface CDOPackageRegistry extends EPackage.Registry
+{
+ public boolean isReplacingDescriptors();
+
+ /**
+ * Registers an {@link EPackage} with this package registry.
+ */
+ public Object putEPackage(EPackage ePackage);
+
+ /**
+ * @since 3.0
+ */
+ public CDOPackageUnit getPackageUnit(String id);
+
+ public CDOPackageUnit getPackageUnit(EPackage ePackage);
+
+ /**
+ * Returns all package units that are registered in this package registry.
+ *
+ * @since 3.0
+ */
+ public CDOPackageUnit[] getPackageUnits();
+
+ /**
+ * @since 3.0
+ */
+ public CDOPackageUnit[] getPackageUnits(long startTime, long endTime);
+
+ public CDOPackageInfo getPackageInfo(EPackage ePackage);
+
+ /**
+ * Returns all package infos that are registered in this package registry.
+ */
+ public CDOPackageInfo[] getPackageInfos();
+
+ /**
+ * @since 4.0
+ */
+ public Map<EClass, List<EClass>> getSubTypes();
+
+ /**
+ * @since 4.0
+ */
+ public EEnumLiteral getEnumLiteralFor(Enumerator value);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageTypeRegistry.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageTypeRegistry.java
index cb3e0e5df8..4fc22a37b2 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageTypeRegistry.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageTypeRegistry.java
@@ -1,227 +1,227 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.model;
-
-import org.eclipse.emf.cdo.common.model.CDOPackageUnit.Type;
-
-import org.eclipse.net4j.util.ObjectUtil;
-import org.eclipse.net4j.util.om.OMPlatform;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A {@link #INSTANCE singleton} registry for the {@link Type package unit types} of EMF {@link EPackage packages}.
- *
- * @author Eike Stepper
- * @since 2.0
- * @apiviz.exclude
- */
-public final class CDOPackageTypeRegistry
-{
- public static final CDOPackageTypeRegistry INSTANCE = new CDOPackageTypeRegistry();
-
- private static final String ECORE_ID = "org.eclipse.emf.ecore"; //$NON-NLS-1$
-
- private static final String PPID = EcorePlugin.GENERATED_PACKAGE_PPID;
-
- private static final String MARKER_FILE = "META-INF/CDO.MF"; //$NON-NLS-1$
-
- private Map<String, CDOPackageUnit.Type> types = new HashMap<String, CDOPackageUnit.Type>();
-
- private Map<String, CDOPackageUnit.Type> bundles = new HashMap<String, CDOPackageUnit.Type>();
-
- private CDOPackageTypeRegistry()
- {
- }
-
- public synchronized CDOPackageUnit.Type register(EPackage ePackage)
- {
- CDOPackageUnit.Type type = getPackageType(ePackage);
- types.put(ePackage.getNsURI(), type);
- return type;
- }
-
- public synchronized void registerNative(String packageURI)
- {
- types.put(packageURI, CDOPackageUnit.Type.NATIVE);
- }
-
- public synchronized void registerLegacy(String packageURI)
- {
- types.put(packageURI, CDOPackageUnit.Type.LEGACY);
- }
-
- public synchronized void registerDynamic(String packageURI)
- {
- types.put(packageURI, CDOPackageUnit.Type.DYNAMIC);
- }
-
- public synchronized CDOPackageUnit.Type deregister(String packageURI)
- {
- return types.remove(packageURI);
- }
-
- public synchronized CDOPackageUnit.Type lookup(String packageURI)
- {
- CDOPackageUnit.Type type = types.get(packageURI);
- if (type == null)
- {
- Object value = EPackage.Registry.INSTANCE.get(packageURI);
- if (value instanceof EPackage)
- {
- EPackage ePackage = (EPackage)value;
- type = register(ePackage);
- }
-
- if (type == null && OMPlatform.INSTANCE.isExtensionRegistryAvailable())
- {
- type = getTypeFromBundle(packageURI);
- types.put(packageURI, type);
- }
- }
-
- return type;
- }
-
- public synchronized CDOPackageUnit.Type lookup(EPackage ePackage)
- {
- String packageURI = ePackage.getNsURI();
- CDOPackageUnit.Type type = types.get(packageURI);
- if (type == null)
- {
- type = register(ePackage);
- }
-
- return type;
- }
-
- public synchronized void reset()
- {
- types.clear();
- bundles.clear();
- }
-
- private CDOPackageUnit.Type getTypeFromBundle(String packageURI)
- {
- String bundleID = getBundleID(packageURI);
- if (bundleID == null)
- {
- return CDOPackageUnit.Type.UNKNOWN;
- }
-
- CDOPackageUnit.Type type = bundles.get(bundleID);
- if (type == null)
- {
- org.osgi.framework.Bundle bundle = org.eclipse.core.runtime.Platform.getBundle(bundleID);
- if (bundle == null)
- {
- type = CDOPackageUnit.Type.UNKNOWN;
- }
- else if (bundle.getEntry(MARKER_FILE) != null)
- {
- type = CDOPackageUnit.Type.NATIVE;
- }
- else
- {
- type = CDOPackageUnit.Type.LEGACY;
- }
-
- bundles.put(bundleID, type);
- }
-
- return type;
- }
-
- private static String getBundleID(String packageURI)
- {
- org.eclipse.core.runtime.IExtensionRegistry registry = org.eclipse.core.runtime.Platform.getExtensionRegistry();
- for (org.eclipse.core.runtime.IConfigurationElement element : registry.getConfigurationElementsFor(ECORE_ID, PPID))
- {
- String uri = element.getAttribute("uri"); //$NON-NLS-1$
- if (ObjectUtil.equals(uri, packageURI))
- {
- return element.getContributor().getName();
- }
- }
-
- return null;
- }
-
- private static CDOPackageUnit.Type getPackageType(EPackage ePackage)
- {
- if (ePackage.getClass() == EPackageImpl.class)
- {
- return CDOPackageUnit.Type.DYNAMIC;
- }
-
- EPackage topLevelPackage = EMFUtil.getTopLevelPackage(ePackage);
- EClass eClass = getAnyConcreteEClass(topLevelPackage);
- if (eClass != null)
- {
- EObject testObject = EcoreUtil.create(eClass);
- if (testObject instanceof CDOObjectMarker)
- {
- return CDOPackageUnit.Type.NATIVE;
- }
-
- return CDOPackageUnit.Type.LEGACY;
- }
-
- return null;
- }
-
- private static EClass getAnyConcreteEClass(EPackage ePackage)
- {
- for (EClassifier classifier : ePackage.getEClassifiers())
- {
- if (classifier instanceof EClass)
- {
- EClass eClass = (EClass)classifier;
- if (!(eClass.isAbstract() || eClass.isInterface()))
- {
- return eClass;
- }
- }
- }
-
- for (EPackage subpackage : ePackage.getESubpackages())
- {
- EClass eClass = getAnyConcreteEClass(subpackage);
- if (eClass != null)
- {
- return eClass;
- }
- }
-
- return null;
- }
-
- /**
- * A common marker interface for CDO (native) objects.
- *
- * @author Eike Stepper
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.exclude
- */
- public static interface CDOObjectMarker
- {
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.model;
+
+import org.eclipse.emf.cdo.common.model.CDOPackageUnit.Type;
+
+import org.eclipse.net4j.util.ObjectUtil;
+import org.eclipse.net4j.util.om.OMPlatform;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * A {@link #INSTANCE singleton} registry for the {@link Type package unit types} of EMF {@link EPackage packages}.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ * @apiviz.exclude
+ */
+public final class CDOPackageTypeRegistry
+{
+ public static final CDOPackageTypeRegistry INSTANCE = new CDOPackageTypeRegistry();
+
+ private static final String ECORE_ID = "org.eclipse.emf.ecore"; //$NON-NLS-1$
+
+ private static final String PPID = EcorePlugin.GENERATED_PACKAGE_PPID;
+
+ private static final String MARKER_FILE = "META-INF/CDO.MF"; //$NON-NLS-1$
+
+ private Map<String, CDOPackageUnit.Type> types = new HashMap<String, CDOPackageUnit.Type>();
+
+ private Map<String, CDOPackageUnit.Type> bundles = new HashMap<String, CDOPackageUnit.Type>();
+
+ private CDOPackageTypeRegistry()
+ {
+ }
+
+ public synchronized CDOPackageUnit.Type register(EPackage ePackage)
+ {
+ CDOPackageUnit.Type type = getPackageType(ePackage);
+ types.put(ePackage.getNsURI(), type);
+ return type;
+ }
+
+ public synchronized void registerNative(String packageURI)
+ {
+ types.put(packageURI, CDOPackageUnit.Type.NATIVE);
+ }
+
+ public synchronized void registerLegacy(String packageURI)
+ {
+ types.put(packageURI, CDOPackageUnit.Type.LEGACY);
+ }
+
+ public synchronized void registerDynamic(String packageURI)
+ {
+ types.put(packageURI, CDOPackageUnit.Type.DYNAMIC);
+ }
+
+ public synchronized CDOPackageUnit.Type deregister(String packageURI)
+ {
+ return types.remove(packageURI);
+ }
+
+ public synchronized CDOPackageUnit.Type lookup(String packageURI)
+ {
+ CDOPackageUnit.Type type = types.get(packageURI);
+ if (type == null)
+ {
+ Object value = EPackage.Registry.INSTANCE.get(packageURI);
+ if (value instanceof EPackage)
+ {
+ EPackage ePackage = (EPackage)value;
+ type = register(ePackage);
+ }
+
+ if (type == null && OMPlatform.INSTANCE.isExtensionRegistryAvailable())
+ {
+ type = getTypeFromBundle(packageURI);
+ types.put(packageURI, type);
+ }
+ }
+
+ return type;
+ }
+
+ public synchronized CDOPackageUnit.Type lookup(EPackage ePackage)
+ {
+ String packageURI = ePackage.getNsURI();
+ CDOPackageUnit.Type type = types.get(packageURI);
+ if (type == null)
+ {
+ type = register(ePackage);
+ }
+
+ return type;
+ }
+
+ public synchronized void reset()
+ {
+ types.clear();
+ bundles.clear();
+ }
+
+ private CDOPackageUnit.Type getTypeFromBundle(String packageURI)
+ {
+ String bundleID = getBundleID(packageURI);
+ if (bundleID == null)
+ {
+ return CDOPackageUnit.Type.UNKNOWN;
+ }
+
+ CDOPackageUnit.Type type = bundles.get(bundleID);
+ if (type == null)
+ {
+ org.osgi.framework.Bundle bundle = org.eclipse.core.runtime.Platform.getBundle(bundleID);
+ if (bundle == null)
+ {
+ type = CDOPackageUnit.Type.UNKNOWN;
+ }
+ else if (bundle.getEntry(MARKER_FILE) != null)
+ {
+ type = CDOPackageUnit.Type.NATIVE;
+ }
+ else
+ {
+ type = CDOPackageUnit.Type.LEGACY;
+ }
+
+ bundles.put(bundleID, type);
+ }
+
+ return type;
+ }
+
+ private static String getBundleID(String packageURI)
+ {
+ org.eclipse.core.runtime.IExtensionRegistry registry = org.eclipse.core.runtime.Platform.getExtensionRegistry();
+ for (org.eclipse.core.runtime.IConfigurationElement element : registry.getConfigurationElementsFor(ECORE_ID, PPID))
+ {
+ String uri = element.getAttribute("uri"); //$NON-NLS-1$
+ if (ObjectUtil.equals(uri, packageURI))
+ {
+ return element.getContributor().getName();
+ }
+ }
+
+ return null;
+ }
+
+ private static CDOPackageUnit.Type getPackageType(EPackage ePackage)
+ {
+ if (ePackage.getClass() == EPackageImpl.class)
+ {
+ return CDOPackageUnit.Type.DYNAMIC;
+ }
+
+ EPackage topLevelPackage = EMFUtil.getTopLevelPackage(ePackage);
+ EClass eClass = getAnyConcreteEClass(topLevelPackage);
+ if (eClass != null)
+ {
+ EObject testObject = EcoreUtil.create(eClass);
+ if (testObject instanceof CDOObjectMarker)
+ {
+ return CDOPackageUnit.Type.NATIVE;
+ }
+
+ return CDOPackageUnit.Type.LEGACY;
+ }
+
+ return null;
+ }
+
+ private static EClass getAnyConcreteEClass(EPackage ePackage)
+ {
+ for (EClassifier classifier : ePackage.getEClassifiers())
+ {
+ if (classifier instanceof EClass)
+ {
+ EClass eClass = (EClass)classifier;
+ if (!(eClass.isAbstract() || eClass.isInterface()))
+ {
+ return eClass;
+ }
+ }
+ }
+
+ for (EPackage subpackage : ePackage.getESubpackages())
+ {
+ EClass eClass = getAnyConcreteEClass(subpackage);
+ if (eClass != null)
+ {
+ return eClass;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * A common marker interface for CDO (native) objects.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.exclude
+ */
+ public static interface CDOObjectMarker
+ {
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageUnit.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageUnit.java
index 00e7ca7a8f..d076e6a378 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageUnit.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOPackageUnit.java
@@ -1,208 +1,208 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.model;
-
-import org.eclipse.emf.cdo.internal.common.messages.Messages;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EPackage.Registry;
-
-/**
- * Represents a tree structure of nested {@link EPackage packages} that are registered with a {@link CDOPackageRegistry
- * package registry} and that can only be serialized as a whole.
- * <p>
- * A package unit is the granule of committing or lazy loading packages. It contains some overall information like
- * {@link Type type}, {@link State state}, {@link #getTimeStamp() commit time} and nested {@link CDOPackageInfo package
- * info} objects that describe all the nested packages.
- *
- * @author Eike Stepper
- * @since 2.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.has {@link CDOPackageUnit.Type}
- * @apiviz.has {@link CDOPackageUnit.State}
- * @apiviz.composedOf {@link CDOPackageInfo}
- */
-public interface CDOPackageUnit extends Comparable<CDOPackageUnit>
-{
- /**
- * Returns the package registry this package unit is managed by.
- */
- public CDOPackageRegistry getPackageRegistry();
-
- /**
- * Returns the ID of this package unit.
- * <p>
- * Same as {@link #getTopLevelPackageInfo()}. {@link CDOPackageInfo#getPackageURI()}.
- */
- public String getID();
-
- /**
- * Returns the current state of this package unit.
- */
- public State getState();
-
- /**
- * Returns the current type of this package unit.
- */
- public Type getType();
-
- /**
- * Returns the type of this package unit as it was at the time it was originally committed by a client.
- */
- public Type getOriginalType();
-
- /**
- * Returns the time this package unit was originally committed.
- */
- public long getTimeStamp();
-
- /**
- * Returns the {@link CDOPackageInfo package info} object that describes the top level {@link EPackage package} of the
- * nested package tree structure described by this package unit.
- */
- public CDOPackageInfo getTopLevelPackageInfo();
-
- /**
- * Returns the {@link CDOPackageInfo package info} object that describes the {@link EPackage package} with the given
- * namespace URI, or <code>null</code> if this package unit does not contain a package with this URI.
- */
- public CDOPackageInfo getPackageInfo(String packageURI);
-
- /**
- * Returns all {@link CDOPackageInfo package info} objects of the nested package tree structure described by this
- * package unit in depth-first traversal order.
- */
- public CDOPackageInfo[] getPackageInfos();
-
- /**
- * Returns all {@link EPackage packages} of the nested package tree structure described by this package unit in
- * depth-first traversal order.
- *
- * @param loadOnDemand
- * If <code>true</code> and this package unit is not {@link State#LOADED LOADED} the package unit is
- * implicitely loaded. If <code>false</code> and this package unit is not {@link State#LOADED LOADED} an
- * empty array is returned.
- */
- public EPackage[] getEPackages(boolean loadOnDemand);
-
- /**
- * Returns <code>true</code> is this package unit describes one of the models <i>Ecore</i>, <i>Eresource</i> or
- * <i>Etypes</i>, <code>false</code> otherwise.
- * <p>
- * Note that the models <i>Ecore</i>, <i>Eresource</i> and <i>Etypes</i> are expected to be present as generated
- * {@link Type#NATIVE NATIVE} models in all deployments.
- */
- public boolean isSystem();
-
- /**
- * Returns <code>true</code> is this package unit describes the model <i>Eresource</i> , <code>false</code> otherwise.
- * <p>
- * Note that the model <i>Eresource</i> is expected to bepresent as generated {@link Type#NATIVE NATIVE} models in all
- * deployments.
- *
- * @since 4.0
- */
- public boolean isResource();
-
- /**
- * Describes the possible states a {@link CDOPackageUnit package unit} may be in during its lifecycle.
- *
- * @author Eike Stepper
- */
- public enum State
- {
- /**
- * The state of a {@link CDOPackageUnit package unit} after one of its described {@link EPackage packages} is newly
- * attached to a transactional {@link CDOPackageRegistry package registry}, but before the associated transaction is
- * committed. A {@link #NEW} package unit can only transition to {@link #LOADED} or {@link #DISPOSED}.
- */
- NEW,
-
- /**
- * The state of a {@link CDOPackageUnit package unit} after the described {@link EPackage packages} are loaded or
- * wired from the {@link Registry#INSTANCE global package registry}. A {@link #LOADED} package unit can only
- * transition to {@link #DISPOSED}.
- */
- LOADED,
-
- /**
- * The state of a {@link CDOPackageUnit package unit} after the context of the associated {@link CDOPackageRegistry
- * package registry} has been initialized, that is the repository been started or the session been opened. A
- * {@link #PROXY} package unit can only transition to {@link #LOADED} or {@link #DISPOSED}.
- */
- PROXY,
-
- /**
- * The state of a {@link CDOPackageUnit package unit} after the associated {@link CDOPackageRegistry package
- * registry} has been deactivated, that is the repository been stopped or the session been closed. A
- * {@link #DISPOSED} package unit can not transition to any other state.
- */
- DISPOSED
- }
-
- /**
- * Describes the instances of {@link EClass classes} of a {@link CDOPackageUnit package unit}.
- *
- * @author Eike Stepper
- */
- public enum Type
- {
- /**
- * The type of models that are generated specifically for the usage with CDO. Instances of {@link EClass classes} of
- * these models can be directly cast to InternalCDOObject.
- */
- NATIVE,
-
- /**
- * The type of models that are <b>not</b> generated specifically for the usage with CDO. Instances of {@link EClass
- * classes} of these models can <b>not</b> be directly cast to InternalCDOObject.
- */
- LEGACY,
-
- /**
- * The type of models that are not generated <b>at all</b> but rather dynamically contructed at runtime. Instances
- * of {@link EClass classes} of these models <b>can</b> be directly cast to InternalCDOObject, i.e. they're
- * implicitely <i>native</i>.
- */
- DYNAMIC,
-
- /**
- * Used to indicate that the type of a model could not be determined. Refer to the
- * {@link CDOPackageTypeRegistry#INSTANCE package type registry} on how to deal with this scenario.
- */
- UNKNOWN;
-
- /**
- * Returns <code>true</code> if this type is either {@link #NATIVE} or {@link #LEGACY}, <code>false</code>
- * otherwise.
- */
- public boolean isGenerated()
- {
- checkNotUnknown();
- return this == NATIVE || this == LEGACY;
- }
-
- /**
- * @throws IllegalStateException
- * if this type is {@link #UNKNOWN}.
- */
- public void checkNotUnknown() throws IllegalStateException
- {
- if (this == UNKNOWN)
- {
- throw new IllegalStateException(Messages.getString("CDOPackageUnit.0")); //$NON-NLS-1$
- }
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.model;
+
+import org.eclipse.emf.cdo.internal.common.messages.Messages;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EPackage.Registry;
+
+/**
+ * Represents a tree structure of nested {@link EPackage packages} that are registered with a {@link CDOPackageRegistry
+ * package registry} and that can only be serialized as a whole.
+ * <p>
+ * A package unit is the granule of committing or lazy loading packages. It contains some overall information like
+ * {@link Type type}, {@link State state}, {@link #getTimeStamp() commit time} and nested {@link CDOPackageInfo package
+ * info} objects that describe all the nested packages.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.has {@link CDOPackageUnit.Type}
+ * @apiviz.has {@link CDOPackageUnit.State}
+ * @apiviz.composedOf {@link CDOPackageInfo}
+ */
+public interface CDOPackageUnit extends Comparable<CDOPackageUnit>
+{
+ /**
+ * Returns the package registry this package unit is managed by.
+ */
+ public CDOPackageRegistry getPackageRegistry();
+
+ /**
+ * Returns the ID of this package unit.
+ * <p>
+ * Same as {@link #getTopLevelPackageInfo()}. {@link CDOPackageInfo#getPackageURI()}.
+ */
+ public String getID();
+
+ /**
+ * Returns the current state of this package unit.
+ */
+ public State getState();
+
+ /**
+ * Returns the current type of this package unit.
+ */
+ public Type getType();
+
+ /**
+ * Returns the type of this package unit as it was at the time it was originally committed by a client.
+ */
+ public Type getOriginalType();
+
+ /**
+ * Returns the time this package unit was originally committed.
+ */
+ public long getTimeStamp();
+
+ /**
+ * Returns the {@link CDOPackageInfo package info} object that describes the top level {@link EPackage package} of the
+ * nested package tree structure described by this package unit.
+ */
+ public CDOPackageInfo getTopLevelPackageInfo();
+
+ /**
+ * Returns the {@link CDOPackageInfo package info} object that describes the {@link EPackage package} with the given
+ * namespace URI, or <code>null</code> if this package unit does not contain a package with this URI.
+ */
+ public CDOPackageInfo getPackageInfo(String packageURI);
+
+ /**
+ * Returns all {@link CDOPackageInfo package info} objects of the nested package tree structure described by this
+ * package unit in depth-first traversal order.
+ */
+ public CDOPackageInfo[] getPackageInfos();
+
+ /**
+ * Returns all {@link EPackage packages} of the nested package tree structure described by this package unit in
+ * depth-first traversal order.
+ *
+ * @param loadOnDemand
+ * If <code>true</code> and this package unit is not {@link State#LOADED LOADED} the package unit is
+ * implicitely loaded. If <code>false</code> and this package unit is not {@link State#LOADED LOADED} an
+ * empty array is returned.
+ */
+ public EPackage[] getEPackages(boolean loadOnDemand);
+
+ /**
+ * Returns <code>true</code> is this package unit describes one of the models <i>Ecore</i>, <i>Eresource</i> or
+ * <i>Etypes</i>, <code>false</code> otherwise.
+ * <p>
+ * Note that the models <i>Ecore</i>, <i>Eresource</i> and <i>Etypes</i> are expected to be present as generated
+ * {@link Type#NATIVE NATIVE} models in all deployments.
+ */
+ public boolean isSystem();
+
+ /**
+ * Returns <code>true</code> is this package unit describes the model <i>Eresource</i> , <code>false</code> otherwise.
+ * <p>
+ * Note that the model <i>Eresource</i> is expected to bepresent as generated {@link Type#NATIVE NATIVE} models in all
+ * deployments.
+ *
+ * @since 4.0
+ */
+ public boolean isResource();
+
+ /**
+ * Describes the possible states a {@link CDOPackageUnit package unit} may be in during its lifecycle.
+ *
+ * @author Eike Stepper
+ */
+ public enum State
+ {
+ /**
+ * The state of a {@link CDOPackageUnit package unit} after one of its described {@link EPackage packages} is newly
+ * attached to a transactional {@link CDOPackageRegistry package registry}, but before the associated transaction is
+ * committed. A {@link #NEW} package unit can only transition to {@link #LOADED} or {@link #DISPOSED}.
+ */
+ NEW,
+
+ /**
+ * The state of a {@link CDOPackageUnit package unit} after the described {@link EPackage packages} are loaded or
+ * wired from the {@link Registry#INSTANCE global package registry}. A {@link #LOADED} package unit can only
+ * transition to {@link #DISPOSED}.
+ */
+ LOADED,
+
+ /**
+ * The state of a {@link CDOPackageUnit package unit} after the context of the associated {@link CDOPackageRegistry
+ * package registry} has been initialized, that is the repository been started or the session been opened. A
+ * {@link #PROXY} package unit can only transition to {@link #LOADED} or {@link #DISPOSED}.
+ */
+ PROXY,
+
+ /**
+ * The state of a {@link CDOPackageUnit package unit} after the associated {@link CDOPackageRegistry package
+ * registry} has been deactivated, that is the repository been stopped or the session been closed. A
+ * {@link #DISPOSED} package unit can not transition to any other state.
+ */
+ DISPOSED
+ }
+
+ /**
+ * Describes the instances of {@link EClass classes} of a {@link CDOPackageUnit package unit}.
+ *
+ * @author Eike Stepper
+ */
+ public enum Type
+ {
+ /**
+ * The type of models that are generated specifically for the usage with CDO. Instances of {@link EClass classes} of
+ * these models can be directly cast to InternalCDOObject.
+ */
+ NATIVE,
+
+ /**
+ * The type of models that are <b>not</b> generated specifically for the usage with CDO. Instances of {@link EClass
+ * classes} of these models can <b>not</b> be directly cast to InternalCDOObject.
+ */
+ LEGACY,
+
+ /**
+ * The type of models that are not generated <b>at all</b> but rather dynamically contructed at runtime. Instances
+ * of {@link EClass classes} of these models <b>can</b> be directly cast to InternalCDOObject, i.e. they're
+ * implicitely <i>native</i>.
+ */
+ DYNAMIC,
+
+ /**
+ * Used to indicate that the type of a model could not be determined. Refer to the
+ * {@link CDOPackageTypeRegistry#INSTANCE package type registry} on how to deal with this scenario.
+ */
+ UNKNOWN;
+
+ /**
+ * Returns <code>true</code> if this type is either {@link #NATIVE} or {@link #LEGACY}, <code>false</code>
+ * otherwise.
+ */
+ public boolean isGenerated()
+ {
+ checkNotUnknown();
+ return this == NATIVE || this == LEGACY;
+ }
+
+ /**
+ * @throws IllegalStateException
+ * if this type is {@link #UNKNOWN}.
+ */
+ public void checkNotUnknown() throws IllegalStateException
+ {
+ if (this == UNKNOWN)
+ {
+ throw new IllegalStateException(Messages.getString("CDOPackageUnit.0")); //$NON-NLS-1$
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
index cfd8b13691..e6200c5714 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
@@ -1,513 +1,513 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Victor Roldan Betancort - maintenance
- * Simon McDuff - maintenance
- */
-package org.eclipse.emf.cdo.common.model;
-
-import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry;
-
-import org.eclipse.net4j.util.WrappedException;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-/**
- * Various static helper methods for dealing with EMF meta models.
- *
- * @author Eike Stepper
- * @since 2.0
- * @apiviz.exclude
- */
-public final class EMFUtil
-{
- /**
- * @since 3.0
- */
- public static final String CDO_ANNOTATION_SOURCE = "http://www.eclipse.org/emf/CDO";
-
- /**
- * @since 3.0
- */
- public static final String CDO_ANNOTATION_KEY_PERSISTENT = "persistent";
-
- private static final EReference EOPERATION_EEXCEPTIONS = EcorePackage.eINSTANCE.getEOperation_EExceptions();
-
- private static final EReference ETYPED_ELEMENT_ETYPE = EcorePackage.eINSTANCE.getETypedElement_EType();
-
- private static final EReference ECLASS_ESUPER_TYPES = EcorePackage.eINSTANCE.getEClass_ESuperTypes();
-
- private EMFUtil()
- {
- }
-
- public static EPackage getGeneratedEPackage(EPackage ePackage)
- {
- String packageURI = ePackage.getNsURI();
- if (packageURI.equals(EcorePackage.eINSTANCE.getNsURI()))
- {
- return EcorePackage.eINSTANCE;
- }
-
- EPackage.Registry registry = EPackage.Registry.INSTANCE;
- return registry.getEPackage(packageURI);
- }
-
- public static Map.Entry<String, Object>[] getSortedRegistryEntries(EPackage.Registry packageRegistry)
- {
- Set<Map.Entry<String, Object>> entries = packageRegistry.entrySet();
- @SuppressWarnings("unchecked")
- Map.Entry<String, Object>[] array = entries.toArray(new Entry[entries.size()]);
- Arrays.sort(array, new Comparator<Map.Entry<String, Object>>()
- {
- public int compare(Map.Entry<String, Object> o1, Map.Entry<String, Object> o2)
- {
- return o1.getKey().compareTo(o2.getKey());
- }
- });
-
- return array;
- }
-
- public static EPackage getTopLevelPackage(EPackage ePackage)
- {
- EPackage superPackage = ePackage.getESuperPackage();
- return superPackage == null ? ePackage : getTopLevelPackage(superPackage);
- }
-
- /**
- * @since 2.0
- */
- public static EPackage createEPackage(String name, String nsPrefix, String nsURI)
- {
- EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage();
- ePackage.setName(name);
- ePackage.setNsPrefix(nsPrefix);
- ePackage.setNsURI(nsURI);
- return ePackage;
- }
-
- /**
- * @since 2.0
- */
- public static EClass createEClass(EPackage ePackage, String name, boolean isAbstract, boolean isInterface)
- {
- EClass eClass = EcoreFactory.eINSTANCE.createEClass();
- eClass.setName(name);
- eClass.setAbstract(isAbstract);
- eClass.setInterface(isInterface);
- ePackage.getEClassifiers().add(eClass);
- return eClass;
- }
-
- /**
- * @since 2.0
- */
- public static EAttribute createEAttribute(EClass eClass, String name, EClassifier type)
- {
- EAttribute eAttribute = EcoreFactory.eINSTANCE.createEAttribute();
- eAttribute.setName(name);
- eAttribute.setEType(type);
- eClass.getEStructuralFeatures().add(eAttribute);
- return eAttribute;
- }
-
- /**
- * @since 2.0
- */
- public static EReference createEReference(EClass eClass, String name, EClassifier type, boolean isRequired,
- boolean isMany)
- {
- EReference eReference = EcoreFactory.eINSTANCE.createEReference();
- eReference.setName(name);
- eReference.setEType(type);
- eReference.setLowerBound(isRequired ? 1 : 0);
- eReference.setUpperBound(isMany ? -1 : 0);
- eClass.getEStructuralFeatures().add(eReference);
- return eReference;
- }
-
- public static EClass[] getPersistentClasses(EPackage ePackage)
- {
- List<EClass> result = new ArrayList<EClass>();
- for (EClassifier classifier : ePackage.getEClassifiers())
- {
- if (classifier instanceof EClass)
- {
- result.add((EClass)classifier);
- }
- }
-
- return result.toArray(new EClass[result.size()]);
- }
-
- /**
- * @since 3.0
- */
- public static List<EStructuralFeature> getPersistentFeatures(EList<EStructuralFeature> eFeatures)
- {
- List<EStructuralFeature> result = new ArrayList<EStructuralFeature>();
- for (EStructuralFeature feature : eFeatures)
- {
- if (isPersistent(feature))
- {
- result.add(feature);
- }
- }
-
- return result;
- }
-
- /**
- * @since 3.0
- */
- public static boolean isPersistent(EStructuralFeature feature)
- {
- if (feature == ECLASS_ESUPER_TYPES || feature == ETYPED_ELEMENT_ETYPE || feature == EOPERATION_EEXCEPTIONS)
- {
- // http://www.eclipse.org/newsportal/article.php?id=26780&group=eclipse.tools.emf#26780
- return false;
- }
-
- String persistent = EcoreUtil.getAnnotation(feature, CDO_ANNOTATION_SOURCE, CDO_ANNOTATION_KEY_PERSISTENT);
- if (persistent != null)
- {
- return "true".equalsIgnoreCase(persistent);
- }
-
- if (feature.isTransient())
- {
- // Bug 333950: Transient eRefs with a persistent eOpposite, must be considered persistent
- if (feature instanceof EReference)
- {
- EReference eOpposite = ((EReference)feature).getEOpposite();
- if (eOpposite != null && !eOpposite.isTransient())
- {
- return true;
- }
- }
-
- return false;
- }
-
- return true;
- }
-
- public static boolean isDynamicEPackage(Object value)
- {
- return value.getClass() == EPackageImpl.class;
- }
-
- public static String getParentURI(EPackage ePackage)
- {
- EPackage superPackage = ePackage.getESuperPackage();
- String parentURI = superPackage == null ? null : superPackage.getNsURI();
- return parentURI;
- }
-
- public static void registerPackage(EPackage ePackage, EPackage.Registry... packageRegistries)
- {
- ePackage.getClass(); // Initialize package in standalone mode
- if (packageRegistries == null || packageRegistries.length == 0)
- {
- EPackage.Registry[] globalRegistry = { EPackage.Registry.INSTANCE };
- packageRegistries = globalRegistry;
- }
-
- for (EPackage.Registry packageRegistry : packageRegistries)
- {
- packageRegistry.put(ePackage.getNsURI(), ePackage);
- }
- }
-
- public static byte[] getEPackageBytes(EPackage ePackage, boolean zipped, EPackage.Registry packageRegistry)
- {
- try
- {
- Resource resource = ePackage.eResource();
- if (resource == null)
- {
- // Happens e.g. for dynamic packages that were not loaded from a resource
- ResourceSet resourceSet = newEcoreResourceSet(packageRegistry);
- resource = resourceSet.createResource(URI.createURI(ePackage.getNsURI()));
- resource.getContents().add(ePackage);
- }
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- resource.save(baos, createResourceOptions(zipped));
- return baos.toByteArray();
- }
- catch (Exception ex)
- {
- throw WrappedException.wrap(ex);
- }
- }
-
- /**
- * @since 3.0
- */
- public static EPackage createEPackage(String uri, byte[] bytes, boolean zipped, ResourceSet resourceSet,
- boolean lookForResource)
- {
- try
- {
- Resource resource = null;
- if (lookForResource)
- {
- resource = resourceSet.getResource(URI.createURI(uri), true);
- }
-
- if (resource == null)
- {
- resource = resourceSet.createResource(URI.createURI(uri));
- }
-
- ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- resource.load(bais, createResourceOptions(zipped));
-
- EList<EObject> contents = resource.getContents();
- return (EPackage)contents.get(0);
- }
- catch (Exception ex)
- {
- throw WrappedException.wrap(ex);
- }
- }
-
- private static Map<String, Object> createResourceOptions(boolean zipped)
- {
- Map<String, Object> options = new HashMap<String, Object>();
- if (zipped)
- {
- options.put(Resource.OPTION_ZIP, true);
- }
-
- return options;
- }
-
- public static void addAdapter(Notifier notifier, Adapter adapter)
- {
- synchronized (notifier)
- {
- EList<Adapter> adapters = notifier.eAdapters();
- adapters.add(adapter);
- }
- }
-
- public static EPackage[] getAllPackages(EPackage ePackage)
- {
- List<EPackage> result = new ArrayList<EPackage>();
- getAllPackages(ePackage, result);
- return result.toArray(new EPackage[result.size()]);
- }
-
- private static void getAllPackages(EPackage ePackage, List<EPackage> result)
- {
- result.add(ePackage);
- for (EPackage subPackage : ePackage.getESubpackages())
- {
- getAllPackages(subPackage, result);
- }
- }
-
- public static String getQualifiedName(EPackage ePackage, String separator)
- {
- StringBuilder builder = new StringBuilder();
- EPackage eSuperPackage = ePackage.getESuperPackage();
- if (eSuperPackage != null)
- {
- builder.append(getQualifiedName(eSuperPackage, separator));
- builder.append(separator);
- }
-
- builder.append(ePackage.getName());
- return builder.toString();
- }
-
- public static String getQualifiedName(EClassifier classifier, String separator)
- {
- StringBuilder builder = new StringBuilder();
- EPackage ePackage = classifier.getEPackage();
- if (ePackage != null)
- {
- builder.append(getQualifiedName(ePackage, separator));
- builder.append(separator);
- }
-
- builder.append(classifier.getName());
- return builder.toString();
- }
-
- public static ResourceSet newResourceSet(Resource.Factory resourceFactory)
- {
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", resourceFactory); //$NON-NLS-1$
- return resourceSet;
- }
-
- public static ResourceSet newEcoreResourceSet(EPackage.Registry packageRegistry)
- {
- ResourceSet resourceSet = newResourceSet(new EcoreResourceFactoryImpl());
- resourceSet.setPackageRegistry(packageRegistry);
- return resourceSet;
- }
-
- public static ResourceSet newEcoreResourceSet()
- {
- return newEcoreResourceSet(EPackage.Registry.INSTANCE);
- }
-
- /**
- * @since 3.0
- */
- public static EObject safeResolve(EObject proxy, ResourceSet resourceSet)
- {
- if (!proxy.eIsProxy())
- {
- return proxy;
- }
-
- EObject resolved = EcoreUtil.resolve(proxy, resourceSet);
- if (resolved == proxy)
- {
- throw new IllegalStateException("Unresolvable proxy: " + ((InternalEObject)proxy).eProxyURI());
- }
-
- return resolved;
- }
-
- /**
- * @since 3.0
- */
- public static void safeResolveAll(ResourceSet resourceSet)
- {
- TreeIterator<Notifier> it = resourceSet.getAllContents();
- while (it.hasNext())
- {
- Notifier notifier = it.next();
- if (notifier instanceof EObject)
- {
- safeResolve((EObject)notifier, resourceSet);
- Iterator<EObject> it2 = ((EObject)notifier).eCrossReferences().iterator();
- while (it2.hasNext())
- {
- safeResolve(it2.next(), resourceSet);
- }
- }
- }
- }
-
- /**
- * @see ExtResourceSet
- * @since 4.0
- */
- public static ExtResourceSet createExtResourceSet(InternalCDOPackageRegistry packageRegistry, boolean delegating,
- boolean demandLoading)
- {
- Resource.Factory resourceFactory = new EcoreResourceFactoryImpl();
-
- ExtResourceSet resourceSet = new ExtResourceSet(delegating, demandLoading);
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", resourceFactory); //$NON-NLS-1$
- resourceSet.setPackageRegistry(packageRegistry);
- return resourceSet;
- }
-
- /**
- * An extension of {@link ResourceSetImpl} that allows demandLoading of resources and delegation of resource lookups,
- * to be switched on/off as desired.
- *
- * @since 4.0
- * @apiviz.exclude
- */
- public static class ExtResourceSet extends ResourceSetImpl
- {
- private boolean delegating;
-
- private boolean demandLoading;
-
- ExtResourceSet(boolean delegating, boolean demandLoading)
- {
- this.delegating = delegating;
- this.demandLoading = demandLoading;
- }
-
- public boolean isDelegating()
- {
- return delegating;
- }
-
- public void setDelegating(boolean delegating)
- {
- this.delegating = delegating;
- }
-
- public boolean isDemandLoading()
- {
- return demandLoading;
- }
-
- public void setDemandLoading(boolean demandLoading)
- {
- this.demandLoading = demandLoading;
- }
-
- @Override
- protected void demandLoad(Resource resource) throws IOException
- {
- if (demandLoading)
- {
- super.demandLoad(resource);
- }
- }
-
- @Override
- protected Resource delegatedGetResource(URI uri, boolean loadOnDemand)
- {
- if (delegating)
- {
- return super.delegatedGetResource(uri, loadOnDemand);
- }
-
- return null;
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Victor Roldan Betancort - maintenance
+ * Simon McDuff - maintenance
+ */
+package org.eclipse.emf.cdo.common.model;
+
+import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry;
+
+import org.eclipse.net4j.util.WrappedException;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+/**
+ * Various static helper methods for dealing with EMF meta models.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ * @apiviz.exclude
+ */
+public final class EMFUtil
+{
+ /**
+ * @since 3.0
+ */
+ public static final String CDO_ANNOTATION_SOURCE = "http://www.eclipse.org/emf/CDO";
+
+ /**
+ * @since 3.0
+ */
+ public static final String CDO_ANNOTATION_KEY_PERSISTENT = "persistent";
+
+ private static final EReference EOPERATION_EEXCEPTIONS = EcorePackage.eINSTANCE.getEOperation_EExceptions();
+
+ private static final EReference ETYPED_ELEMENT_ETYPE = EcorePackage.eINSTANCE.getETypedElement_EType();
+
+ private static final EReference ECLASS_ESUPER_TYPES = EcorePackage.eINSTANCE.getEClass_ESuperTypes();
+
+ private EMFUtil()
+ {
+ }
+
+ public static EPackage getGeneratedEPackage(EPackage ePackage)
+ {
+ String packageURI = ePackage.getNsURI();
+ if (packageURI.equals(EcorePackage.eINSTANCE.getNsURI()))
+ {
+ return EcorePackage.eINSTANCE;
+ }
+
+ EPackage.Registry registry = EPackage.Registry.INSTANCE;
+ return registry.getEPackage(packageURI);
+ }
+
+ public static Map.Entry<String, Object>[] getSortedRegistryEntries(EPackage.Registry packageRegistry)
+ {
+ Set<Map.Entry<String, Object>> entries = packageRegistry.entrySet();
+ @SuppressWarnings("unchecked")
+ Map.Entry<String, Object>[] array = entries.toArray(new Entry[entries.size()]);
+ Arrays.sort(array, new Comparator<Map.Entry<String, Object>>()
+ {
+ public int compare(Map.Entry<String, Object> o1, Map.Entry<String, Object> o2)
+ {
+ return o1.getKey().compareTo(o2.getKey());
+ }
+ });
+
+ return array;
+ }
+
+ public static EPackage getTopLevelPackage(EPackage ePackage)
+ {
+ EPackage superPackage = ePackage.getESuperPackage();
+ return superPackage == null ? ePackage : getTopLevelPackage(superPackage);
+ }
+
+ /**
+ * @since 2.0
+ */
+ public static EPackage createEPackage(String name, String nsPrefix, String nsURI)
+ {
+ EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage();
+ ePackage.setName(name);
+ ePackage.setNsPrefix(nsPrefix);
+ ePackage.setNsURI(nsURI);
+ return ePackage;
+ }
+
+ /**
+ * @since 2.0
+ */
+ public static EClass createEClass(EPackage ePackage, String name, boolean isAbstract, boolean isInterface)
+ {
+ EClass eClass = EcoreFactory.eINSTANCE.createEClass();
+ eClass.setName(name);
+ eClass.setAbstract(isAbstract);
+ eClass.setInterface(isInterface);
+ ePackage.getEClassifiers().add(eClass);
+ return eClass;
+ }
+
+ /**
+ * @since 2.0
+ */
+ public static EAttribute createEAttribute(EClass eClass, String name, EClassifier type)
+ {
+ EAttribute eAttribute = EcoreFactory.eINSTANCE.createEAttribute();
+ eAttribute.setName(name);
+ eAttribute.setEType(type);
+ eClass.getEStructuralFeatures().add(eAttribute);
+ return eAttribute;
+ }
+
+ /**
+ * @since 2.0
+ */
+ public static EReference createEReference(EClass eClass, String name, EClassifier type, boolean isRequired,
+ boolean isMany)
+ {
+ EReference eReference = EcoreFactory.eINSTANCE.createEReference();
+ eReference.setName(name);
+ eReference.setEType(type);
+ eReference.setLowerBound(isRequired ? 1 : 0);
+ eReference.setUpperBound(isMany ? -1 : 0);
+ eClass.getEStructuralFeatures().add(eReference);
+ return eReference;
+ }
+
+ public static EClass[] getPersistentClasses(EPackage ePackage)
+ {
+ List<EClass> result = new ArrayList<EClass>();
+ for (EClassifier classifier : ePackage.getEClassifiers())
+ {
+ if (classifier instanceof EClass)
+ {
+ result.add((EClass)classifier);
+ }
+ }
+
+ return result.toArray(new EClass[result.size()]);
+ }
+
+ /**
+ * @since 3.0
+ */
+ public static List<EStructuralFeature> getPersistentFeatures(EList<EStructuralFeature> eFeatures)
+ {
+ List<EStructuralFeature> result = new ArrayList<EStructuralFeature>();
+ for (EStructuralFeature feature : eFeatures)
+ {
+ if (isPersistent(feature))
+ {
+ result.add(feature);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * @since 3.0
+ */
+ public static boolean isPersistent(EStructuralFeature feature)
+ {
+ if (feature == ECLASS_ESUPER_TYPES || feature == ETYPED_ELEMENT_ETYPE || feature == EOPERATION_EEXCEPTIONS)
+ {
+ // http://www.eclipse.org/newsportal/article.php?id=26780&group=eclipse.tools.emf#26780
+ return false;
+ }
+
+ String persistent = EcoreUtil.getAnnotation(feature, CDO_ANNOTATION_SOURCE, CDO_ANNOTATION_KEY_PERSISTENT);
+ if (persistent != null)
+ {
+ return "true".equalsIgnoreCase(persistent);
+ }
+
+ if (feature.isTransient())
+ {
+ // Bug 333950: Transient eRefs with a persistent eOpposite, must be considered persistent
+ if (feature instanceof EReference)
+ {
+ EReference eOpposite = ((EReference)feature).getEOpposite();
+ if (eOpposite != null && !eOpposite.isTransient())
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean isDynamicEPackage(Object value)
+ {
+ return value.getClass() == EPackageImpl.class;
+ }
+
+ public static String getParentURI(EPackage ePackage)
+ {
+ EPackage superPackage = ePackage.getESuperPackage();
+ String parentURI = superPackage == null ? null : superPackage.getNsURI();
+ return parentURI;
+ }
+
+ public static void registerPackage(EPackage ePackage, EPackage.Registry... packageRegistries)
+ {
+ ePackage.getClass(); // Initialize package in standalone mode
+ if (packageRegistries == null || packageRegistries.length == 0)
+ {
+ EPackage.Registry[] globalRegistry = { EPackage.Registry.INSTANCE };
+ packageRegistries = globalRegistry;
+ }
+
+ for (EPackage.Registry packageRegistry : packageRegistries)
+ {
+ packageRegistry.put(ePackage.getNsURI(), ePackage);
+ }
+ }
+
+ public static byte[] getEPackageBytes(EPackage ePackage, boolean zipped, EPackage.Registry packageRegistry)
+ {
+ try
+ {
+ Resource resource = ePackage.eResource();
+ if (resource == null)
+ {
+ // Happens e.g. for dynamic packages that were not loaded from a resource
+ ResourceSet resourceSet = newEcoreResourceSet(packageRegistry);
+ resource = resourceSet.createResource(URI.createURI(ePackage.getNsURI()));
+ resource.getContents().add(ePackage);
+ }
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ resource.save(baos, createResourceOptions(zipped));
+ return baos.toByteArray();
+ }
+ catch (Exception ex)
+ {
+ throw WrappedException.wrap(ex);
+ }
+ }
+
+ /**
+ * @since 3.0
+ */
+ public static EPackage createEPackage(String uri, byte[] bytes, boolean zipped, ResourceSet resourceSet,
+ boolean lookForResource)
+ {
+ try
+ {
+ Resource resource = null;
+ if (lookForResource)
+ {
+ resource = resourceSet.getResource(URI.createURI(uri), true);
+ }
+
+ if (resource == null)
+ {
+ resource = resourceSet.createResource(URI.createURI(uri));
+ }
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ resource.load(bais, createResourceOptions(zipped));
+
+ EList<EObject> contents = resource.getContents();
+ return (EPackage)contents.get(0);
+ }
+ catch (Exception ex)
+ {
+ throw WrappedException.wrap(ex);
+ }
+ }
+
+ private static Map<String, Object> createResourceOptions(boolean zipped)
+ {
+ Map<String, Object> options = new HashMap<String, Object>();
+ if (zipped)
+ {
+ options.put(Resource.OPTION_ZIP, true);
+ }
+
+ return options;
+ }
+
+ public static void addAdapter(Notifier notifier, Adapter adapter)
+ {
+ synchronized (notifier)
+ {
+ EList<Adapter> adapters = notifier.eAdapters();
+ adapters.add(adapter);
+ }
+ }
+
+ public static EPackage[] getAllPackages(EPackage ePackage)
+ {
+ List<EPackage> result = new ArrayList<EPackage>();
+ getAllPackages(ePackage, result);
+ return result.toArray(new EPackage[result.size()]);
+ }
+
+ private static void getAllPackages(EPackage ePackage, List<EPackage> result)
+ {
+ result.add(ePackage);
+ for (EPackage subPackage : ePackage.getESubpackages())
+ {
+ getAllPackages(subPackage, result);
+ }
+ }
+
+ public static String getQualifiedName(EPackage ePackage, String separator)
+ {
+ StringBuilder builder = new StringBuilder();
+ EPackage eSuperPackage = ePackage.getESuperPackage();
+ if (eSuperPackage != null)
+ {
+ builder.append(getQualifiedName(eSuperPackage, separator));
+ builder.append(separator);
+ }
+
+ builder.append(ePackage.getName());
+ return builder.toString();
+ }
+
+ public static String getQualifiedName(EClassifier classifier, String separator)
+ {
+ StringBuilder builder = new StringBuilder();
+ EPackage ePackage = classifier.getEPackage();
+ if (ePackage != null)
+ {
+ builder.append(getQualifiedName(ePackage, separator));
+ builder.append(separator);
+ }
+
+ builder.append(classifier.getName());
+ return builder.toString();
+ }
+
+ public static ResourceSet newResourceSet(Resource.Factory resourceFactory)
+ {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", resourceFactory); //$NON-NLS-1$
+ return resourceSet;
+ }
+
+ public static ResourceSet newEcoreResourceSet(EPackage.Registry packageRegistry)
+ {
+ ResourceSet resourceSet = newResourceSet(new EcoreResourceFactoryImpl());
+ resourceSet.setPackageRegistry(packageRegistry);
+ return resourceSet;
+ }
+
+ public static ResourceSet newEcoreResourceSet()
+ {
+ return newEcoreResourceSet(EPackage.Registry.INSTANCE);
+ }
+
+ /**
+ * @since 3.0
+ */
+ public static EObject safeResolve(EObject proxy, ResourceSet resourceSet)
+ {
+ if (!proxy.eIsProxy())
+ {
+ return proxy;
+ }
+
+ EObject resolved = EcoreUtil.resolve(proxy, resourceSet);
+ if (resolved == proxy)
+ {
+ throw new IllegalStateException("Unresolvable proxy: " + ((InternalEObject)proxy).eProxyURI());
+ }
+
+ return resolved;
+ }
+
+ /**
+ * @since 3.0
+ */
+ public static void safeResolveAll(ResourceSet resourceSet)
+ {
+ TreeIterator<Notifier> it = resourceSet.getAllContents();
+ while (it.hasNext())
+ {
+ Notifier notifier = it.next();
+ if (notifier instanceof EObject)
+ {
+ safeResolve((EObject)notifier, resourceSet);
+ Iterator<EObject> it2 = ((EObject)notifier).eCrossReferences().iterator();
+ while (it2.hasNext())
+ {
+ safeResolve(it2.next(), resourceSet);
+ }
+ }
+ }
+ }
+
+ /**
+ * @see ExtResourceSet
+ * @since 4.0
+ */
+ public static ExtResourceSet createExtResourceSet(InternalCDOPackageRegistry packageRegistry, boolean delegating,
+ boolean demandLoading)
+ {
+ Resource.Factory resourceFactory = new EcoreResourceFactoryImpl();
+
+ ExtResourceSet resourceSet = new ExtResourceSet(delegating, demandLoading);
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", resourceFactory); //$NON-NLS-1$
+ resourceSet.setPackageRegistry(packageRegistry);
+ return resourceSet;
+ }
+
+ /**
+ * An extension of {@link ResourceSetImpl} that allows demandLoading of resources and delegation of resource lookups,
+ * to be switched on/off as desired.
+ *
+ * @since 4.0
+ * @apiviz.exclude
+ */
+ public static class ExtResourceSet extends ResourceSetImpl
+ {
+ private boolean delegating;
+
+ private boolean demandLoading;
+
+ ExtResourceSet(boolean delegating, boolean demandLoading)
+ {
+ this.delegating = delegating;
+ this.demandLoading = demandLoading;
+ }
+
+ public boolean isDelegating()
+ {
+ return delegating;
+ }
+
+ public void setDelegating(boolean delegating)
+ {
+ this.delegating = delegating;
+ }
+
+ public boolean isDemandLoading()
+ {
+ return demandLoading;
+ }
+
+ public void setDemandLoading(boolean demandLoading)
+ {
+ this.demandLoading = demandLoading;
+ }
+
+ @Override
+ protected void demandLoad(Resource resource) throws IOException
+ {
+ if (demandLoading)
+ {
+ super.demandLoad(resource);
+ }
+ }
+
+ @Override
+ protected Resource delegatedGetResource(URI uri, boolean loadOnDemand)
+ {
+ if (delegating)
+ {
+ return super.delegatedGetResource(uri, loadOnDemand);
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/package-info.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/package-info.java
index 63bfb5eb9c..0bd3d6bb48 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/package-info.java
@@ -1,18 +1,18 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-
-/**
- * Common concepts for dealing with models and types.
- *
- * @apiviz.exclude .*\.Comparable
- */
-package org.eclipse.emf.cdo.common.model;
-
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Common concepts for dealing with models and types.
+ *
+ * @apiviz.exclude .*\.Comparable
+ */
+package org.eclipse.emf.cdo.common.model;
+
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/package-info.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/package-info.java
index 750d1ee1fa..a60e5035d6 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/package-info.java
@@ -1,21 +1,21 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-
-/**
- * Common concepts that are differently extended in clients and servers.
- *
- * @apiviz.exclude .*\.IOptions
- * @apiviz.exclude .*\.IOptionsContainer
- * @apiviz.exclude .*\.Closeable
- * @apiviz.exclude .*Event
- */
-package org.eclipse.emf.cdo.common;
-
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Common concepts that are differently extended in clients and servers.
+ *
+ * @apiviz.exclude .*\.IOptions
+ * @apiviz.exclude .*\.IOptionsContainer
+ * @apiviz.exclude .*\.Closeable
+ * @apiviz.exclude .*Event
+ */
+package org.eclipse.emf.cdo.common;
+
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOAuthenticator.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOAuthenticator.java
index 2eb66f6cc7..30490a2c7e 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOAuthenticator.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOAuthenticator.java
@@ -1,45 +1,45 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.protocol;
-
-import org.eclipse.emf.cdo.spi.common.CDOAuthenticationResult;
-
-import org.eclipse.net4j.util.security.IPasswordCredentialsProvider;
-
-/**
- * The front-end of the CDO challenge/response authentication.
- *
- * @author Eike Stepper
- * @since 2.0
- */
-public interface CDOAuthenticator
-{
- public String getEncryptionAlgorithmName();
-
- public void setEncryptionAlgorithmName(String encryptionAlgorithmName);
-
- public byte[] getEncryptionSaltBytes();
-
- public void setEncryptionSaltBytes(byte[] encryptionSaltBytes);
-
- public int getEncryptionIterationCount();
-
- public void setEncryptionIterationCount(int encryptionIterationCount);
-
- public IPasswordCredentialsProvider getCredentialsProvider();
-
- public void setCredentialsProvider(IPasswordCredentialsProvider credentialsProvider);
-
- /**
- * @since 4.0
- */
- public CDOAuthenticationResult authenticate(byte[] randomToken);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.protocol;
+
+import org.eclipse.emf.cdo.spi.common.CDOAuthenticationResult;
+
+import org.eclipse.net4j.util.security.IPasswordCredentialsProvider;
+
+/**
+ * The front-end of the CDO challenge/response authentication.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ */
+public interface CDOAuthenticator
+{
+ public String getEncryptionAlgorithmName();
+
+ public void setEncryptionAlgorithmName(String encryptionAlgorithmName);
+
+ public byte[] getEncryptionSaltBytes();
+
+ public void setEncryptionSaltBytes(byte[] encryptionSaltBytes);
+
+ public int getEncryptionIterationCount();
+
+ public void setEncryptionIterationCount(int encryptionIterationCount);
+
+ public IPasswordCredentialsProvider getCredentialsProvider();
+
+ public void setCredentialsProvider(IPasswordCredentialsProvider credentialsProvider);
+
+ /**
+ * @since 4.0
+ */
+ public CDOAuthenticationResult authenticate(byte[] randomToken);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocol.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocol.java
index b67dca234f..211b423604 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocol.java
@@ -1,28 +1,28 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.protocol;
-
-import org.eclipse.emf.cdo.common.CDOCommonSession;
-
-/**
- * The communications protocol associated with a CDO {@link CDOCommonSession session}.
- *
- * @author Eike Stepper
- * @since 2.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.uses {@link CDODataInput}
- * @apiviz.uses {@link CDODataOutput}
- */
-public interface CDOProtocol
-{
- public CDOCommonSession getSession();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.protocol;
+
+import org.eclipse.emf.cdo.common.CDOCommonSession;
+
+/**
+ * The communications protocol associated with a CDO {@link CDOCommonSession session}.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.uses {@link CDODataInput}
+ * @apiviz.uses {@link CDODataOutput}
+ */
+public interface CDOProtocol
+{
+ public CDOCommonSession getSession();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
index d23efa66c5..5d2b64b780 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
@@ -1,337 +1,337 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Simon McDuff - bug 230832
- * Simon McDuff - bug 233490
- * Simon McDuff - bug 213402
- */
-package org.eclipse.emf.cdo.common.protocol;
-
-/**
- * Symbolic protocol constants commonly used in CDO.
- *
- * @author Eike Stepper
- * @since 2.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOProtocolConstants
-{
- public static final String PROTOCOL_NAME = "cdo"; //$NON-NLS-1$
-
- // //////////////////////////////////////////////////////////////////////
- // Signal IDs
-
- public static final short SIGNAL_OPEN_SESSION = 1;
-
- public static final short SIGNAL_AUTHENTICATION = 2;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_OPEN_VIEW = 3;
-
- /**
- * @since 4.0
- */
- public static final short SIGNAL_SWITCH_TARGET = 4;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_CLOSE_VIEW = 5;
-
- public static final short SIGNAL_LOAD_PACKAGES = 6;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_LOAD_REVISIONS = 7;
-
- public static final short SIGNAL_LOAD_REVISION_BY_VERSION = 8;
-
- public static final short SIGNAL_LOAD_CHUNK = 9;
-
- public static final short SIGNAL_COMMIT_NOTIFICATION = 10;
-
- public static final short SIGNAL_COMMIT_TRANSACTION = 11;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_COMMIT_DELEGATION = 12;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_XA_COMMIT_TRANSACTION_PHASE1 = 13;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_XA_COMMIT_TRANSACTION_PHASE2 = 14;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_XA_COMMIT_TRANSACTION_PHASE3 = 15;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_XA_COMMIT_TRANSACTION_CANCEL = 16;
-
- public static final short SIGNAL_QUERY = 17;
-
- public static final short SIGNAL_QUERY_CANCEL = 18;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_REFRESH_SESSION = 19;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_DISABLE_PASSIVE_UPDATE = 20;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_SET_PASSIVE_UPDATE_MODE = 21;
-
- public static final short SIGNAL_CHANGE_SUBSCRIPTION = 22;
-
- public static final short SIGNAL_REPOSITORY_TIME = 23;
-
- public static final short SIGNAL_LOCK_OBJECTS = 24;
-
- public static final short SIGNAL_UNLOCK_OBJECTS = 25;
-
- public static final short SIGNAL_OBJECT_LOCKED = 26;
-
- /**
- * @since 4.0
- */
- public static final short SIGNAL_LOCK_AREA = 27;
-
- public static final short SIGNAL_GET_REMOTE_SESSIONS = 28;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_REMOTE_MESSAGE = 29;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_REMOTE_MESSAGE_NOTIFICATION = 30;
-
- public static final short SIGNAL_UNSUBSCRIBE_REMOTE_SESSIONS = 31;
-
- public static final short SIGNAL_REMOTE_SESSION_NOTIFICATION = 32;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_CREATE_BRANCH = 33;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_LOAD_BRANCH = 34;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_LOAD_SUB_BRANCHES = 35;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_LOAD_BRANCHES = 36;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_REPOSITORY_TYPE_NOTIFICATION = 37;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_REPOSITORY_STATE_NOTIFICATION = 38;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_BRANCH_NOTIFICATION = 39;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_LOAD_COMMIT_INFOS = 40;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_LOAD_COMMIT_DATA = 41;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_REPLICATE_REPOSITORY = 42;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_REPLICATE_REPOSITORY_RAW = 43;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_LOAD_CHANGE_SETS = 44;
-
- /**
- * @since 3.0
- */
- public static final short SIGNAL_LOAD_MERGE_DATA = 45;
-
- /**
- * @since 4.0
- */
- public static final short SIGNAL_QUERY_LOBS = 46;
-
- /**
- * @since 4.0
- */
- public static final short SIGNAL_LOAD_LOB = 47;
-
- /**
- * @since 4.0
- */
- public static final short SIGNAL_HANDLE_REVISIONS = 48;
-
- /**
- * @since 4.1
- */
- public static final short SIGNAL_LOCK_DELEGATION = 49;
-
- /**
- * @since 4.1
- */
- public static final short SIGNAL_UNLOCK_DELEGATION = 50;
-
- /**
- * @since 4.1
- */
- public static final short SIGNAL_LOCK_NOTIFICATION = 51;
-
- /**
- * @since 4.1
- */
- public static final short SIGNAL_LOCK_STATE = 52;
-
- /**
- * @since 4.1
- */
- public static final short SIGNAL_ENABLE_LOCK_NOTIFICATION = 53;
-
- /**
- * @since 4.1
- */
- public static final short SIGNAL_SET_LOCK_NOTIFICATION_MODE = 54;
-
- // //////////////////////////////////////////////////////////////////////
- // Session Refresh
-
- /**
- * @since 3.0
- */
- public static final byte REFRESH_FINISHED = 0;
-
- /**
- * @since 3.0
- */
- public static final byte REFRESH_PACKAGE_UNIT = 1;
-
- /**
- * @since 3.0
- */
- public static final byte REFRESH_CHANGED_OBJECT = 2;
-
- /**
- * @since 3.0
- */
- public static final byte REFRESH_DETACHED_OBJECT = 3;
-
- // //////////////////////////////////////////////////////////////////////
- // Query Support
-
- public static final String QUERY_LANGUAGE_RESOURCES = "resources"; //$NON-NLS-1$
-
- public static final String QUERY_LANGUAGE_RESOURCES_FOLDER_ID = "folder"; //$NON-NLS-1$
-
- public static final String QUERY_LANGUAGE_RESOURCES_EXACT_MATCH = "exactMatch"; //$NON-NLS-1$
-
- /**
- * @since 3.0
- */
- public static final String QUERY_LANGUAGE_XREFS = "xrefs"; //$NON-NLS-1$
-
- /**
- * @since 3.0
- */
- public static final String QUERY_LANGUAGE_XREFS_SOURCE_REFERENCES = "sourceReferences"; //$NON-NLS-1$
-
- // //////////////////////////////////////////////////////////////////////
- // Locking Objects
-
- public static final int RELEASE_ALL_LOCKS = -1;
-
- // //////////////////////////////////////////////////////////////////////
- // Remote Sessions
-
- public static final int NO_MORE_REMOTE_SESSIONS = -1;
-
- public static final byte REMOTE_SESSION_OPENED = 1;
-
- public static final byte REMOTE_SESSION_CLOSED = 2;
-
- public static final byte REMOTE_SESSION_SUBSCRIBED = 3;
-
- public static final byte REMOTE_SESSION_UNSUBSCRIBED = 4;
-
- /**
- * @since 3.0
- */
- public static final byte REMOTE_SESSION_CUSTOM_DATA = 5;
-
- // //////////////////////////////////////////////////////////////////////
- // Syncing
-
- /**
- * @since 3.0
- */
- public static final byte REPLICATE_FINISHED = 0;
-
- /**
- * @since 3.0
- */
- public static final byte REPLICATE_BRANCH = 1;
-
- /**
- * @since 3.0
- */
- public static final byte REPLICATE_COMMIT = 2;
-
- /**
- * @since 4.1
- */
- public static final byte REPLICATE_LOCKAREA = 3;
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Simon McDuff - bug 230832
+ * Simon McDuff - bug 233490
+ * Simon McDuff - bug 213402
+ */
+package org.eclipse.emf.cdo.common.protocol;
+
+/**
+ * Symbolic protocol constants commonly used in CDO.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOProtocolConstants
+{
+ public static final String PROTOCOL_NAME = "cdo"; //$NON-NLS-1$
+
+ // //////////////////////////////////////////////////////////////////////
+ // Signal IDs
+
+ public static final short SIGNAL_OPEN_SESSION = 1;
+
+ public static final short SIGNAL_AUTHENTICATION = 2;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_OPEN_VIEW = 3;
+
+ /**
+ * @since 4.0
+ */
+ public static final short SIGNAL_SWITCH_TARGET = 4;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_CLOSE_VIEW = 5;
+
+ public static final short SIGNAL_LOAD_PACKAGES = 6;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_LOAD_REVISIONS = 7;
+
+ public static final short SIGNAL_LOAD_REVISION_BY_VERSION = 8;
+
+ public static final short SIGNAL_LOAD_CHUNK = 9;
+
+ public static final short SIGNAL_COMMIT_NOTIFICATION = 10;
+
+ public static final short SIGNAL_COMMIT_TRANSACTION = 11;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_COMMIT_DELEGATION = 12;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_XA_COMMIT_TRANSACTION_PHASE1 = 13;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_XA_COMMIT_TRANSACTION_PHASE2 = 14;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_XA_COMMIT_TRANSACTION_PHASE3 = 15;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_XA_COMMIT_TRANSACTION_CANCEL = 16;
+
+ public static final short SIGNAL_QUERY = 17;
+
+ public static final short SIGNAL_QUERY_CANCEL = 18;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_REFRESH_SESSION = 19;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_DISABLE_PASSIVE_UPDATE = 20;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_SET_PASSIVE_UPDATE_MODE = 21;
+
+ public static final short SIGNAL_CHANGE_SUBSCRIPTION = 22;
+
+ public static final short SIGNAL_REPOSITORY_TIME = 23;
+
+ public static final short SIGNAL_LOCK_OBJECTS = 24;
+
+ public static final short SIGNAL_UNLOCK_OBJECTS = 25;
+
+ public static final short SIGNAL_OBJECT_LOCKED = 26;
+
+ /**
+ * @since 4.0
+ */
+ public static final short SIGNAL_LOCK_AREA = 27;
+
+ public static final short SIGNAL_GET_REMOTE_SESSIONS = 28;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_REMOTE_MESSAGE = 29;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_REMOTE_MESSAGE_NOTIFICATION = 30;
+
+ public static final short SIGNAL_UNSUBSCRIBE_REMOTE_SESSIONS = 31;
+
+ public static final short SIGNAL_REMOTE_SESSION_NOTIFICATION = 32;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_CREATE_BRANCH = 33;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_LOAD_BRANCH = 34;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_LOAD_SUB_BRANCHES = 35;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_LOAD_BRANCHES = 36;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_REPOSITORY_TYPE_NOTIFICATION = 37;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_REPOSITORY_STATE_NOTIFICATION = 38;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_BRANCH_NOTIFICATION = 39;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_LOAD_COMMIT_INFOS = 40;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_LOAD_COMMIT_DATA = 41;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_REPLICATE_REPOSITORY = 42;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_REPLICATE_REPOSITORY_RAW = 43;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_LOAD_CHANGE_SETS = 44;
+
+ /**
+ * @since 3.0
+ */
+ public static final short SIGNAL_LOAD_MERGE_DATA = 45;
+
+ /**
+ * @since 4.0
+ */
+ public static final short SIGNAL_QUERY_LOBS = 46;
+
+ /**
+ * @since 4.0
+ */
+ public static final short SIGNAL_LOAD_LOB = 47;
+
+ /**
+ * @since 4.0
+ */
+ public static final short SIGNAL_HANDLE_REVISIONS = 48;
+
+ /**
+ * @since 4.1
+ */
+ public static final short SIGNAL_LOCK_DELEGATION = 49;
+
+ /**
+ * @since 4.1
+ */
+ public static final short SIGNAL_UNLOCK_DELEGATION = 50;
+
+ /**
+ * @since 4.1
+ */
+ public static final short SIGNAL_LOCK_NOTIFICATION = 51;
+
+ /**
+ * @since 4.1
+ */
+ public static final short SIGNAL_LOCK_STATE = 52;
+
+ /**
+ * @since 4.1
+ */
+ public static final short SIGNAL_ENABLE_LOCK_NOTIFICATION = 53;
+
+ /**
+ * @since 4.1
+ */
+ public static final short SIGNAL_SET_LOCK_NOTIFICATION_MODE = 54;
+
+ // //////////////////////////////////////////////////////////////////////
+ // Session Refresh
+
+ /**
+ * @since 3.0
+ */
+ public static final byte REFRESH_FINISHED = 0;
+
+ /**
+ * @since 3.0
+ */
+ public static final byte REFRESH_PACKAGE_UNIT = 1;
+
+ /**
+ * @since 3.0
+ */
+ public static final byte REFRESH_CHANGED_OBJECT = 2;
+
+ /**
+ * @since 3.0
+ */
+ public static final byte REFRESH_DETACHED_OBJECT = 3;
+
+ // //////////////////////////////////////////////////////////////////////
+ // Query Support
+
+ public static final String QUERY_LANGUAGE_RESOURCES = "resources"; //$NON-NLS-1$
+
+ public static final String QUERY_LANGUAGE_RESOURCES_FOLDER_ID = "folder"; //$NON-NLS-1$
+
+ public static final String QUERY_LANGUAGE_RESOURCES_EXACT_MATCH = "exactMatch"; //$NON-NLS-1$
+
+ /**
+ * @since 3.0
+ */
+ public static final String QUERY_LANGUAGE_XREFS = "xrefs"; //$NON-NLS-1$
+
+ /**
+ * @since 3.0
+ */
+ public static final String QUERY_LANGUAGE_XREFS_SOURCE_REFERENCES = "sourceReferences"; //$NON-NLS-1$
+
+ // //////////////////////////////////////////////////////////////////////
+ // Locking Objects
+
+ public static final int RELEASE_ALL_LOCKS = -1;
+
+ // //////////////////////////////////////////////////////////////////////
+ // Remote Sessions
+
+ public static final int NO_MORE_REMOTE_SESSIONS = -1;
+
+ public static final byte REMOTE_SESSION_OPENED = 1;
+
+ public static final byte REMOTE_SESSION_CLOSED = 2;
+
+ public static final byte REMOTE_SESSION_SUBSCRIBED = 3;
+
+ public static final byte REMOTE_SESSION_UNSUBSCRIBED = 4;
+
+ /**
+ * @since 3.0
+ */
+ public static final byte REMOTE_SESSION_CUSTOM_DATA = 5;
+
+ // //////////////////////////////////////////////////////////////////////
+ // Syncing
+
+ /**
+ * @since 3.0
+ */
+ public static final byte REPLICATE_FINISHED = 0;
+
+ /**
+ * @since 3.0
+ */
+ public static final byte REPLICATE_BRANCH = 1;
+
+ /**
+ * @since 3.0
+ */
+ public static final byte REPLICATE_COMMIT = 2;
+
+ /**
+ * @since 4.1
+ */
+ public static final byte REPLICATE_LOCKAREA = 3;
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/package-info.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/package-info.java
index cdc5429d8a..d19bb6a733 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/package-info.java
@@ -1,15 +1,15 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-
-/**
- * Common concepts for dealing with protocols and CDO-specific I/O.
- */
-package org.eclipse.emf.cdo.common.protocol;
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Common concepts for dealing with protocols and CDO-specific I/O.
+ */
+package org.eclipse.emf.cdo.common.protocol;
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOAllRevisionsProvider.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOAllRevisionsProvider.java
index 82768439d4..773251b5c1 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOAllRevisionsProvider.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOAllRevisionsProvider.java
@@ -1,28 +1,28 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * Provides consumers with all {@link CDORevision revisions} available in an instance of this interface.
- *
- * @author Eike Stepper
- * @since 3.0
- * @apiviz.exclude
- */
-public interface CDOAllRevisionsProvider
-{
- public Map<CDOBranch, List<CDORevision>> getAllRevisions();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Provides consumers with all {@link CDORevision revisions} available in an instance of this interface.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @apiviz.exclude
+ */
+public interface CDOAllRevisionsProvider
+{
+ public Map<CDOBranch, List<CDORevision>> getAllRevisions();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOElementProxy.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOElementProxy.java
index 4fe98a5d37..7694c5598d 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOElementProxy.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOElementProxy.java
@@ -1,25 +1,25 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Simon McDuff - maintenance
- */
-package org.eclipse.emf.cdo.common.revision;
-
-/**
- * A moveable placeholder for the element of a {@link CDOList list} at a specified {@link #getIndex() index}.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOElementProxy
-{
- public int getIndex();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Simon McDuff - maintenance
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+/**
+ * A moveable placeholder for the element of a {@link CDOList list} at a specified {@link #getIndex() index}.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOElementProxy
+{
+ public int getIndex();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOIDAndBranch.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOIDAndBranch.java
index a187a22891..5f2c90981f 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOIDAndBranch.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOIDAndBranch.java
@@ -1,30 +1,30 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.id.CDOID;
-
-/**
- * An {@link CDOID ID} / {@link CDOBranch branch} pair.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.exclude
- */
-public interface CDOIDAndBranch
-{
- public CDOID getID();
-
- public CDOBranch getBranch();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.id.CDOID;
+
+/**
+ * An {@link CDOID ID} / {@link CDOBranch branch} pair.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.exclude
+ */
+public interface CDOIDAndBranch
+{
+ public CDOID getID();
+
+ public CDOBranch getBranch();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOList.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOList.java
index 0b9b27df27..be4b500238 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOList.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOList.java
@@ -1,41 +1,41 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.net4j.util.collection.MoveableList;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * A {@link MoveableList moveable} {@link EList}.
- *
- * @author Simon McDuff
- * @since 2.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.uses {@link CDOElementProxy} - - contains
- */
-public interface CDOList extends MoveableList<Object>, EList<Object>
-{
- /**
- * Returns the element at position index of this list and optionally resolves proxies (see CDOElementProxy).
- * <p>
- *
- * @param index
- * The position of the element to return from this list.
- * @param resolve
- * A value of <code>false</code> indicates that {@link CDORevisionUtil#UNINITIALIZED} may be returned for
- * unresolved elements. A value of <code>true</code> indicates that it should behave identical to
- * {@link CDOList#get(int)}.
- */
- public Object get(int index, boolean resolve);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.net4j.util.collection.MoveableList;
+
+import org.eclipse.emf.common.util.EList;
+
+/**
+ * A {@link MoveableList moveable} {@link EList}.
+ *
+ * @author Simon McDuff
+ * @since 2.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.uses {@link CDOElementProxy} - - contains
+ */
+public interface CDOList extends MoveableList<Object>, EList<Object>
+{
+ /**
+ * Returns the element at position index of this list and optionally resolves proxies (see CDOElementProxy).
+ * <p>
+ *
+ * @param index
+ * The position of the element to return from this list.
+ * @param resolve
+ * A value of <code>false</code> indicates that {@link CDORevisionUtil#UNINITIALIZED} may be returned for
+ * unresolved elements. A value of <code>true</code> indicates that it should behave identical to
+ * {@link CDOList#get(int)}.
+ */
+ public Object get(int index, boolean resolve);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOListFactory.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOListFactory.java
index f67b58a5e0..5f2d929407 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOListFactory.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOListFactory.java
@@ -1,28 +1,28 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.internal.common.revision.CDOListImpl;
-
-/**
- * Creates {@link CDOList list} instances.
- *
- * @author Simon McDuff
- * @since 2.0
- * @apiviz.uses {@link CDOList} - - creates
- */
-public interface CDOListFactory
-{
- public static final CDOListFactory DEFAULT = CDOListImpl.FACTORY;
-
- public CDOList createList(int intitialCapacity, int size, int initialChunk);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.internal.common.revision.CDOListImpl;
+
+/**
+ * Creates {@link CDOList list} instances.
+ *
+ * @author Simon McDuff
+ * @since 2.0
+ * @apiviz.uses {@link CDOList} - - creates
+ */
+public interface CDOListFactory
+{
+ public static final CDOListFactory DEFAULT = CDOListImpl.FACTORY;
+
+ public CDOList createList(int intitialCapacity, int size, int initialChunk);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOListResolver.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOListResolver.java
index 98b15be4b2..5b242a325b 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOListResolver.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDOListResolver.java
@@ -1,37 +1,37 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.common.id.CDOID;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * A strategy that specifies which list elememts must be present (loaded) in a {@link CDOID} list of a
- * {@link CDORevision revision} when a certain list index is accessed. Implementations of this interface can control the
- * exact characteristics of a certain <em>partial collection loading</em> strategy.
- *
- * @author Eike Stepper
- * @since 4.0
- * @apiviz.uses {@link CDOList} - - resolves
- */
-public interface CDOListResolver
-{
- /**
- * Defines a strategy to be used when the collection needs to resolve one element.
- */
- public Object resolveProxy(CDORevision revision, EStructuralFeature feature, int accessIndex, int serverIndex);
-
- /**
- * Defines a strategy to be used when the collection needs to resolve all elements.
- */
- public void resolveAllProxies(CDORevision revision, EStructuralFeature feature);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * A strategy that specifies which list elememts must be present (loaded) in a {@link CDOID} list of a
+ * {@link CDORevision revision} when a certain list index is accessed. Implementations of this interface can control the
+ * exact characteristics of a certain <em>partial collection loading</em> strategy.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @apiviz.uses {@link CDOList} - - resolves
+ */
+public interface CDOListResolver
+{
+ /**
+ * Defines a strategy to be used when the collection needs to resolve one element.
+ */
+ public Object resolveProxy(CDORevision revision, EStructuralFeature feature, int accessIndex, int serverIndex);
+
+ /**
+ * Defines a strategy to be used when the collection needs to resolve all elements.
+ */
+ public void resolveAllProxies(CDORevision revision, EStructuralFeature feature);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisable.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisable.java
index 0864240027..47f893f5f5 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisable.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisable.java
@@ -1,28 +1,28 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-
-/**
- * An entity that has a defined lifetime (creation plus revision) and a version in a {@link CDOBranch branch}.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDORevisable extends CDOBranchPoint, CDOBranchVersion
-{
- public long getRevised();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
+
+/**
+ * An entity that has a defined lifetime (creation plus revision) and a version in a {@link CDOBranch branch}.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDORevisable extends CDOBranchPoint, CDOBranchVersion
+{
+ public long getRevised();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionCache.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionCache.java
index 7bd85e287a..fdb245b0cc 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionCache.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionCache.java
@@ -1,83 +1,83 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.internal.common.revision.NOOPRevisionCache;
-
-import org.eclipse.net4j.util.event.IEvent;
-import org.eclipse.net4j.util.event.INotifier;
-
-import org.eclipse.emf.ecore.EClass;
-
-import java.util.List;
-
-/**
- * Caches {@link CDORevision revisions} and possibly {@link EvictionEvent evicts} those that are no longer strongly
- * referenced when free memory runs low.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.composedOf {@link CDORevision}
- */
-public interface CDORevisionCache extends CDORevisionCacheAdder, INotifier
-{
- /**
- * @since 3.0
- */
- public static final CDORevisionCache NOOP = NOOPRevisionCache.INSTANCE;
-
- public EClass getObjectType(CDOID id);
-
- /**
- * @since 3.0
- */
- public CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint);
-
- /**
- * @since 3.0
- */
- public CDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion);
-
- /**
- * Returns a list of {@link CDORevision revisions} that are current.
- *
- * @since 3.0
- */
- public List<CDORevision> getCurrentRevisions();
-
- /**
- * An {@link IEvent event} fired from a {@link CDORevisionCache revision cache} for {@link CDORevision revisions} that
- * are evicted because they are no longer strongly referenced when free memory runs low.
- *
- * @author Eike Stepper
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
- public interface EvictionEvent extends IEvent, CDORevisionKey
- {
- /**
- * @since 3.0
- */
- public CDORevisionCache getSource();
-
- /**
- * May be <code>null</code> for certain cache implementations.
- *
- * @since 3.0
- */
- public CDORevision getRevision();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.internal.common.revision.NOOPRevisionCache;
+
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.INotifier;
+
+import org.eclipse.emf.ecore.EClass;
+
+import java.util.List;
+
+/**
+ * Caches {@link CDORevision revisions} and possibly {@link EvictionEvent evicts} those that are no longer strongly
+ * referenced when free memory runs low.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.composedOf {@link CDORevision}
+ */
+public interface CDORevisionCache extends CDORevisionCacheAdder, INotifier
+{
+ /**
+ * @since 3.0
+ */
+ public static final CDORevisionCache NOOP = NOOPRevisionCache.INSTANCE;
+
+ public EClass getObjectType(CDOID id);
+
+ /**
+ * @since 3.0
+ */
+ public CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint);
+
+ /**
+ * @since 3.0
+ */
+ public CDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion);
+
+ /**
+ * Returns a list of {@link CDORevision revisions} that are current.
+ *
+ * @since 3.0
+ */
+ public List<CDORevision> getCurrentRevisions();
+
+ /**
+ * An {@link IEvent event} fired from a {@link CDORevisionCache revision cache} for {@link CDORevision revisions} that
+ * are evicted because they are no longer strongly referenced when free memory runs low.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+ public interface EvictionEvent extends IEvent, CDORevisionKey
+ {
+ /**
+ * @since 3.0
+ */
+ public CDORevisionCache getSource();
+
+ /**
+ * May be <code>null</code> for certain cache implementations.
+ *
+ * @since 3.0
+ */
+ public CDORevision getRevision();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionCacheAdder.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionCacheAdder.java
index cb002b5e3b..f4783fc4ad 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionCacheAdder.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionCacheAdder.java
@@ -1,27 +1,27 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-/**
- * An entity that {@link CDORevision revisions} can be added to.
- *
- * @author Eike Stepper
- * @since 4.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDORevisionCacheAdder
-{
- /**
- * Adds the given revision to this cache.
- */
- public void addRevision(CDORevision revision);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+/**
+ * An entity that {@link CDORevision revisions} can be added to.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDORevisionCacheAdder
+{
+ /**
+ * Adds the given revision to this cache.
+ */
+ public void addRevision(CDORevision revision);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionData.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionData.java
index d38a2740b5..13c348bf32 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionData.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionData.java
@@ -1,112 +1,112 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.common.id.CDOID;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.BasicEObjectImpl;
-import org.eclipse.emf.ecore.impl.EStoreEObjectImpl;
-
-/**
- * Encapsulates the modeled information and the EMF system values of a {@link CDORevision revision}.
- *
- * @author Eike Stepper
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDORevisionData
-{
- /**
- * The equivalent of <code>EStructuralFeatureImpl.NIL</code> (i.e. explicit <code>null</code>).
- *
- * @since 3.0
- */
- public static final Object NIL = EStoreEObjectImpl.NIL;
-
- /**
- * @since 2.0
- */
- public CDORevision revision();
-
- public CDOID getResourceID();
-
- /**
- * @since 2.0
- */
- public Object getContainerID();
-
- /**
- * Provides the input to the calculation of the feature in the container revision that actually holds this revision.
- * <p>
- * <b>Usage Example:</b>
- * <p>
- * <code><pre>
- * CDORevision revision = ...;
- * CDORevision container = <i>Util.getRevision</i>(revision.data().getContainerID());
- *
- * int containingFeatureID = revision.data().getContainingFeatureID();
- *
- * EStructuralFeature feature = containingFeatureID <= InternalEObject.EOPPOSITE_FEATURE_BASE ?
- * container.getEClass().getEStructuralFeature(InternalEObject.EOPPOSITE_FEATURE_BASE - containingFeatureID) :
- * ((EReference)revision.getEClass().getEStructuralFeature(containingFeatureID)).getEOpposite();</pre></code>
- *
- * @see BasicEObjectImpl#eContainingFeature()
- * @see #getContainerID()
- */
- public int getContainingFeatureID();
-
- /**
- * @since 2.0
- */
- public Object get(EStructuralFeature feature, int index);
-
- /**
- * @since 2.0
- */
- public int size(EStructuralFeature feature);
-
- /**
- * @since 2.0
- */
- public boolean isEmpty(EStructuralFeature feature);
-
- /**
- * @since 2.0
- */
- public boolean contains(EStructuralFeature feature, Object value);
-
- /**
- * @since 2.0
- */
- public int indexOf(EStructuralFeature feature, Object value);
-
- /**
- * @since 2.0
- */
- public int lastIndexOf(EStructuralFeature feature, Object value);
-
- /**
- * @since 2.0
- */
- public <T> T[] toArray(EStructuralFeature feature, T[] array);
-
- /**
- * @since 2.0
- */
- public Object[] toArray(EStructuralFeature feature);
-
- /**
- * @since 2.0
- */
- public int hashCode(EStructuralFeature feature);
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.impl.BasicEObjectImpl;
+import org.eclipse.emf.ecore.impl.EStoreEObjectImpl;
+
+/**
+ * Encapsulates the modeled information and the EMF system values of a {@link CDORevision revision}.
+ *
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDORevisionData
+{
+ /**
+ * The equivalent of <code>EStructuralFeatureImpl.NIL</code> (i.e. explicit <code>null</code>).
+ *
+ * @since 3.0
+ */
+ public static final Object NIL = EStoreEObjectImpl.NIL;
+
+ /**
+ * @since 2.0
+ */
+ public CDORevision revision();
+
+ public CDOID getResourceID();
+
+ /**
+ * @since 2.0
+ */
+ public Object getContainerID();
+
+ /**
+ * Provides the input to the calculation of the feature in the container revision that actually holds this revision.
+ * <p>
+ * <b>Usage Example:</b>
+ * <p>
+ * <code><pre>
+ * CDORevision revision = ...;
+ * CDORevision container = <i>Util.getRevision</i>(revision.data().getContainerID());
+ *
+ * int containingFeatureID = revision.data().getContainingFeatureID();
+ *
+ * EStructuralFeature feature = containingFeatureID <= InternalEObject.EOPPOSITE_FEATURE_BASE ?
+ * container.getEClass().getEStructuralFeature(InternalEObject.EOPPOSITE_FEATURE_BASE - containingFeatureID) :
+ * ((EReference)revision.getEClass().getEStructuralFeature(containingFeatureID)).getEOpposite();</pre></code>
+ *
+ * @see BasicEObjectImpl#eContainingFeature()
+ * @see #getContainerID()
+ */
+ public int getContainingFeatureID();
+
+ /**
+ * @since 2.0
+ */
+ public Object get(EStructuralFeature feature, int index);
+
+ /**
+ * @since 2.0
+ */
+ public int size(EStructuralFeature feature);
+
+ /**
+ * @since 2.0
+ */
+ public boolean isEmpty(EStructuralFeature feature);
+
+ /**
+ * @since 2.0
+ */
+ public boolean contains(EStructuralFeature feature, Object value);
+
+ /**
+ * @since 2.0
+ */
+ public int indexOf(EStructuralFeature feature, Object value);
+
+ /**
+ * @since 2.0
+ */
+ public int lastIndexOf(EStructuralFeature feature, Object value);
+
+ /**
+ * @since 2.0
+ */
+ public <T> T[] toArray(EStructuralFeature feature, T[] array);
+
+ /**
+ * @since 2.0
+ */
+ public Object[] toArray(EStructuralFeature feature);
+
+ /**
+ * @since 2.0
+ */
+ public int hashCode(EStructuralFeature feature);
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionFactory.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionFactory.java
index a45f526117..e628a2b7f5 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionFactory.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionFactory.java
@@ -1,38 +1,38 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * Creates {@link CDORevision revision} instances.
- *
- * @author Eike Stepper
- * @since 2.0
- */
-public interface CDORevisionFactory
-{
- /**
- * @since 3.0
- */
- public static final CDORevisionFactory DEFAULT = new CDORevisionFactory()
- {
- public CDORevision createRevision(EClass eClass)
- {
- return new org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl(eClass);
- }
- };
-
- /**
- * @since 3.0
- */
- public CDORevision createRevision(EClass eClass);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ * Creates {@link CDORevision revision} instances.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ */
+public interface CDORevisionFactory
+{
+ /**
+ * @since 3.0
+ */
+ public static final CDORevisionFactory DEFAULT = new CDORevisionFactory()
+ {
+ public CDORevision createRevision(EClass eClass)
+ {
+ return new org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl(eClass);
+ }
+ };
+
+ /**
+ * @since 3.0
+ */
+ public CDORevision createRevision(EClass eClass);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionHandler.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionHandler.java
index c51560a472..fcac1959e7 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionHandler.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionHandler.java
@@ -1,82 +1,82 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.spi.common.revision.DetachedCDORevision;
-
-/**
- * A call-back interface that indicates the ability to <i>handle</i> {@link CDORevision revisions} that are passed from
- * other entities.
- *
- * @author Eike Stepper
- * @since 3.0
- */
-public interface CDORevisionHandler
-{
- /**
- * Handles a revision.
- *
- * @return <code>true</code> to indicate that the caller may pass more revisions, <code>false</code> otherwise.
- * @since 4.0
- */
- public boolean handleRevision(CDORevision revision);
-
- /**
- * A delegating {@link CDORevisionHandler revision handler} with a {@link #filter(CDORevision) filter()} method used
- * to suppress specific revisions.
- *
- * @author Eike Stepper
- * @since 4.1
- */
- public static class Filtered implements CDORevisionHandler
- {
- private final CDORevisionHandler delegate;
-
- public Filtered(CDORevisionHandler delegate)
- {
- this.delegate = delegate;
- }
-
- public final boolean handleRevision(CDORevision revision)
- {
- if (filter(revision))
- {
- return true;
- }
-
- return delegate.handleRevision(revision);
- }
-
- protected boolean filter(CDORevision revision)
- {
- return false;
- }
-
- /**
- * A delegating {@link Filtered revision handler} that filters detached revisions.
- *
- * @author Eike Stepper
- */
- public static final class Undetached extends Filtered
- {
- public Undetached(CDORevisionHandler delegate)
- {
- super(delegate);
- }
-
- @Override
- protected boolean filter(CDORevision revision)
- {
- return revision instanceof DetachedCDORevision;
- }
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.spi.common.revision.DetachedCDORevision;
+
+/**
+ * A call-back interface that indicates the ability to <i>handle</i> {@link CDORevision revisions} that are passed from
+ * other entities.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ */
+public interface CDORevisionHandler
+{
+ /**
+ * Handles a revision.
+ *
+ * @return <code>true</code> to indicate that the caller may pass more revisions, <code>false</code> otherwise.
+ * @since 4.0
+ */
+ public boolean handleRevision(CDORevision revision);
+
+ /**
+ * A delegating {@link CDORevisionHandler revision handler} with a {@link #filter(CDORevision) filter()} method used
+ * to suppress specific revisions.
+ *
+ * @author Eike Stepper
+ * @since 4.1
+ */
+ public static class Filtered implements CDORevisionHandler
+ {
+ private final CDORevisionHandler delegate;
+
+ public Filtered(CDORevisionHandler delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ public final boolean handleRevision(CDORevision revision)
+ {
+ if (filter(revision))
+ {
+ return true;
+ }
+
+ return delegate.handleRevision(revision);
+ }
+
+ protected boolean filter(CDORevision revision)
+ {
+ return false;
+ }
+
+ /**
+ * A delegating {@link Filtered revision handler} that filters detached revisions.
+ *
+ * @author Eike Stepper
+ */
+ public static final class Undetached extends Filtered
+ {
+ public Undetached(CDORevisionHandler delegate)
+ {
+ super(delegate);
+ }
+
+ @Override
+ protected boolean filter(CDORevision revision)
+ {
+ return revision instanceof DetachedCDORevision;
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionKey.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionKey.java
index 89a37d2987..5440e09ed2 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionKey.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionKey.java
@@ -1,26 +1,26 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-
-/**
- * Uniquely identifies a {@link CDORevision revision} by version in a {@link CDOBranch branch}.
- *
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDORevisionKey extends CDOBranchVersion, CDOIDAndVersion
-{
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
+
+/**
+ * Uniquely identifies a {@link CDORevision revision} by version in a {@link CDOBranch branch}.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDORevisionKey extends CDOBranchVersion, CDOIDAndVersion
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionManager.java
index 9409d0b7db..5460e84a45 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionManager.java
@@ -1,171 +1,171 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.common.CDOCommonRepository;
-import org.eclipse.emf.cdo.common.CDOCommonSession;
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.id.CDOID;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-import java.util.List;
-
-/**
- * Provides access to {@link CDORevision revisions} in a CDO {@link CDOCommonRepository repository} by demand loading
- * and caching them.
- * <p>
- * Revisions are generally queried by:
- * <p>
- * <ul>
- * <li>their object {@link CDOID ID} <b>and</b>
- * <li>their {@link CDOBranch branch} plus <b>either</b>:
- * <ul>
- * <li>a timestamp <b>or</b>
- * <li>a version
- * </ul>
- * </ul>
- * <p>
- * If querying by timestamp it's also possible to ask for multiple revisions (identified by a list of object IDs) in one
- * round trip (to the server if this revision manager is contained by a {@link CDOCommonSession session} or to the
- * backend store if it is contained by a {@link CDOCommonRepository repository}.
- *
- * @author Eike Stepper
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.has {@link CDORevisionFactory}
- * @apiviz.has {@link CDORevisionCache}
- * @apiviz.uses {@link CDORevision} - - loads
- */
-public interface CDORevisionManager
-{
- /**
- * Returns the {@link CDORevision#getEClass() type} of an object if a revision for that object is in the revision
- * cache, <code>null</code> otherwise.
- * <p>
- * Same as calling {@link #getObjectType(CDOID, CDOBranchManager) getObjectType(id, null)}.
- *
- * @see EObject#eClass()
- * @see #getObjectType(CDOID, CDOBranchManager)
- */
- public EClass getObjectType(CDOID id);
-
- /**
- * Returns the {@link CDORevision#getEClass() type} of an object.
- * <p>
- * If no revision for that object is found in the revision cache the following is tried:
- * <ol>
- * <li>If <code>branchManagerForLoadOnDemand</code> is not <code>null</code> the first revision of the object in the
- * main branch is loaded from the server and its type is returned.
- * <li>Otherwise (i.e., if <code>branchManagerForLoadOnDemand</code> is <code>null</code> or the object does not
- * exist) <code>null</code> is returned.
- * </ol>
- * <p>
- * A {@link CDOBranchManager branch manager} is required instead of just a boolean value to specify whether to
- * demand-load or not because this revision manager must be able to access the
- * {@link CDOBranchManager#getMainBranch() main branch} while demand-loading.
- *
- * @see EObject#eClass()
- * @see #getObjectType(CDOID)
- * @since 4.1
- */
- public EClass getObjectType(CDOID id, CDOBranchManager branchManagerForLoadOnDemand);
-
- /**
- * Returns <code>true</code> if the {@link CDORevisionCache revision cache} contains a {@link CDORevision revision}
- * with the given {@link CDOID ID} at the given {@link CDOBranchPoint branch point} (branch + timestamp),
- * <code>false</code> otherwise.
- *
- * @see CDORevisionManager#getRevision(CDOID, CDOBranchPoint, int, int, boolean)
- * @see CDORevisionManager#getRevisions(List, CDOBranchPoint, int, int, boolean)
- */
- public boolean containsRevision(CDOID id, CDOBranchPoint branchPoint);
-
- /**
- * Returns the {@link CDORevision revision} with the given {@link CDOID ID} at the given {@link CDOBranchPoint branch
- * point} (branch + timestamp), optionally demand loading it if it is not already in the {@link CDORevisionCache
- * cache}.
- *
- * @param referenceChunk
- * The number of target {@link CDOID IDs} to load for each many-valued reference in the returned revision, or
- * {@link CDORevision#UNCHUNKED} for all such list elements (IDs).
- * @param prefetchDepth
- * The number of nested containment levels to load revisions for in one round trip. Use the symbolic
- * constants {@link CDORevision#DEPTH_INFINITE} to prefetch all contained revisions or
- * {@link CDORevision#DEPTH_NONE} to not prefetch anything. Only the explicitely requested revision is
- * returned by this method. If additional revisions are prefetched they are placed in the revision cache to
- * speed up subsequent calls to this method.
- * @param loadOnDemand
- * If the requested revision is not contained in the revision cache it depends on this parameter's value
- * whether the revision is loaded from the server or <code>null</code> is returned.
- * @see #getRevisions(List, CDOBranchPoint, int, int, boolean)
- * @see #getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
- */
- public CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
- boolean loadOnDemand);
-
- /**
- * Returns the {@link CDORevision revisions} with the given {@link CDOID IDs} at the given {@link CDOBranchPoint
- * branch point} (branch + timestamp), optionally demand loading them if they are not already in the
- * {@link CDORevisionCache cache}.
- *
- * @param referenceChunk
- * The number of target {@link CDOID IDs} to load for each many-valued reference in the returned revisions,
- * or {@link CDORevision#UNCHUNKED} for all such list elements (IDs).
- * @param prefetchDepth
- * The number of nested containment levels to load revisions for in one round trip. Use the symbolic
- * constants {@link CDORevision#DEPTH_INFINITE} to prefetch all contained revisions or
- * {@link CDORevision#DEPTH_NONE} to not prefetch anything. Only the explicitely requested revisions are
- * returned by this method. If additional revisions are prefetched they are placed in the revision cache to
- * speed up subsequent calls to this method.
- * @param loadOnDemand
- * If one or more of the requested revisions is/are not contained in the revision cache it depends on this
- * parameter's value whether the revision(s) is/are loaded from the server or <code>null</code> is placed in
- * the list that is returned.
- * @see #getRevision(CDOID, CDOBranchPoint, int, int, boolean)
- */
- public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk,
- int prefetchDepth, boolean loadOnDemand);
-
- /**
- * Returns <code>true</code> if the {@link CDORevisionCache revision cache} contains a {@link CDORevision revision}
- * with the given {@link CDOID ID} at the given {@link CDOBranchVersion branch version} (branch + version),
- * <code>false</code> otherwise.
- *
- * @see #getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
- */
- public boolean containsRevisionByVersion(CDOID id, CDOBranchVersion branchVersion);
-
- /**
- * Returns the {@link CDORevision revision} with the given {@link CDOID ID} at the given {@link CDOBranchVersion
- * branch version} (branch + version), optionally demand loading it if it is not already in the
- * {@link CDORevisionCache cache}.
- * <p>
- * Prefetching of nested containment levels is not support by this method because the version of a particular revision
- * can not serve as a reasonable baseline criterium for a consistent graph of multiple revisions.
- *
- * @param referenceChunk
- * The number of target {@link CDOID IDs} to load for each many-valued reference in the returned revision, or
- * {@link CDORevision#UNCHUNKED} for all such list elements (IDs).
- * @param loadOnDemand
- * If the requested revision is not contained in the revision cache it depends on this parameter's value
- * whether the revision is loaded from the server or <code>null</code> is returned.
- * @see #getRevision(CDOID, CDOBranchPoint, int, int, boolean)
- */
- public CDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk,
- boolean loadOnDemand);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.CDOCommonSession;
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
+import org.eclipse.emf.cdo.common.id.CDOID;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+import java.util.List;
+
+/**
+ * Provides access to {@link CDORevision revisions} in a CDO {@link CDOCommonRepository repository} by demand loading
+ * and caching them.
+ * <p>
+ * Revisions are generally queried by:
+ * <p>
+ * <ul>
+ * <li>their object {@link CDOID ID} <b>and</b>
+ * <li>their {@link CDOBranch branch} plus <b>either</b>:
+ * <ul>
+ * <li>a timestamp <b>or</b>
+ * <li>a version
+ * </ul>
+ * </ul>
+ * <p>
+ * If querying by timestamp it's also possible to ask for multiple revisions (identified by a list of object IDs) in one
+ * round trip (to the server if this revision manager is contained by a {@link CDOCommonSession session} or to the
+ * backend store if it is contained by a {@link CDOCommonRepository repository}.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.has {@link CDORevisionFactory}
+ * @apiviz.has {@link CDORevisionCache}
+ * @apiviz.uses {@link CDORevision} - - loads
+ */
+public interface CDORevisionManager
+{
+ /**
+ * Returns the {@link CDORevision#getEClass() type} of an object if a revision for that object is in the revision
+ * cache, <code>null</code> otherwise.
+ * <p>
+ * Same as calling {@link #getObjectType(CDOID, CDOBranchManager) getObjectType(id, null)}.
+ *
+ * @see EObject#eClass()
+ * @see #getObjectType(CDOID, CDOBranchManager)
+ */
+ public EClass getObjectType(CDOID id);
+
+ /**
+ * Returns the {@link CDORevision#getEClass() type} of an object.
+ * <p>
+ * If no revision for that object is found in the revision cache the following is tried:
+ * <ol>
+ * <li>If <code>branchManagerForLoadOnDemand</code> is not <code>null</code> the first revision of the object in the
+ * main branch is loaded from the server and its type is returned.
+ * <li>Otherwise (i.e., if <code>branchManagerForLoadOnDemand</code> is <code>null</code> or the object does not
+ * exist) <code>null</code> is returned.
+ * </ol>
+ * <p>
+ * A {@link CDOBranchManager branch manager} is required instead of just a boolean value to specify whether to
+ * demand-load or not because this revision manager must be able to access the
+ * {@link CDOBranchManager#getMainBranch() main branch} while demand-loading.
+ *
+ * @see EObject#eClass()
+ * @see #getObjectType(CDOID)
+ * @since 4.1
+ */
+ public EClass getObjectType(CDOID id, CDOBranchManager branchManagerForLoadOnDemand);
+
+ /**
+ * Returns <code>true</code> if the {@link CDORevisionCache revision cache} contains a {@link CDORevision revision}
+ * with the given {@link CDOID ID} at the given {@link CDOBranchPoint branch point} (branch + timestamp),
+ * <code>false</code> otherwise.
+ *
+ * @see CDORevisionManager#getRevision(CDOID, CDOBranchPoint, int, int, boolean)
+ * @see CDORevisionManager#getRevisions(List, CDOBranchPoint, int, int, boolean)
+ */
+ public boolean containsRevision(CDOID id, CDOBranchPoint branchPoint);
+
+ /**
+ * Returns the {@link CDORevision revision} with the given {@link CDOID ID} at the given {@link CDOBranchPoint branch
+ * point} (branch + timestamp), optionally demand loading it if it is not already in the {@link CDORevisionCache
+ * cache}.
+ *
+ * @param referenceChunk
+ * The number of target {@link CDOID IDs} to load for each many-valued reference in the returned revision, or
+ * {@link CDORevision#UNCHUNKED} for all such list elements (IDs).
+ * @param prefetchDepth
+ * The number of nested containment levels to load revisions for in one round trip. Use the symbolic
+ * constants {@link CDORevision#DEPTH_INFINITE} to prefetch all contained revisions or
+ * {@link CDORevision#DEPTH_NONE} to not prefetch anything. Only the explicitely requested revision is
+ * returned by this method. If additional revisions are prefetched they are placed in the revision cache to
+ * speed up subsequent calls to this method.
+ * @param loadOnDemand
+ * If the requested revision is not contained in the revision cache it depends on this parameter's value
+ * whether the revision is loaded from the server or <code>null</code> is returned.
+ * @see #getRevisions(List, CDOBranchPoint, int, int, boolean)
+ * @see #getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
+ */
+ public CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth,
+ boolean loadOnDemand);
+
+ /**
+ * Returns the {@link CDORevision revisions} with the given {@link CDOID IDs} at the given {@link CDOBranchPoint
+ * branch point} (branch + timestamp), optionally demand loading them if they are not already in the
+ * {@link CDORevisionCache cache}.
+ *
+ * @param referenceChunk
+ * The number of target {@link CDOID IDs} to load for each many-valued reference in the returned revisions,
+ * or {@link CDORevision#UNCHUNKED} for all such list elements (IDs).
+ * @param prefetchDepth
+ * The number of nested containment levels to load revisions for in one round trip. Use the symbolic
+ * constants {@link CDORevision#DEPTH_INFINITE} to prefetch all contained revisions or
+ * {@link CDORevision#DEPTH_NONE} to not prefetch anything. Only the explicitely requested revisions are
+ * returned by this method. If additional revisions are prefetched they are placed in the revision cache to
+ * speed up subsequent calls to this method.
+ * @param loadOnDemand
+ * If one or more of the requested revisions is/are not contained in the revision cache it depends on this
+ * parameter's value whether the revision(s) is/are loaded from the server or <code>null</code> is placed in
+ * the list that is returned.
+ * @see #getRevision(CDOID, CDOBranchPoint, int, int, boolean)
+ */
+ public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk,
+ int prefetchDepth, boolean loadOnDemand);
+
+ /**
+ * Returns <code>true</code> if the {@link CDORevisionCache revision cache} contains a {@link CDORevision revision}
+ * with the given {@link CDOID ID} at the given {@link CDOBranchVersion branch version} (branch + version),
+ * <code>false</code> otherwise.
+ *
+ * @see #getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
+ */
+ public boolean containsRevisionByVersion(CDOID id, CDOBranchVersion branchVersion);
+
+ /**
+ * Returns the {@link CDORevision revision} with the given {@link CDOID ID} at the given {@link CDOBranchVersion
+ * branch version} (branch + version), optionally demand loading it if it is not already in the
+ * {@link CDORevisionCache cache}.
+ * <p>
+ * Prefetching of nested containment levels is not support by this method because the version of a particular revision
+ * can not serve as a reasonable baseline criterium for a consistent graph of multiple revisions.
+ *
+ * @param referenceChunk
+ * The number of target {@link CDOID IDs} to load for each many-valued reference in the returned revision, or
+ * {@link CDORevision#UNCHUNKED} for all such list elements (IDs).
+ * @param loadOnDemand
+ * If the requested revision is not contained in the revision cache it depends on this parameter's value
+ * whether the revision is loaded from the server or <code>null</code> is returned.
+ * @see #getRevision(CDOID, CDOBranchPoint, int, int, boolean)
+ */
+ public CDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk,
+ boolean loadOnDemand);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionProvider.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionProvider.java
index c18c2b9c96..7b28301cfc 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionProvider.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionProvider.java
@@ -1,27 +1,27 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.id.CDOID;
-
-/**
- * Provides consumers with the {@link CDORevision revisions} of {@link CDOID identifiable} CDO objects by selecting a
- * particular one from several possible {@link CDOBranchPoint branch points}.
- *
- * @author Eike Stepper
- * @since 3.0
- * @apiviz.uses {@link CDORevision} - - provides
- */
-public interface CDORevisionProvider
-{
- public CDORevision getRevision(CDOID id);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.id.CDOID;
+
+/**
+ * Provides consumers with the {@link CDORevision revisions} of {@link CDOID identifiable} CDO objects by selecting a
+ * particular one from several possible {@link CDOBranchPoint branch points}.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ * @apiviz.uses {@link CDORevision} - - provides
+ */
+public interface CDORevisionProvider
+{
+ public CDORevision getRevision(CDOID id);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
index 67914d9066..d16d1ba5f1 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
@@ -1,597 +1,597 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.commit.CDOChangeSet;
-import org.eclipse.emf.cdo.common.commit.CDOChangeSetData;
-import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDUtil;
-import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
-import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
-import org.eclipse.emf.cdo.internal.common.commit.CDOChangeSetDataImpl;
-import org.eclipse.emf.cdo.internal.common.commit.CDOChangeSetImpl;
-import org.eclipse.emf.cdo.internal.common.messages.Messages;
-import org.eclipse.emf.cdo.internal.common.revision.CDOFeatureMapEntryImpl;
-import org.eclipse.emf.cdo.internal.common.revision.CDORevisableImpl;
-import org.eclipse.emf.cdo.internal.common.revision.CDORevisionCacheAuditing;
-import org.eclipse.emf.cdo.internal.common.revision.CDORevisionCacheBranching;
-import org.eclipse.emf.cdo.internal.common.revision.CDORevisionCacheNonAuditing;
-import org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl;
-import org.eclipse.emf.cdo.internal.common.revision.CDORevisionKeyImpl;
-import org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl;
-import org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl;
-import org.eclipse.emf.cdo.spi.common.revision.CDOFeatureMapEntry;
-import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
-import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager;
-import org.eclipse.emf.cdo.spi.common.revision.ManagedRevisionProvider;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.FeatureMap;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-/**
- * Various static helper methods for dealing with {@link CDORevision revisions}.
- *
- * @author Eike Stepper
- * @apiviz.exclude
- */
-public final class CDORevisionUtil
-{
- public static final Object UNINITIALIZED = new Uninitialized();
-
- private CDORevisionUtil()
- {
- }
-
- /**
- * Creates and returns a new memory sensitive revision cache.
- *
- * @since 4.0
- */
- public static CDORevisionCache createRevisionCache(boolean supportingAudits, boolean supportingBranches)
- {
- if (supportingBranches)
- {
- return new CDORevisionCacheBranching();
- }
-
- if (supportingAudits)
- {
- return new CDORevisionCacheAuditing();
- }
-
- return new CDORevisionCacheNonAuditing();
- }
-
- /**
- * @since 4.0
- */
- public static CDORevisionManager createRevisionManager()
- {
- return new CDORevisionManagerImpl();
- }
-
- /**
- * @since 4.0
- */
- public static CDORevisionManager createRevisionManager(CDORevisionCache cache)
- {
- InternalCDORevisionManager revisionManager = (InternalCDORevisionManager)createRevisionManager();
- revisionManager.setCache(cache);
- return revisionManager;
- }
-
- /**
- * @since 4.0
- */
- public static CDORevisable copyRevisable(CDORevisable source)
- {
- return new CDORevisableImpl(source);
- }
-
- /**
- * @since 4.0
- */
- public static CDORevisable createRevisable(CDOBranch branch, int version, long timeStamp, long revised)
- {
- return new CDORevisableImpl(branch, version, timeStamp, revised);
- }
-
- /**
- * @since 4.0
- */
- public static CDORevisionKey copyRevisionKey(CDORevisionKey source)
- {
- return new CDORevisionKeyImpl(source.getID(), source.getBranch(), source.getVersion());
- }
-
- /**
- * @since 3.0
- */
- public static CDORevisionKey createRevisionKey(CDOID id, CDOBranch branch, int version)
- {
- return new CDORevisionKeyImpl(id, branch, version);
- }
-
- /**
- * @since 4.0
- */
- public static String formatRevisionKey(CDORevisionKey key)
- {
- StringBuilder builder = new StringBuilder();
- CDOIDUtil.write(builder, key.getID());
- builder.append(":");
- builder.append(key.getBranch().getID());
- builder.append(":");
- builder.append(key.getVersion());
- return builder.toString();
- }
-
- /**
- * @since 4.0
- */
- public static CDORevisionKey parseRevisionKey(String source, CDOBranchManager branchManager)
- {
- StringTokenizer tokenizer = new StringTokenizer(source, ":");
- if (!tokenizer.hasMoreTokens())
- {
- throw new IllegalArgumentException("No ID segment");
- }
-
- String idSegment = tokenizer.nextToken();
- CDOID id = CDOIDUtil.read(idSegment);
-
- if (!tokenizer.hasMoreTokens())
- {
- throw new IllegalArgumentException("No branch segment");
- }
-
- String branchSegment = tokenizer.nextToken();
- CDOBranch branch = branchManager.getBranch(Integer.parseInt(branchSegment));
-
- if (!tokenizer.hasMoreTokens())
- {
- throw new IllegalArgumentException("No version segment");
- }
-
- String versionSegment = tokenizer.nextToken();
- int version = Integer.parseInt(versionSegment);
-
- return new CDORevisionKeyImpl(id, branch, version);
- }
-
- /**
- * @since 2.0
- */
- public static FeatureMap.Entry createFeatureMapEntry(EStructuralFeature feature, Object value)
- {
- return new CDOFeatureMapEntryImpl(feature, value);
- }
-
- /**
- * @since 3.0
- */
- public static CDOFeatureMapEntry createCDOFeatureMapEntry()
- {
- return new CDOFeatureMapEntryImpl();
- }
-
- /**
- * @since 4.0
- */
- public static CDORevisionDelta createDelta(CDORevision revision)
- {
- return new CDORevisionDeltaImpl(revision);
- }
-
- /**
- * @since 4.0
- */
- public static CDOChangeSetData createChangeSetData(Set<CDOID> ids, final CDOBranchPoint startPoint,
- final CDOBranchPoint endPoint, final CDORevisionManager revisionManager)
- {
- CDORevisionProvider startProvider = new ManagedRevisionProvider(revisionManager, startPoint);
- CDORevisionProvider endProvider = new ManagedRevisionProvider(revisionManager, endPoint);
- return createChangeSetData(ids, startProvider, endProvider);
- }
-
- /**
- * @since 4.0
- */
- public static CDOChangeSetData createChangeSetData(Set<CDOID> ids, CDORevisionProvider startProvider,
- CDORevisionProvider endProvider)
- {
- return createChangeSetData(ids, startProvider, endProvider, false);
- }
-
- /**
- * @since 4.1
- */
- public static CDOChangeSetData createChangeSetData(Set<CDOID> ids, CDORevisionProvider startProvider,
- CDORevisionProvider endProvider, boolean useStartVersions)
- {
- List<CDOIDAndVersion> newObjects = new ArrayList<CDOIDAndVersion>();
- List<CDORevisionKey> changedObjects = new ArrayList<CDORevisionKey>();
- List<CDOIDAndVersion> detachedObjects = new ArrayList<CDOIDAndVersion>();
- for (CDOID id : ids)
- {
- CDORevision startRevision = startProvider.getRevision(id);
- CDORevision endRevision = endProvider.getRevision(id);
-
- if (startRevision == null && endRevision != null)
- {
- if (useStartVersions)
- {
- ((InternalCDORevision)endRevision).setVersion(0);
- }
-
- newObjects.add(endRevision);
- }
- else if (startRevision != null && endRevision == null)
- {
- detachedObjects.add(CDOIDUtil.createIDAndVersion(id, CDOBranchVersion.UNSPECIFIED_VERSION));
- }
- else if (startRevision != null && endRevision != null)
- {
- if (!startRevision.equals(endRevision))
- {
- if (useStartVersions)
- {
- ((InternalCDORevision)endRevision).setVersion(startRevision.getVersion());
- }
-
- CDORevisionDelta delta = endRevision.compare(startRevision);
- if (!delta.isEmpty())
- {
- changedObjects.add(delta);
- }
- }
- }
- }
-
- return createChangeSetData(newObjects, changedObjects, detachedObjects);
- }
-
- /**
- * @since 4.0
- */
- public static CDOChangeSetData createChangeSetData(List<CDOIDAndVersion> newObjects,
- List<CDORevisionKey> changedObjects, List<CDOIDAndVersion> detachedObjects)
- {
- return new CDOChangeSetDataImpl(newObjects, changedObjects, detachedObjects);
- }
-
- /**
- * @since 4.0
- */
- public static CDOChangeSet createChangeSet(CDOBranchPoint startPoint, CDOBranchPoint endPoint, CDOChangeSetData data)
- {
- return new CDOChangeSetImpl(startPoint, endPoint, data);
- }
-
- /**
- * @since 3.0
- */
- public static Object remapID(Object value, Map<CDOID, CDOID> idMappings, boolean allowUnmappedTempIDs)
- {
- return CDORevisionImpl.remapID(value, idMappings, allowUnmappedTempIDs);
- }
-
- /**
- * @since 4.0
- */
- public static String getResourceNodePath(CDORevision revision, CDORevisionProvider provider)
- {
- EAttribute nameFeature = (EAttribute)revision.getEClass().getEStructuralFeature("name");
-
- StringBuilder builder = new StringBuilder();
- getResourceNodePath((InternalCDORevision)revision, provider, nameFeature, builder);
-
- builder.insert(0, "/");
- return builder.toString();
- }
-
- private static void getResourceNodePath(InternalCDORevision revision, CDORevisionProvider provider,
- EAttribute nameFeature, StringBuilder result)
- {
- String name = (String)revision.get(nameFeature, 0);
- if (name != null)
- {
- if (result.length() != 0)
- {
- result.insert(0, "/");
- }
-
- result.insert(0, name);
- }
-
- CDOID folder = (CDOID)revision.getContainerID();
- if (!CDOIDUtil.isNull(folder))
- {
- InternalCDORevision container = (InternalCDORevision)provider.getRevision(folder);
- getResourceNodePath(container, provider, nameFeature, result);
- }
- }
-
- /**
- * @since 3.0
- */
- public static String dumpAllRevisions(Map<CDOBranch, List<CDORevision>> map)
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream out = new PrintStream(baos);
- dumpAllRevisions(map, out);
- return baos.toString();
- }
-
- /**
- * @since 3.0
- */
- public static void dumpAllRevisions(Map<CDOBranch, List<CDORevision>> map, PrintStream out)
- {
- new AllRevisionsDumper.Stream.Plain(map, out).dump();
- }
-
- /**
- * Dumps {@link CDORevision revisions}, sorted and grouped by {@link CDOBranch branch}, to various output formats and
- * targets. Concrete output formats and targets are implemented by subclasses.
- *
- * @since 4.0
- * @apiviz.exclude
- */
- public static abstract class AllRevisionsDumper
- {
- private Map<CDOBranch, List<CDORevision>> map;
-
- public AllRevisionsDumper(Map<CDOBranch, List<CDORevision>> map)
- {
- this.map = map;
- }
-
- public Map<CDOBranch, List<CDORevision>> getMap()
- {
- return map;
- }
-
- public void dump()
- {
- ArrayList<CDOBranch> branches = new ArrayList<CDOBranch>(map.keySet());
- Collections.sort(branches);
-
- dumpStart(branches);
- for (CDOBranch branch : branches)
- {
- dumpBranch(branch);
-
- List<CDORevision> revisions = map.get(branch);
- Collections.sort(revisions, new CDORevisionComparator());
-
- for (CDORevision revision : revisions)
- {
- dumpRevision(revision);
- }
- }
-
- dumpEnd(branches);
- }
-
- protected void dumpStart(List<CDOBranch> branches)
- {
- }
-
- protected void dumpEnd(List<CDOBranch> branches)
- {
- }
-
- protected abstract void dumpBranch(CDOBranch branch);
-
- protected abstract void dumpRevision(CDORevision revision);
-
- /**
- * A {@link AllRevisionsDumper revision dumper} that directs all output to a stream. The concrete output format is
- * implemented by subclasses.
- *
- * @author Eike Stepper
- * @apiviz.exclude
- */
- public static abstract class Stream extends AllRevisionsDumper
- {
- private PrintStream out;
-
- public Stream(Map<CDOBranch, List<CDORevision>> map, PrintStream out)
- {
- super(map);
- this.out = out;
- }
-
- public PrintStream out()
- {
- return out;
- }
-
- /**
- * A {@link Stream revision dumper} that directs all output as plain text to a stream.
- *
- * @author Eike Stepper
- * @apiviz.exclude
- */
- public static class Plain extends Stream
- {
- public static final int pad = 48;
-
- public Plain(Map<CDOBranch, List<CDORevision>> map, PrintStream out)
- {
- super(map, out);
- }
-
- @Override
- protected void dumpEnd(List<CDOBranch> branches)
- {
- out().println();
- }
-
- @Override
- protected void dumpBranch(CDOBranch branch)
- {
- out().println(
- padTimeRange(branch.getName() + "[" + branch.getID() + "]", pad, branch.getBase().getTimeStamp(), //$NON-NLS-1$ //$NON-NLS-2$
- CDORevision.UNSPECIFIED_DATE));
- }
-
- @Override
- protected void dumpRevision(CDORevision revision)
- {
- out().println(padTimeRange(" " + revision, pad, revision.getTimeStamp(), revision.getRevised())); //$NON-NLS-1$
- }
-
- private static String padTimeRange(String s, int pos, long t1, long t2)
- {
- StringBuffer buffer = new StringBuffer(s);
- while (buffer.length() < pos)
- {
- buffer.append(' ');
- }
-
- buffer.append(CDOCommonUtil.formatTimeStamp(t1));
- buffer.append("/");
- buffer.append(CDOCommonUtil.formatTimeStamp(t2));
- return buffer.toString();
- }
- }
-
- /**
- * A {@link Stream revision dumper} that directs all output as HTML text to a stream.
- *
- * @author Eike Stepper
- * @apiviz.exclude
- */
- public static class Html extends Stream
- {
- public Html(Map<CDOBranch, List<CDORevision>> map, PrintStream out)
- {
- super(map, out);
- }
-
- @Override
- protected void dumpStart(List<CDOBranch> branches)
- {
- out().println("<table border=\"0\">");
- }
-
- @Override
- protected void dumpEnd(List<CDOBranch> branches)
- {
- out().println("</table>");
- }
-
- @Override
- protected void dumpBranch(CDOBranch branch)
- {
- PrintStream out = out();
- if (!branch.isMainBranch())
- {
- out.println("<tr><td>&nbsp;</td><td>&nbsp;</td></tr>");
- }
-
- out.println("<tr>");
- out.println("<td>");
- out.println("<h4>" + branch.getName() + "[" + branch.getID() + "]</h4>");
- out.println("</td>");
- out.println("<td>");
- out.println("<h4>" + CDOCommonUtil.formatTimeStamp(branch.getBase().getTimeStamp()) + " / "
- + CDOCommonUtil.formatTimeStamp(CDORevision.UNSPECIFIED_DATE) + "</h4>");
- out.println("</td>");
- out.println("</tr>");
- }
-
- @Override
- protected void dumpRevision(CDORevision revision)
- {
- PrintStream out = out();
-
- out.println("<tr>");
- out.println("<td>&nbsp;&nbsp;&nbsp;&nbsp;");
- dumpRevision(revision, out);
- out.println("&nbsp;&nbsp;&nbsp;&nbsp;</td>");
-
- out.println("<td>");
- out.println(CDOCommonUtil.formatTimeStamp(revision.getTimeStamp()) + " / "
- + CDOCommonUtil.formatTimeStamp(revision.getRevised()));
- out.println("</td>");
- out.println("</tr>");
- }
-
- protected void dumpRevision(CDORevision revision, PrintStream out)
- {
- out.println(revision);
- }
- }
- }
- }
-
- /**
- * Compares {@link CDORevisionKey revision keys} by {@link CDORevision#getID() ID} and
- * {@link CDORevision#getVersion() version}.
- *
- * @author Eike Stepper
- * @since 4.0
- * @apiviz.exclude
- */
- public static class CDORevisionComparator implements Comparator<CDORevisionKey>
- {
- public CDORevisionComparator()
- {
- }
-
- public int compare(CDORevisionKey rev1, CDORevisionKey rev2)
- {
- int result = rev1.getID().compareTo(rev2.getID());
- if (result == 0)
- {
- int version1 = rev1.getVersion();
- int version2 = rev2.getVersion();
- result = version1 < version2 ? -1 : version1 == version2 ? 0 : 1;
- }
-
- return result;
- }
- }
-
- /**
- * @author Eike Stepper
- */
- private static final class Uninitialized
- {
- public Uninitialized()
- {
- }
-
- @Override
- public String toString()
- {
- return Messages.getString("CDORevisionUtil.0"); //$NON-NLS-1$
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
+import org.eclipse.emf.cdo.common.commit.CDOChangeSet;
+import org.eclipse.emf.cdo.common.commit.CDOChangeSetData;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.id.CDOIDUtil;
+import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
+import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
+import org.eclipse.emf.cdo.internal.common.commit.CDOChangeSetDataImpl;
+import org.eclipse.emf.cdo.internal.common.commit.CDOChangeSetImpl;
+import org.eclipse.emf.cdo.internal.common.messages.Messages;
+import org.eclipse.emf.cdo.internal.common.revision.CDOFeatureMapEntryImpl;
+import org.eclipse.emf.cdo.internal.common.revision.CDORevisableImpl;
+import org.eclipse.emf.cdo.internal.common.revision.CDORevisionCacheAuditing;
+import org.eclipse.emf.cdo.internal.common.revision.CDORevisionCacheBranching;
+import org.eclipse.emf.cdo.internal.common.revision.CDORevisionCacheNonAuditing;
+import org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.common.revision.CDORevisionKeyImpl;
+import org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl;
+import org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl;
+import org.eclipse.emf.cdo.spi.common.revision.CDOFeatureMapEntry;
+import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
+import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager;
+import org.eclipse.emf.cdo.spi.common.revision.ManagedRevisionProvider;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.FeatureMap;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+/**
+ * Various static helper methods for dealing with {@link CDORevision revisions}.
+ *
+ * @author Eike Stepper
+ * @apiviz.exclude
+ */
+public final class CDORevisionUtil
+{
+ public static final Object UNINITIALIZED = new Uninitialized();
+
+ private CDORevisionUtil()
+ {
+ }
+
+ /**
+ * Creates and returns a new memory sensitive revision cache.
+ *
+ * @since 4.0
+ */
+ public static CDORevisionCache createRevisionCache(boolean supportingAudits, boolean supportingBranches)
+ {
+ if (supportingBranches)
+ {
+ return new CDORevisionCacheBranching();
+ }
+
+ if (supportingAudits)
+ {
+ return new CDORevisionCacheAuditing();
+ }
+
+ return new CDORevisionCacheNonAuditing();
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDORevisionManager createRevisionManager()
+ {
+ return new CDORevisionManagerImpl();
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDORevisionManager createRevisionManager(CDORevisionCache cache)
+ {
+ InternalCDORevisionManager revisionManager = (InternalCDORevisionManager)createRevisionManager();
+ revisionManager.setCache(cache);
+ return revisionManager;
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDORevisable copyRevisable(CDORevisable source)
+ {
+ return new CDORevisableImpl(source);
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDORevisable createRevisable(CDOBranch branch, int version, long timeStamp, long revised)
+ {
+ return new CDORevisableImpl(branch, version, timeStamp, revised);
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDORevisionKey copyRevisionKey(CDORevisionKey source)
+ {
+ return new CDORevisionKeyImpl(source.getID(), source.getBranch(), source.getVersion());
+ }
+
+ /**
+ * @since 3.0
+ */
+ public static CDORevisionKey createRevisionKey(CDOID id, CDOBranch branch, int version)
+ {
+ return new CDORevisionKeyImpl(id, branch, version);
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static String formatRevisionKey(CDORevisionKey key)
+ {
+ StringBuilder builder = new StringBuilder();
+ CDOIDUtil.write(builder, key.getID());
+ builder.append(":");
+ builder.append(key.getBranch().getID());
+ builder.append(":");
+ builder.append(key.getVersion());
+ return builder.toString();
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDORevisionKey parseRevisionKey(String source, CDOBranchManager branchManager)
+ {
+ StringTokenizer tokenizer = new StringTokenizer(source, ":");
+ if (!tokenizer.hasMoreTokens())
+ {
+ throw new IllegalArgumentException("No ID segment");
+ }
+
+ String idSegment = tokenizer.nextToken();
+ CDOID id = CDOIDUtil.read(idSegment);
+
+ if (!tokenizer.hasMoreTokens())
+ {
+ throw new IllegalArgumentException("No branch segment");
+ }
+
+ String branchSegment = tokenizer.nextToken();
+ CDOBranch branch = branchManager.getBranch(Integer.parseInt(branchSegment));
+
+ if (!tokenizer.hasMoreTokens())
+ {
+ throw new IllegalArgumentException("No version segment");
+ }
+
+ String versionSegment = tokenizer.nextToken();
+ int version = Integer.parseInt(versionSegment);
+
+ return new CDORevisionKeyImpl(id, branch, version);
+ }
+
+ /**
+ * @since 2.0
+ */
+ public static FeatureMap.Entry createFeatureMapEntry(EStructuralFeature feature, Object value)
+ {
+ return new CDOFeatureMapEntryImpl(feature, value);
+ }
+
+ /**
+ * @since 3.0
+ */
+ public static CDOFeatureMapEntry createCDOFeatureMapEntry()
+ {
+ return new CDOFeatureMapEntryImpl();
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDORevisionDelta createDelta(CDORevision revision)
+ {
+ return new CDORevisionDeltaImpl(revision);
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDOChangeSetData createChangeSetData(Set<CDOID> ids, final CDOBranchPoint startPoint,
+ final CDOBranchPoint endPoint, final CDORevisionManager revisionManager)
+ {
+ CDORevisionProvider startProvider = new ManagedRevisionProvider(revisionManager, startPoint);
+ CDORevisionProvider endProvider = new ManagedRevisionProvider(revisionManager, endPoint);
+ return createChangeSetData(ids, startProvider, endProvider);
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDOChangeSetData createChangeSetData(Set<CDOID> ids, CDORevisionProvider startProvider,
+ CDORevisionProvider endProvider)
+ {
+ return createChangeSetData(ids, startProvider, endProvider, false);
+ }
+
+ /**
+ * @since 4.1
+ */
+ public static CDOChangeSetData createChangeSetData(Set<CDOID> ids, CDORevisionProvider startProvider,
+ CDORevisionProvider endProvider, boolean useStartVersions)
+ {
+ List<CDOIDAndVersion> newObjects = new ArrayList<CDOIDAndVersion>();
+ List<CDORevisionKey> changedObjects = new ArrayList<CDORevisionKey>();
+ List<CDOIDAndVersion> detachedObjects = new ArrayList<CDOIDAndVersion>();
+ for (CDOID id : ids)
+ {
+ CDORevision startRevision = startProvider.getRevision(id);
+ CDORevision endRevision = endProvider.getRevision(id);
+
+ if (startRevision == null && endRevision != null)
+ {
+ if (useStartVersions)
+ {
+ ((InternalCDORevision)endRevision).setVersion(0);
+ }
+
+ newObjects.add(endRevision);
+ }
+ else if (startRevision != null && endRevision == null)
+ {
+ detachedObjects.add(CDOIDUtil.createIDAndVersion(id, CDOBranchVersion.UNSPECIFIED_VERSION));
+ }
+ else if (startRevision != null && endRevision != null)
+ {
+ if (!startRevision.equals(endRevision))
+ {
+ if (useStartVersions)
+ {
+ ((InternalCDORevision)endRevision).setVersion(startRevision.getVersion());
+ }
+
+ CDORevisionDelta delta = endRevision.compare(startRevision);
+ if (!delta.isEmpty())
+ {
+ changedObjects.add(delta);
+ }
+ }
+ }
+ }
+
+ return createChangeSetData(newObjects, changedObjects, detachedObjects);
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDOChangeSetData createChangeSetData(List<CDOIDAndVersion> newObjects,
+ List<CDORevisionKey> changedObjects, List<CDOIDAndVersion> detachedObjects)
+ {
+ return new CDOChangeSetDataImpl(newObjects, changedObjects, detachedObjects);
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDOChangeSet createChangeSet(CDOBranchPoint startPoint, CDOBranchPoint endPoint, CDOChangeSetData data)
+ {
+ return new CDOChangeSetImpl(startPoint, endPoint, data);
+ }
+
+ /**
+ * @since 3.0
+ */
+ public static Object remapID(Object value, Map<CDOID, CDOID> idMappings, boolean allowUnmappedTempIDs)
+ {
+ return CDORevisionImpl.remapID(value, idMappings, allowUnmappedTempIDs);
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static String getResourceNodePath(CDORevision revision, CDORevisionProvider provider)
+ {
+ EAttribute nameFeature = (EAttribute)revision.getEClass().getEStructuralFeature("name");
+
+ StringBuilder builder = new StringBuilder();
+ getResourceNodePath((InternalCDORevision)revision, provider, nameFeature, builder);
+
+ builder.insert(0, "/");
+ return builder.toString();
+ }
+
+ private static void getResourceNodePath(InternalCDORevision revision, CDORevisionProvider provider,
+ EAttribute nameFeature, StringBuilder result)
+ {
+ String name = (String)revision.get(nameFeature, 0);
+ if (name != null)
+ {
+ if (result.length() != 0)
+ {
+ result.insert(0, "/");
+ }
+
+ result.insert(0, name);
+ }
+
+ CDOID folder = (CDOID)revision.getContainerID();
+ if (!CDOIDUtil.isNull(folder))
+ {
+ InternalCDORevision container = (InternalCDORevision)provider.getRevision(folder);
+ getResourceNodePath(container, provider, nameFeature, result);
+ }
+ }
+
+ /**
+ * @since 3.0
+ */
+ public static String dumpAllRevisions(Map<CDOBranch, List<CDORevision>> map)
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ PrintStream out = new PrintStream(baos);
+ dumpAllRevisions(map, out);
+ return baos.toString();
+ }
+
+ /**
+ * @since 3.0
+ */
+ public static void dumpAllRevisions(Map<CDOBranch, List<CDORevision>> map, PrintStream out)
+ {
+ new AllRevisionsDumper.Stream.Plain(map, out).dump();
+ }
+
+ /**
+ * Dumps {@link CDORevision revisions}, sorted and grouped by {@link CDOBranch branch}, to various output formats and
+ * targets. Concrete output formats and targets are implemented by subclasses.
+ *
+ * @since 4.0
+ * @apiviz.exclude
+ */
+ public static abstract class AllRevisionsDumper
+ {
+ private Map<CDOBranch, List<CDORevision>> map;
+
+ public AllRevisionsDumper(Map<CDOBranch, List<CDORevision>> map)
+ {
+ this.map = map;
+ }
+
+ public Map<CDOBranch, List<CDORevision>> getMap()
+ {
+ return map;
+ }
+
+ public void dump()
+ {
+ ArrayList<CDOBranch> branches = new ArrayList<CDOBranch>(map.keySet());
+ Collections.sort(branches);
+
+ dumpStart(branches);
+ for (CDOBranch branch : branches)
+ {
+ dumpBranch(branch);
+
+ List<CDORevision> revisions = map.get(branch);
+ Collections.sort(revisions, new CDORevisionComparator());
+
+ for (CDORevision revision : revisions)
+ {
+ dumpRevision(revision);
+ }
+ }
+
+ dumpEnd(branches);
+ }
+
+ protected void dumpStart(List<CDOBranch> branches)
+ {
+ }
+
+ protected void dumpEnd(List<CDOBranch> branches)
+ {
+ }
+
+ protected abstract void dumpBranch(CDOBranch branch);
+
+ protected abstract void dumpRevision(CDORevision revision);
+
+ /**
+ * A {@link AllRevisionsDumper revision dumper} that directs all output to a stream. The concrete output format is
+ * implemented by subclasses.
+ *
+ * @author Eike Stepper
+ * @apiviz.exclude
+ */
+ public static abstract class Stream extends AllRevisionsDumper
+ {
+ private PrintStream out;
+
+ public Stream(Map<CDOBranch, List<CDORevision>> map, PrintStream out)
+ {
+ super(map);
+ this.out = out;
+ }
+
+ public PrintStream out()
+ {
+ return out;
+ }
+
+ /**
+ * A {@link Stream revision dumper} that directs all output as plain text to a stream.
+ *
+ * @author Eike Stepper
+ * @apiviz.exclude
+ */
+ public static class Plain extends Stream
+ {
+ public static final int pad = 48;
+
+ public Plain(Map<CDOBranch, List<CDORevision>> map, PrintStream out)
+ {
+ super(map, out);
+ }
+
+ @Override
+ protected void dumpEnd(List<CDOBranch> branches)
+ {
+ out().println();
+ }
+
+ @Override
+ protected void dumpBranch(CDOBranch branch)
+ {
+ out().println(
+ padTimeRange(branch.getName() + "[" + branch.getID() + "]", pad, branch.getBase().getTimeStamp(), //$NON-NLS-1$ //$NON-NLS-2$
+ CDORevision.UNSPECIFIED_DATE));
+ }
+
+ @Override
+ protected void dumpRevision(CDORevision revision)
+ {
+ out().println(padTimeRange(" " + revision, pad, revision.getTimeStamp(), revision.getRevised())); //$NON-NLS-1$
+ }
+
+ private static String padTimeRange(String s, int pos, long t1, long t2)
+ {
+ StringBuffer buffer = new StringBuffer(s);
+ while (buffer.length() < pos)
+ {
+ buffer.append(' ');
+ }
+
+ buffer.append(CDOCommonUtil.formatTimeStamp(t1));
+ buffer.append("/");
+ buffer.append(CDOCommonUtil.formatTimeStamp(t2));
+ return buffer.toString();
+ }
+ }
+
+ /**
+ * A {@link Stream revision dumper} that directs all output as HTML text to a stream.
+ *
+ * @author Eike Stepper
+ * @apiviz.exclude
+ */
+ public static class Html extends Stream
+ {
+ public Html(Map<CDOBranch, List<CDORevision>> map, PrintStream out)
+ {
+ super(map, out);
+ }
+
+ @Override
+ protected void dumpStart(List<CDOBranch> branches)
+ {
+ out().println("<table border=\"0\">");
+ }
+
+ @Override
+ protected void dumpEnd(List<CDOBranch> branches)
+ {
+ out().println("</table>");
+ }
+
+ @Override
+ protected void dumpBranch(CDOBranch branch)
+ {
+ PrintStream out = out();
+ if (!branch.isMainBranch())
+ {
+ out.println("<tr><td>&nbsp;</td><td>&nbsp;</td></tr>");
+ }
+
+ out.println("<tr>");
+ out.println("<td>");
+ out.println("<h4>" + branch.getName() + "[" + branch.getID() + "]</h4>");
+ out.println("</td>");
+ out.println("<td>");
+ out.println("<h4>" + CDOCommonUtil.formatTimeStamp(branch.getBase().getTimeStamp()) + " / "
+ + CDOCommonUtil.formatTimeStamp(CDORevision.UNSPECIFIED_DATE) + "</h4>");
+ out.println("</td>");
+ out.println("</tr>");
+ }
+
+ @Override
+ protected void dumpRevision(CDORevision revision)
+ {
+ PrintStream out = out();
+
+ out.println("<tr>");
+ out.println("<td>&nbsp;&nbsp;&nbsp;&nbsp;");
+ dumpRevision(revision, out);
+ out.println("&nbsp;&nbsp;&nbsp;&nbsp;</td>");
+
+ out.println("<td>");
+ out.println(CDOCommonUtil.formatTimeStamp(revision.getTimeStamp()) + " / "
+ + CDOCommonUtil.formatTimeStamp(revision.getRevised()));
+ out.println("</td>");
+ out.println("</tr>");
+ }
+
+ protected void dumpRevision(CDORevision revision, PrintStream out)
+ {
+ out.println(revision);
+ }
+ }
+ }
+ }
+
+ /**
+ * Compares {@link CDORevisionKey revision keys} by {@link CDORevision#getID() ID} and
+ * {@link CDORevision#getVersion() version}.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @apiviz.exclude
+ */
+ public static class CDORevisionComparator implements Comparator<CDORevisionKey>
+ {
+ public CDORevisionComparator()
+ {
+ }
+
+ public int compare(CDORevisionKey rev1, CDORevisionKey rev2)
+ {
+ int result = rev1.getID().compareTo(rev2.getID());
+ if (result == 0)
+ {
+ int version1 = rev1.getVersion();
+ int version2 = rev2.getVersion();
+ result = version1 < version2 ? -1 : version1 == version2 ? 0 : 1;
+ }
+
+ return result;
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class Uninitialized
+ {
+ public Uninitialized()
+ {
+ }
+
+ @Override
+ public String toString()
+ {
+ return Messages.getString("CDORevisionUtil.0"); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOAddFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOAddFeatureDelta.java
index ace02a912f..c6eaf22cfd 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOAddFeatureDelta.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOAddFeatureDelta.java
@@ -1,29 +1,29 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.revision.delta;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * A {@link CDOFeatureDelta feature delta} that represents an addition to a many-valued {@link EStructuralFeature
- * feature}.
- *
- * @author Simon McDuff
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOAddFeatureDelta extends CDOFeatureDelta
-{
- public int getIndex();
-
- public Object getValue();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * A {@link CDOFeatureDelta feature delta} that represents an addition to a many-valued {@link EStructuralFeature
+ * feature}.
+ *
+ * @author Simon McDuff
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOAddFeatureDelta extends CDOFeatureDelta
+{
+ public int getIndex();
+
+ public Object getValue();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOClearFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOClearFeatureDelta.java
index 3e3e88ccac..8888219aaf 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOClearFeatureDelta.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOClearFeatureDelta.java
@@ -1,26 +1,26 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.revision.delta;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * A {@link CDOFeatureDelta feature delta} that represents the removal of all elements from a many-valued
- * {@link EStructuralFeature feature}.
- *
- * @author Simon McDuff
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOClearFeatureDelta extends CDOFeatureDelta
-{
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * A {@link CDOFeatureDelta feature delta} that represents the removal of all elements from a many-valued
+ * {@link EStructuralFeature feature}.
+ *
+ * @author Simon McDuff
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOClearFeatureDelta extends CDOFeatureDelta
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOContainerFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOContainerFeatureDelta.java
index 0a55ae00a6..f2f0448c7d 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOContainerFeatureDelta.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOContainerFeatureDelta.java
@@ -1,46 +1,46 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- * Simon McDuff - bug 213402
- */
-package org.eclipse.emf.cdo.common.revision.delta;
-
-import org.eclipse.emf.cdo.common.id.CDOID;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * A {@link CDOFeatureDelta feature delta} that represents a modification of the {@link EObject#eContainer() eContainer}
- * feature.
- *
- * @author Simon McDuff
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOContainerFeatureDelta extends CDOFeatureDelta
-{
- /**
- * @since 2.0
- */
- public static final EReference CONTAINER_FEATURE = new org.eclipse.emf.cdo.internal.common.revision.delta.CDOContainerFeatureDeltaImpl.ContainerFeature();
-
- /**
- * @since 2.0
- */
- public CDOID getResourceID();
-
- /**
- * @since 2.0
- */
- public Object getContainerID();
-
- public int getContainerFeatureID();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ * Simon McDuff - bug 213402
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * A {@link CDOFeatureDelta feature delta} that represents a modification of the {@link EObject#eContainer() eContainer}
+ * feature.
+ *
+ * @author Simon McDuff
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOContainerFeatureDelta extends CDOFeatureDelta
+{
+ /**
+ * @since 2.0
+ */
+ public static final EReference CONTAINER_FEATURE = new org.eclipse.emf.cdo.internal.common.revision.delta.CDOContainerFeatureDeltaImpl.ContainerFeature();
+
+ /**
+ * @since 2.0
+ */
+ public CDOID getResourceID();
+
+ /**
+ * @since 2.0
+ */
+ public Object getContainerID();
+
+ public int getContainerFeatureID();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDeltaVisitor.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDeltaVisitor.java
index f86ff72900..69a36d2899 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDeltaVisitor.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOFeatureDeltaVisitor.java
@@ -1,38 +1,38 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.revision.delta;
-
-/**
- * Visits all {@link CDOFeatureDelta feature deltas} of a {@link CDORevisionDelta revision delta}.
- *
- * @see CDORevisionDelta#accept(CDOFeatureDeltaVisitor)
- * @author Simon McDuff
- * @apiviz.uses {@link CDOFeatureDelta} - - visits
- */
-public interface CDOFeatureDeltaVisitor
-{
- public void visit(CDOMoveFeatureDelta delta);
-
- public void visit(CDOAddFeatureDelta delta);
-
- public void visit(CDORemoveFeatureDelta delta);
-
- public void visit(CDOSetFeatureDelta delta);
-
- public void visit(CDOUnsetFeatureDelta delta);
-
- public void visit(CDOListFeatureDelta delta);
-
- public void visit(CDOClearFeatureDelta delta);
-
- public void visit(CDOContainerFeatureDelta delta);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
+
+/**
+ * Visits all {@link CDOFeatureDelta feature deltas} of a {@link CDORevisionDelta revision delta}.
+ *
+ * @see CDORevisionDelta#accept(CDOFeatureDeltaVisitor)
+ * @author Simon McDuff
+ * @apiviz.uses {@link CDOFeatureDelta} - - visits
+ */
+public interface CDOFeatureDeltaVisitor
+{
+ public void visit(CDOMoveFeatureDelta delta);
+
+ public void visit(CDOAddFeatureDelta delta);
+
+ public void visit(CDORemoveFeatureDelta delta);
+
+ public void visit(CDOSetFeatureDelta delta);
+
+ public void visit(CDOUnsetFeatureDelta delta);
+
+ public void visit(CDOListFeatureDelta delta);
+
+ public void visit(CDOClearFeatureDelta delta);
+
+ public void visit(CDOContainerFeatureDelta delta);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOListFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOListFeatureDelta.java
index 1495f5e188..47c22c4b3c 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOListFeatureDelta.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOListFeatureDelta.java
@@ -1,31 +1,31 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.revision.delta;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import java.util.List;
-
-/**
- * A {@link CDOFeatureDelta feature delta} that represents any modification of the list of a many-valued
- * {@link EStructuralFeature feature}. The detailed changes to this list are returned by the {@link #getListChanges()}
- * method.
- *
- * @author Simon McDuff
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.composedOf {@link CDOFeatureDelta} - - listChanges
- */
-public interface CDOListFeatureDelta extends CDOFeatureDelta
-{
- public List<CDOFeatureDelta> getListChanges();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import java.util.List;
+
+/**
+ * A {@link CDOFeatureDelta feature delta} that represents any modification of the list of a many-valued
+ * {@link EStructuralFeature feature}. The detailed changes to this list are returned by the {@link #getListChanges()}
+ * method.
+ *
+ * @author Simon McDuff
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.composedOf {@link CDOFeatureDelta} - - listChanges
+ */
+public interface CDOListFeatureDelta extends CDOFeatureDelta
+{
+ public List<CDOFeatureDelta> getListChanges();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOMoveFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOMoveFeatureDelta.java
index a2f5ad9ca2..18607550b8 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOMoveFeatureDelta.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOMoveFeatureDelta.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.revision.delta;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * A {@link CDOFeatureDelta feature delta} that represents a move of one element of a many-valued
- * {@link EStructuralFeature feature} to a different list position.
- *
- * @author Simon McDuff
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOMoveFeatureDelta extends CDOFeatureDelta
-{
- public int getOldPosition();
-
- public int getNewPosition();
-
- /**
- * @since 4.0
- */
- public Object getValue();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * A {@link CDOFeatureDelta feature delta} that represents a move of one element of a many-valued
+ * {@link EStructuralFeature feature} to a different list position.
+ *
+ * @author Simon McDuff
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOMoveFeatureDelta extends CDOFeatureDelta
+{
+ public int getOldPosition();
+
+ public int getNewPosition();
+
+ /**
+ * @since 4.0
+ */
+ public Object getValue();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORemoveFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORemoveFeatureDelta.java
index 578c6de287..ad719effc2 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORemoveFeatureDelta.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORemoveFeatureDelta.java
@@ -1,32 +1,32 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.revision.delta;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * A {@link CDOFeatureDelta feature delta} that represents a removal from a many-valued {@link EStructuralFeature
- * feature}.
- *
- * @author Simon McDuff
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDORemoveFeatureDelta extends CDOFeatureDelta
-{
- public int getIndex();
-
- /**
- * @since 3.0
- */
- public Object getValue();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * A {@link CDOFeatureDelta feature delta} that represents a removal from a many-valued {@link EStructuralFeature
+ * feature}.
+ *
+ * @author Simon McDuff
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDORemoveFeatureDelta extends CDOFeatureDelta
+{
+ public int getIndex();
+
+ /**
+ * @since 3.0
+ */
+ public Object getValue();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDelta.java
index a9d6a4e639..0213ec5553 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDelta.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDelta.java
@@ -1,88 +1,88 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Simon McDuff - bug 201266
- */
-package org.eclipse.emf.cdo.common.revision.delta;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
-import org.eclipse.emf.cdo.common.revision.CDORevisable;
-import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.common.revision.CDORevisionData;
-import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
-import org.eclipse.emf.cdo.internal.common.revision.delta.CDODetachedRevisionDeltaImpl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import java.util.List;
-
-/**
- * Represents the change delta between two {@link CDORevision revisions} of a CDO object. The detailed
- * {@link CDOFeatureDelta feature deltas} are returned by the {@link #getFeatureDeltas()} method.
- *
- * @author Eike Stepper
- * @since 2.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- * @apiviz.landmark
- * @apiviz.has {@link org.eclipse.emf.ecore.EClass}
- * @apiviz.has {@link org.eclipse.emf.cdo.common.revision.CDORevisable} oneway - - target
- * @apiviz.composedOf {@link CDOFeatureDelta}
- */
-public interface CDORevisionDelta extends CDORevisionKey
-{
- /**
- * This constant is only passed into conflict resolvers to indicate that a conflict was caused by remote detachment of
- * an object. Calling any method on this marker instance will result in an {@link UnsupportedOperationException} being
- * thrown.
- *
- * @since 4.0
- */
- public static final CDORevisionDelta DETACHED = new CDODetachedRevisionDeltaImpl();
-
- /**
- * @since 3.0
- */
- public EClass getEClass();
-
- /**
- * @since 4.0
- */
- public CDORevisable getTarget();
-
- /**
- * @since 3.0
- */
- public boolean isEmpty();
-
- /**
- * @since 4.0
- */
- public CDORevisionDelta copy();
-
- /**
- * @since 4.0
- */
- public CDOFeatureDelta getFeatureDelta(EStructuralFeature feature);
-
- public List<CDOFeatureDelta> getFeatureDeltas();
-
- /**
- * Applies the {@link #getFeatureDeltas() feature deltas} in this revision delta to the {@link CDORevisionData data}
- * of the given revision.
- * <p>
- * The system data of the given revision, e.g. {@link CDOBranchPoint branch point} or {@link CDOBranchVersion branch
- * version} of the given revision are <b>not</b> modified.
- */
- public void apply(CDORevision revision);
-
- public void accept(CDOFeatureDeltaVisitor visitor);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Simon McDuff - bug 201266
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
+import org.eclipse.emf.cdo.common.revision.CDORevisable;
+import org.eclipse.emf.cdo.common.revision.CDORevision;
+import org.eclipse.emf.cdo.common.revision.CDORevisionData;
+import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
+import org.eclipse.emf.cdo.internal.common.revision.delta.CDODetachedRevisionDeltaImpl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import java.util.List;
+
+/**
+ * Represents the change delta between two {@link CDORevision revisions} of a CDO object. The detailed
+ * {@link CDOFeatureDelta feature deltas} are returned by the {@link #getFeatureDeltas()} method.
+ *
+ * @author Eike Stepper
+ * @since 2.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @apiviz.landmark
+ * @apiviz.has {@link org.eclipse.emf.ecore.EClass}
+ * @apiviz.has {@link org.eclipse.emf.cdo.common.revision.CDORevisable} oneway - - target
+ * @apiviz.composedOf {@link CDOFeatureDelta}
+ */
+public interface CDORevisionDelta extends CDORevisionKey
+{
+ /**
+ * This constant is only passed into conflict resolvers to indicate that a conflict was caused by remote detachment of
+ * an object. Calling any method on this marker instance will result in an {@link UnsupportedOperationException} being
+ * thrown.
+ *
+ * @since 4.0
+ */
+ public static final CDORevisionDelta DETACHED = new CDODetachedRevisionDeltaImpl();
+
+ /**
+ * @since 3.0
+ */
+ public EClass getEClass();
+
+ /**
+ * @since 4.0
+ */
+ public CDORevisable getTarget();
+
+ /**
+ * @since 3.0
+ */
+ public boolean isEmpty();
+
+ /**
+ * @since 4.0
+ */
+ public CDORevisionDelta copy();
+
+ /**
+ * @since 4.0
+ */
+ public CDOFeatureDelta getFeatureDelta(EStructuralFeature feature);
+
+ public List<CDOFeatureDelta> getFeatureDeltas();
+
+ /**
+ * Applies the {@link #getFeatureDeltas() feature deltas} in this revision delta to the {@link CDORevisionData data}
+ * of the given revision.
+ * <p>
+ * The system data of the given revision, e.g. {@link CDOBranchPoint branch point} or {@link CDOBranchVersion branch
+ * version} of the given revision are <b>not</b> modified.
+ */
+ public void apply(CDORevision revision);
+
+ public void accept(CDOFeatureDeltaVisitor visitor);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDeltaProvider.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDeltaProvider.java
index f5f99b1582..40a73619c0 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDeltaProvider.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDORevisionDeltaProvider.java
@@ -1,25 +1,25 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.revision.delta;
-
-import org.eclipse.emf.cdo.common.id.CDOID;
-
-/**
- * Provides consumers with the {@link CDORevisionDelta revision deltas} of {@link CDOID identifiable} CDO objects.
- *
- * @author Eike Stepper
- * @since 4.0
- * @apiviz.uses {@link CDORevisionDelta} - - provides
- */
-public interface CDORevisionDeltaProvider
-{
- public CDORevisionDelta getRevisionDelta(CDOID id);
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+
+/**
+ * Provides consumers with the {@link CDORevisionDelta revision deltas} of {@link CDOID identifiable} CDO objects.
+ *
+ * @author Eike Stepper
+ * @since 4.0
+ * @apiviz.uses {@link CDORevisionDelta} - - provides
+ */
+public interface CDORevisionDeltaProvider
+{
+ public CDORevisionDelta getRevisionDelta(CDOID id);
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOSetFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOSetFeatureDelta.java
index 36f43c2755..571adf258a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOSetFeatureDelta.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOSetFeatureDelta.java
@@ -1,39 +1,39 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.revision.delta;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * A {@link CDOFeatureDelta feature delta} that represents a value change of a single-valued {@link EStructuralFeature
- * feature}.
- *
- * @author Simon McDuff
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOSetFeatureDelta extends CDOFeatureDelta
-{
- /**
- * @since 4.0
- */
- public static final Object UNSPECIFIED = new Object();
-
- public int getIndex();
-
- public Object getValue();
-
- /**
- * @since 4.0
- */
- public Object getOldValue();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * A {@link CDOFeatureDelta feature delta} that represents a value change of a single-valued {@link EStructuralFeature
+ * feature}.
+ *
+ * @author Simon McDuff
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOSetFeatureDelta extends CDOFeatureDelta
+{
+ /**
+ * @since 4.0
+ */
+ public static final Object UNSPECIFIED = new Object();
+
+ public int getIndex();
+
+ public Object getValue();
+
+ /**
+ * @since 4.0
+ */
+ public Object getOldValue();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOUnsetFeatureDelta.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOUnsetFeatureDelta.java
index a3e495f42a..94e44b5d77 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOUnsetFeatureDelta.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/CDOUnsetFeatureDelta.java
@@ -1,26 +1,26 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.revision.delta;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * A {@link CDOFeatureDelta feature delta} that represents the <em>unsetting</em> of the value of a
- * {@link EStructuralFeature feature}.
- *
- * @author Simon McDuff
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOUnsetFeatureDelta extends CDOFeatureDelta
-{
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * A {@link CDOFeatureDelta feature delta} that represents the <em>unsetting</em> of the value of a
+ * {@link EStructuralFeature feature}.
+ *
+ * @author Simon McDuff
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOUnsetFeatureDelta extends CDOFeatureDelta
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/package-info.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/package-info.java
index 244301ea74..30d16768a9 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/delta/package-info.java
@@ -1,15 +1,15 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-
-/**
- * Common concepts for dealing with revision deltas and feature deltas.
- */
-package org.eclipse.emf.cdo.common.revision.delta;
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Common concepts for dealing with revision deltas and feature deltas.
+ */
+package org.eclipse.emf.cdo.common.revision.delta;
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/package-info.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/package-info.java
index 7797a7f021..7ed5c5f3bc 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/package-info.java
@@ -1,19 +1,19 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-
-/**
- * Common concepts for dealing with revisions and revision lists.
- *
- * @apiviz.exclude .*\.INotifier
- * @apiviz.exclude .*Event
- */
-package org.eclipse.emf.cdo.common.revision;
-
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+
+/**
+ * Common concepts for dealing with revisions and revision lists.
+ *
+ * @apiviz.exclude .*\.INotifier
+ * @apiviz.exclude .*Event
+ */
+package org.eclipse.emf.cdo.common.revision;
+
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/BlockingCloseableIterator.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/BlockingCloseableIterator.java
index 7b2e36e181..7a6d9a8629 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/BlockingCloseableIterator.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/BlockingCloseableIterator.java
@@ -1,29 +1,29 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- *************************************************************************/
-package org.eclipse.emf.cdo.common.util;
-
-import org.eclipse.net4j.util.collection.CloseableIterator;
-
-/**
- * A closeable iterator that blocks on {@link #hasNext()} until the next element is available or the end of the
- * iteration is reached.
- *
- * @author Simon McDuff
- * @since 2.0
- */
-public interface BlockingCloseableIterator<T> extends CloseableIterator<T>
-{
- /**
- * Non-blocking call.
- */
- public T peek();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ *************************************************************************/
+package org.eclipse.emf.cdo.common.util;
+
+import org.eclipse.net4j.util.collection.CloseableIterator;
+
+/**
+ * A closeable iterator that blocks on {@link #hasNext()} until the next element is available or the end of the
+ * iteration is reached.
+ *
+ * @author Simon McDuff
+ * @since 2.0
+ */
+public interface BlockingCloseableIterator<T> extends CloseableIterator<T>
+{
+ /**
+ * Non-blocking call.
+ */
+ public T peek();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonEventAdapter.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonEventAdapter.java
index ca59d4e14b..d10ad413c9 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonEventAdapter.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonEventAdapter.java
@@ -1,85 +1,85 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.util;
-
-import org.eclipse.emf.cdo.common.CDOCommonSession;
-import org.eclipse.emf.cdo.common.CDOCommonSession.Options.PassiveUpdateMode;
-import org.eclipse.emf.cdo.common.CDOCommonView;
-
-import org.eclipse.net4j.util.container.ContainerEventAdapter;
-import org.eclipse.net4j.util.container.IContainer;
-import org.eclipse.net4j.util.event.IEvent;
-
-/**
- * A convenience adapter for common CDO {@link IEvent events}.
- *
- * @author Eike Stepper
- * @since 3.0
- */
-public class CDOCommonEventAdapter extends ContainerEventAdapter<Object>
-{
- public CDOCommonEventAdapter()
- {
- }
-
- @Override
- protected void notifyOtherEvent(IEvent event)
- {
- if (event instanceof CDOCommonSession.Options.PassiveUpdateEvent)
- {
- CDOCommonSession.Options.PassiveUpdateEvent e = (CDOCommonSession.Options.PassiveUpdateEvent)event;
- boolean oldEnabled = e.getOldEnabled();
- boolean newEnabled = e.getNewEnabled();
- if (oldEnabled != newEnabled)
- {
- onPassiveUpdatesEnabled(oldEnabled, newEnabled);
- }
- else
- {
- onPassiveUpdatesMode(e.getOldMode(), e.getNewMode());
- }
- }
- }
-
- @Override
- protected void onAdded(IContainer<Object> container, Object element)
- {
- if (element instanceof CDOCommonView)
- {
- onViewOpened((CDOCommonView)element);
- }
- }
-
- @Override
- protected void onRemoved(IContainer<Object> container, Object element)
- {
- if (element instanceof CDOCommonView)
- {
- onViewClosed((CDOCommonView)element);
- }
- }
-
- protected void onViewOpened(CDOCommonView view)
- {
- }
-
- protected void onViewClosed(CDOCommonView element)
- {
- }
-
- protected void onPassiveUpdatesEnabled(boolean oldEnabled, boolean newEnabled)
- {
- }
-
- protected void onPassiveUpdatesMode(PassiveUpdateMode oldMode, PassiveUpdateMode newMode)
- {
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.util;
+
+import org.eclipse.emf.cdo.common.CDOCommonSession;
+import org.eclipse.emf.cdo.common.CDOCommonSession.Options.PassiveUpdateMode;
+import org.eclipse.emf.cdo.common.CDOCommonView;
+
+import org.eclipse.net4j.util.container.ContainerEventAdapter;
+import org.eclipse.net4j.util.container.IContainer;
+import org.eclipse.net4j.util.event.IEvent;
+
+/**
+ * A convenience adapter for common CDO {@link IEvent events}.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ */
+public class CDOCommonEventAdapter extends ContainerEventAdapter<Object>
+{
+ public CDOCommonEventAdapter()
+ {
+ }
+
+ @Override
+ protected void notifyOtherEvent(IEvent event)
+ {
+ if (event instanceof CDOCommonSession.Options.PassiveUpdateEvent)
+ {
+ CDOCommonSession.Options.PassiveUpdateEvent e = (CDOCommonSession.Options.PassiveUpdateEvent)event;
+ boolean oldEnabled = e.getOldEnabled();
+ boolean newEnabled = e.getNewEnabled();
+ if (oldEnabled != newEnabled)
+ {
+ onPassiveUpdatesEnabled(oldEnabled, newEnabled);
+ }
+ else
+ {
+ onPassiveUpdatesMode(e.getOldMode(), e.getNewMode());
+ }
+ }
+ }
+
+ @Override
+ protected void onAdded(IContainer<Object> container, Object element)
+ {
+ if (element instanceof CDOCommonView)
+ {
+ onViewOpened((CDOCommonView)element);
+ }
+ }
+
+ @Override
+ protected void onRemoved(IContainer<Object> container, Object element)
+ {
+ if (element instanceof CDOCommonView)
+ {
+ onViewClosed((CDOCommonView)element);
+ }
+ }
+
+ protected void onViewOpened(CDOCommonView view)
+ {
+ }
+
+ protected void onViewClosed(CDOCommonView element)
+ {
+ }
+
+ protected void onPassiveUpdatesEnabled(boolean oldEnabled, boolean newEnabled)
+ {
+ }
+
+ protected void onPassiveUpdatesMode(PassiveUpdateMode oldMode, PassiveUpdateMode newMode)
+ {
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java
index 16785e73c4..ce012e9d44 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java
@@ -1,174 +1,174 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.util;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
-import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.commit.CDOCommitInfoManager;
-import org.eclipse.emf.cdo.common.id.CDOIDProvider;
-import org.eclipse.emf.cdo.common.lob.CDOLobStore;
-import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
-import org.eclipse.emf.cdo.common.protocol.CDODataInput;
-import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
-import org.eclipse.emf.cdo.common.revision.CDOListFactory;
-import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.common.revision.CDORevisionFactory;
-import org.eclipse.emf.cdo.internal.common.protocol.CDODataInputImpl;
-import org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputImpl;
-
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutput;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Various static methods that may help with I/O and time stamps.
- *
- * @author Eike Stepper
- * @since 3.0
- */
-public final class CDOCommonUtil
-{
- /**
- * @since 4.0
- */
- public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss'.'SSS");
-
- private CDOCommonUtil()
- {
- }
-
- /**
- * @since 4.0
- */
- public static CDODataInput createCDODataInput(ExtendedDataInputStream inputStream,
- final CDOPackageRegistry packageRegistry, final CDOBranchManager branchManager,
- final CDOCommitInfoManager commitManager, final CDORevisionFactory revisionFactory,
- final CDOListFactory listFactory, final CDOLobStore lobStore) throws IOException
- {
- return new CDODataInputImpl(inputStream)
- {
- @Override
- protected CDOPackageRegistry getPackageRegistry()
- {
- return packageRegistry;
- }
-
- @Override
- protected CDOBranchManager getBranchManager()
- {
- return branchManager;
- }
-
- @Override
- protected CDOCommitInfoManager getCommitInfoManager()
- {
- return commitManager;
- }
-
- @Override
- protected CDORevisionFactory getRevisionFactory()
- {
- return revisionFactory;
- }
-
- @Override
- protected CDOListFactory getListFactory()
- {
- return listFactory;
- }
-
- @Override
- protected CDOLobStore getLobStore()
- {
- return lobStore;
- }
- };
- }
-
- /**
- * @since 4.0
- */
- public static CDODataOutput createCDODataOutput(ExtendedDataOutput extendedDataOutputStream,
- final CDOPackageRegistry packageRegistry, final CDOIDProvider idProvider)
- {
- return new CDODataOutputImpl(extendedDataOutputStream)
- {
- @Override
- public CDOPackageRegistry getPackageRegistry()
- {
- return packageRegistry;
- }
-
- @Override
- public CDOIDProvider getIDProvider()
- {
- return idProvider;
- }
- };
- }
-
- public static boolean isValidTimeStamp(long timeStamp, long startTime, long endTime)
- {
- if (timeStamp == CDOBranchPoint.UNSPECIFIED_DATE)
- {
- return endTime == CDOBranchPoint.UNSPECIFIED_DATE;
- }
-
- return (endTime == CDOBranchPoint.UNSPECIFIED_DATE || endTime >= timeStamp) && timeStamp >= startTime;
- }
-
- public static int compareTimeStamps(long t1, long t2)
- {
- if (t1 == CDORevision.UNSPECIFIED_DATE)
- {
- t1 = Long.MAX_VALUE;
- }
-
- if (t2 == CDORevision.UNSPECIFIED_DATE)
- {
- t2 = Long.MAX_VALUE;
- }
-
- return t1 < t2 ? -1 : t1 == t2 ? 0 : 1;
- }
-
- public static String formatTimeStamp()
- {
- return formatTimeStamp(System.currentTimeMillis());
- }
-
- public static String formatTimeStamp(long timeStamp)
- {
- if (timeStamp == CDORevision.UNSPECIFIED_DATE)
- {
- return "*";
- }
-
- return DATE_FORMAT.format(new Date(timeStamp));
- }
-
- /**
- * @since 4.0
- */
- public static long parseTimeStamp(String timeStamp) throws ParseException
- {
- if ("*".equals(timeStamp))
- {
- return CDORevision.UNSPECIFIED_DATE;
- }
-
- return DATE_FORMAT.parse(timeStamp).getTime();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.util;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.commit.CDOCommitInfoManager;
+import org.eclipse.emf.cdo.common.id.CDOIDProvider;
+import org.eclipse.emf.cdo.common.lob.CDOLobStore;
+import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
+import org.eclipse.emf.cdo.common.protocol.CDODataInput;
+import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+import org.eclipse.emf.cdo.common.revision.CDOListFactory;
+import org.eclipse.emf.cdo.common.revision.CDORevision;
+import org.eclipse.emf.cdo.common.revision.CDORevisionFactory;
+import org.eclipse.emf.cdo.internal.common.protocol.CDODataInputImpl;
+import org.eclipse.emf.cdo.internal.common.protocol.CDODataOutputImpl;
+
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
+import org.eclipse.net4j.util.io.ExtendedDataOutput;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * Various static methods that may help with I/O and time stamps.
+ *
+ * @author Eike Stepper
+ * @since 3.0
+ */
+public final class CDOCommonUtil
+{
+ /**
+ * @since 4.0
+ */
+ public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss'.'SSS");
+
+ private CDOCommonUtil()
+ {
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDODataInput createCDODataInput(ExtendedDataInputStream inputStream,
+ final CDOPackageRegistry packageRegistry, final CDOBranchManager branchManager,
+ final CDOCommitInfoManager commitManager, final CDORevisionFactory revisionFactory,
+ final CDOListFactory listFactory, final CDOLobStore lobStore) throws IOException
+ {
+ return new CDODataInputImpl(inputStream)
+ {
+ @Override
+ protected CDOPackageRegistry getPackageRegistry()
+ {
+ return packageRegistry;
+ }
+
+ @Override
+ protected CDOBranchManager getBranchManager()
+ {
+ return branchManager;
+ }
+
+ @Override
+ protected CDOCommitInfoManager getCommitInfoManager()
+ {
+ return commitManager;
+ }
+
+ @Override
+ protected CDORevisionFactory getRevisionFactory()
+ {
+ return revisionFactory;
+ }
+
+ @Override
+ protected CDOListFactory getListFactory()
+ {
+ return listFactory;
+ }
+
+ @Override
+ protected CDOLobStore getLobStore()
+ {
+ return lobStore;
+ }
+ };
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static CDODataOutput createCDODataOutput(ExtendedDataOutput extendedDataOutputStream,
+ final CDOPackageRegistry packageRegistry, final CDOIDProvider idProvider)
+ {
+ return new CDODataOutputImpl(extendedDataOutputStream)
+ {
+ @Override
+ public CDOPackageRegistry getPackageRegistry()
+ {
+ return packageRegistry;
+ }
+
+ @Override
+ public CDOIDProvider getIDProvider()
+ {
+ return idProvider;
+ }
+ };
+ }
+
+ public static boolean isValidTimeStamp(long timeStamp, long startTime, long endTime)
+ {
+ if (timeStamp == CDOBranchPoint.UNSPECIFIED_DATE)
+ {
+ return endTime == CDOBranchPoint.UNSPECIFIED_DATE;
+ }
+
+ return (endTime == CDOBranchPoint.UNSPECIFIED_DATE || endTime >= timeStamp) && timeStamp >= startTime;
+ }
+
+ public static int compareTimeStamps(long t1, long t2)
+ {
+ if (t1 == CDORevision.UNSPECIFIED_DATE)
+ {
+ t1 = Long.MAX_VALUE;
+ }
+
+ if (t2 == CDORevision.UNSPECIFIED_DATE)
+ {
+ t2 = Long.MAX_VALUE;
+ }
+
+ return t1 < t2 ? -1 : t1 == t2 ? 0 : 1;
+ }
+
+ public static String formatTimeStamp()
+ {
+ return formatTimeStamp(System.currentTimeMillis());
+ }
+
+ public static String formatTimeStamp(long timeStamp)
+ {
+ if (timeStamp == CDORevision.UNSPECIFIED_DATE)
+ {
+ return "*";
+ }
+
+ return DATE_FORMAT.format(new Date(timeStamp));
+ }
+
+ /**
+ * @since 4.0
+ */
+ public static long parseTimeStamp(String timeStamp) throws ParseException
+ {
+ if ("*".equals(timeStamp))
+ {
+ return CDORevision.UNSPECIFIED_DATE;
+ }
+
+ return DATE_FORMAT.parse(timeStamp).getTime();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOException.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOException.java
index ad35efb2af..39eb523d25 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOException.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOException.java
@@ -1,40 +1,40 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.common.util;
-
-/**
- * An unchecked exception for general CDO purposes.
- *
- * @author Eike Stepper
- */
-public class CDOException extends RuntimeException
-{
- private static final long serialVersionUID = 1L;
-
- public CDOException()
- {
- }
-
- public CDOException(String message)
- {
- super(message);
- }
-
- public CDOException(Throwable cause)
- {
- super(cause);
- }
-
- public CDOException(String message, Throwable cause)
- {
- super(message, cause);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.common.util;
+
+/**
+ * An unchecked exception for general CDO purposes.
+ *
+ * @author Eike Stepper
+ */
+public class CDOException extends RuntimeException
+{
+ private static final long serialVersionUID = 1L;
+
+ public CDOException()
+ {
+ }
+
+ public CDOException(String message)
+ {
+ super(message);
+ }
+
+ public CDOException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public CDOException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOFetchRule.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOFetchRule.java
index f8fe8d88fb..1ebf9106b9 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOFetchRule.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOFetchRule.java
@@ -1,88 +1,88 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.util;
-
-import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
-import org.eclipse.emf.cdo.common.protocol.CDODataInput;
-import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Represents a subset of the {@link EStructuralFeature features} of a {@link EClass class}.
- *
- * @author Simon McDuff
- * @since 3.0
- */
-public final class CDOFetchRule
-{
- private EClass eClass;
-
- private List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(0);
-
- public CDOFetchRule(EClass eClass)
- {
- this.eClass = eClass;
- }
-
- public CDOFetchRule(CDODataInput in, CDOPackageRegistry packageManager) throws IOException
- {
- eClass = (EClass)in.readCDOClassifierRefAndResolve();
- int size = in.readInt();
- for (int i = 0; i < size; i++)
- {
- int featureID = in.readInt();
- EStructuralFeature feature = eClass.getEStructuralFeature(featureID);
- features.add(feature);
- }
- }
-
- public void write(CDODataOutput out) throws IOException
- {
- out.writeCDOClassifierRef(eClass);
- out.writeInt(features.size());
- for (EStructuralFeature feature : features)
- {
- out.writeInt(feature.getFeatureID());
- }
- }
-
- public EClass getEClass()
- {
- return eClass;
- }
-
- public List<EStructuralFeature> getFeatures()
- {
- return features;
- }
-
- public void addFeature(EStructuralFeature feature)
- {
- features.add(feature);
- }
-
- public void removeFeature(EStructuralFeature feature)
- {
- features.remove(feature);
- }
-
- public boolean isEmpty()
- {
- return features.isEmpty();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.util;
+
+import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
+import org.eclipse.emf.cdo.common.protocol.CDODataInput;
+import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a subset of the {@link EStructuralFeature features} of a {@link EClass class}.
+ *
+ * @author Simon McDuff
+ * @since 3.0
+ */
+public final class CDOFetchRule
+{
+ private EClass eClass;
+
+ private List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(0);
+
+ public CDOFetchRule(EClass eClass)
+ {
+ this.eClass = eClass;
+ }
+
+ public CDOFetchRule(CDODataInput in, CDOPackageRegistry packageManager) throws IOException
+ {
+ eClass = (EClass)in.readCDOClassifierRefAndResolve();
+ int size = in.readInt();
+ for (int i = 0; i < size; i++)
+ {
+ int featureID = in.readInt();
+ EStructuralFeature feature = eClass.getEStructuralFeature(featureID);
+ features.add(feature);
+ }
+ }
+
+ public void write(CDODataOutput out) throws IOException
+ {
+ out.writeCDOClassifierRef(eClass);
+ out.writeInt(features.size());
+ for (EStructuralFeature feature : features)
+ {
+ out.writeInt(feature.getFeatureID());
+ }
+ }
+
+ public EClass getEClass()
+ {
+ return eClass;
+ }
+
+ public List<EStructuralFeature> getFeatures()
+ {
+ return features;
+ }
+
+ public void addFeature(EStructuralFeature feature)
+ {
+ features.add(feature);
+ }
+
+ public void removeFeature(EStructuralFeature feature)
+ {
+ features.remove(feature);
+ }
+
+ public boolean isEmpty()
+ {
+ return features.isEmpty();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryInfo.java
index 8a8d19aa1e..c87ad81216 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryInfo.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryInfo.java
@@ -1,75 +1,75 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.util;
-
-import org.eclipse.emf.cdo.common.CDOCommonRepository;
-import org.eclipse.emf.cdo.common.CDOCommonView;
-import org.eclipse.emf.cdo.common.commit.CDOChangeSetData;
-
-import java.util.Map;
-
-/**
- * Encapsulates all the transferrable information that fully specifies a query from a {@link CDOCommonView view} to a
- * {@link CDOCommonRepository repository}.
- *
- * @author Simon McDuff
- * @since 3.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public interface CDOQueryInfo
-{
- public static final int UNLIMITED_RESULTS = -1;
-
- /**
- * Returns the language identifier of this query, never <code>null</code>.
- */
- public String getQueryLanguage();
-
- /**
- * Returns the query string of this query or <code>null</code> if no query string has been set.
- */
- public String getQueryString();
-
- /**
- * Returns the parameters of this query as a map.
- */
- public Map<String, Object> getParameters();
-
- /**
- * Returns the context object, or <code>null</code> if no context is bound.
- *
- * @since 4.0
- */
- public Object getContext();
-
- /**
- * Returns the maximum number of results to retrieve or {@link #UNLIMITED_RESULTS} for no limitation.
- */
- public int getMaxResults();
-
- /**
- * Returns <code>true</code> if the view of this query had legacy mode enabled at the time this query was created,
- * <code>false</code> otherwise.
- *
- * @since 4.0
- */
- public boolean isLegacyModeEnabled();
-
- /**
- * Returns the {@link CDOChangeSetData change set} to be considered if this query has been created by a dirty
- * transaction, <code>null</code> otherwise.
- *
- * @since 4.0
- */
- public CDOChangeSetData getChangeSetData();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.util;
+
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.CDOCommonView;
+import org.eclipse.emf.cdo.common.commit.CDOChangeSetData;
+
+import java.util.Map;
+
+/**
+ * Encapsulates all the transferrable information that fully specifies a query from a {@link CDOCommonView view} to a
+ * {@link CDOCommonRepository repository}.
+ *
+ * @author Simon McDuff
+ * @since 3.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOQueryInfo
+{
+ public static final int UNLIMITED_RESULTS = -1;
+
+ /**
+ * Returns the language identifier of this query, never <code>null</code>.
+ */
+ public String getQueryLanguage();
+
+ /**
+ * Returns the query string of this query or <code>null</code> if no query string has been set.
+ */
+ public String getQueryString();
+
+ /**
+ * Returns the parameters of this query as a map.
+ */
+ public Map<String, Object> getParameters();
+
+ /**
+ * Returns the context object, or <code>null</code> if no context is bound.
+ *
+ * @since 4.0
+ */
+ public Object getContext();
+
+ /**
+ * Returns the maximum number of results to retrieve or {@link #UNLIMITED_RESULTS} for no limitation.
+ */
+ public int getMaxResults();
+
+ /**
+ * Returns <code>true</code> if the view of this query had legacy mode enabled at the time this query was created,
+ * <code>false</code> otherwise.
+ *
+ * @since 4.0
+ */
+ public boolean isLegacyModeEnabled();
+
+ /**
+ * Returns the {@link CDOChangeSetData change set} to be considered if this query has been created by a dirty
+ * transaction, <code>null</code> otherwise.
+ *
+ * @since 4.0
+ */
+ public CDOChangeSetData getChangeSetData();
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryQueue.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryQueue.java
index 576522c67f..32c4d11dde 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryQueue.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryQueue.java
@@ -1,415 +1,415 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Simon McDuff - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.common.util;
-
-import org.eclipse.net4j.util.WrappedException;
-import org.eclipse.net4j.util.collection.Closeable;
-
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.NoSuchElementException;
-import java.util.Queue;
-import java.util.concurrent.PriorityBlockingQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * The {@link Queue queue} that represents the result of a CDOQuery.
- *
- * @author Simon McDuff
- * @since 2.0
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
-public class CDOQueryQueue<E> implements Queue<E>, Closeable
-{
- // Static not allowed due to <E>
- private final QueueEntry<E> QUEUE_CLOSED = new QueueEntry<E>();
-
- private PriorityBlockingQueue<QueueEntry<E>> queue = new PriorityBlockingQueue<QueueEntry<E>>(10);
-
- private boolean closed;
-
- private Object closeLock = new Object();
-
- public CDOQueryQueue()
- {
- }
-
- public void setException(Throwable exception)
- {
- queue.add(new QueueEntry<E>(exception));
- }
-
- public void close()
- {
- synchronized (closeLock)
- {
- if (!closed)
- {
- closed = true;
- queue.add(QUEUE_CLOSED);
- }
- }
- }
-
- public boolean isClosed()
- {
- synchronized (closeLock)
- {
- return closed;
- }
- }
-
- public boolean add(E e)
- {
- return queue.add(new QueueEntry<E>(e));
- }
-
- public void clear()
- {
- queue.clear();
- }
-
- public boolean contains(Object o)
- {
- return queue.contains(o);
- }
-
- public E element()
- {
- return checkObject(queue.element());
- }
-
- @Override
- public boolean equals(Object obj)
- {
- return queue.equals(obj);
- }
-
- @Override
- public int hashCode()
- {
- return queue.hashCode();
- }
-
- public boolean isEmpty()
- {
- return queue.isEmpty();
- }
-
- public BlockingCloseableIterator<E> iterator()
- {
- return new BlockingCloseableIteratorImpl();
- }
-
- public boolean offer(E e, long timeout, TimeUnit unit)
- {
- return queue.offer(new QueueEntry<E>(e), timeout, unit);
- }
-
- public boolean offer(E e)
- {
- return queue.offer(new QueueEntry<E>(e));
- }
-
- public E peek()
- {
- return checkObject(queue.peek());
- }
-
- public E poll(long timeout, TimeUnit unit) throws InterruptedException
- {
- return checkObject(queue.poll(timeout, unit));
- }
-
- public void put(E e)
- {
- queue.put(new QueueEntry<E>(e));
- }
-
- public int remainingCapacity()
- {
- return queue.remainingCapacity();
- }
-
- public E remove()
- {
- return checkObject(queue.remove());
- }
-
- public boolean remove(Object o)
- {
- return queue.remove(o);
- }
-
- public int size()
- {
- return queue.size();
- }
-
- public E take() throws InterruptedException
- {
- QueueEntry<E> entry = null;
-
- entry = queue.take();
-
- return checkObject(entry);
- }
-
- public Object[] toArray()
- {
- return queue.toArray();
- }
-
- @SuppressWarnings("unchecked")
- public Object[] toArray(Object[] a)
- {
- return queue.toArray(a);
- }
-
- @Override
- public String toString()
- {
- return queue.toString();
- }
-
- public E poll()
- {
- QueueEntry<E> entry = queue.poll();
- return checkObject(entry);
- }
-
- public Comparator<?> comparator()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean containsAll(Collection<?> c)
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean addAll(Collection<? extends E> c)
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean removeAll(Collection<?> c)
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean retainAll(Collection<?> c)
- {
- throw new UnsupportedOperationException();
- }
-
- private E checkObject(QueueEntry<E> entry)
- {
- if (entry == null || entry == QUEUE_CLOSED)
- {
- return null;
- }
-
- return entry.getObjectWithException();
- }
-
- /**
- * @author Simon McDuff
- * @since 2.0
- */
- private static class QueueEntry<E> implements Comparable<QueueEntry<E>>
- {
- private static final AtomicLong nextSeq = new AtomicLong(0);
-
- private long seqNumber;
-
- private Object internalObject;
-
- public QueueEntry()
- {
- seqNumber = Long.MAX_VALUE;
- }
-
- public QueueEntry(E object)
- {
- internalObject = object;
- seqNumber = nextSeq.getAndIncrement();
- }
-
- public QueueEntry(Throwable object)
- {
- internalObject = object;
- seqNumber = nextSeq.getAndIncrement();
- }
-
- @SuppressWarnings("unchecked")
- public E getObjectWithException()
- {
- Throwable exception = getException();
- if (exception instanceof Exception)
- {
- throw WrappedException.wrap((Exception)exception);
- }
- else if (exception instanceof Error)
- {
- throw (Error)exception;
- }
-
- return (E)internalObject;
- }
-
- public Throwable getException()
- {
- if (internalObject instanceof Throwable)
- {
- return (Throwable)internalObject;
- }
-
- return null;
- }
-
- public int compareTo(QueueEntry<E> o)
- {
- if (getException() != null)
- {
- return -1;
- }
-
- if (o.getException() != null)
- {
- return 1;
- }
-
- if (this == o)
- {
- return 0;
- }
-
- if (seqNumber == o.seqNumber)
- {
- // Should not be possible
- return 0;
- }
-
- return seqNumber < o.seqNumber ? -1 : 1;
- }
-
- // @Override
- // public boolean equals(Object obj)
- // {
- // if (this == obj)
- // {
- // return true;
- // }
- //
- // if (obj instanceof QueueEntry<?>)
- // {
- // @SuppressWarnings("unchecked")
- // QueueEntry<E> that = (QueueEntry<E>)obj;
- // return compareTo(that) == 0;
- // }
- //
- // return false;
- // }
- }
-
- /**
- * A blocking iterator that takes elements from a {@link CDOQueryQueue}.
- *
- * @author Simon McDuff
- * @since 2.0
- */
- public class BlockingCloseableIteratorImpl implements BlockingCloseableIterator<E>
- {
- private boolean closed;
-
- private E nextElement;
-
- public BlockingCloseableIteratorImpl()
- {
- }
-
- public E peek()
- {
- if (nextElement == null)
- {
- return CDOQueryQueue.this.peek();
- }
-
- return nextElement;
- }
-
- public boolean hasNext()
- {
- privateNext(false);
- return nextElement != null;
- }
-
- private void privateNext(boolean failOnNull)
- {
- if (nextElement == null)
- {
- try
- {
- synchronized (closeLock)
- {
- if (CDOQueryQueue.this.isEmpty() && CDOQueryQueue.this.isClosed())
- {
- if (failOnNull)
- {
- throw new NoSuchElementException();
- }
-
- return;
- }
- }
-
- nextElement = take();
- }
- catch (InterruptedException ex)
- {
- throw WrappedException.wrap(ex);
- }
- }
- }
-
- public E next()
- {
- try
- {
- privateNext(true);
- return nextElement;
- }
- finally
- {
- nextElement = null;
- }
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
-
- public void close()
- {
- this.closed = true;
- }
-
- public boolean isClosed()
- {
- return this.closed;
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon McDuff - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.common.util;
+
+import org.eclipse.net4j.util.WrappedException;
+import org.eclipse.net4j.util.collection.Closeable;
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.NoSuchElementException;
+import java.util.Queue;
+import java.util.concurrent.PriorityBlockingQueue;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * The {@link Queue queue} that represents the result of a CDOQuery.
+ *
+ * @author Simon McDuff
+ * @since 2.0
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public class CDOQueryQueue<E> implements Queue<E>, Closeable
+{
+ // Static not allowed due to <E>
+ private final QueueEntry<E> QUEUE_CLOSED = new QueueEntry<E>();
+
+ private PriorityBlockingQueue<QueueEntry<E>> queue = new PriorityBlockingQueue<QueueEntry<E>>(10);
+
+ private boolean closed;
+
+ private Object closeLock = new Object();
+
+ public CDOQueryQueue()
+ {
+ }
+
+ public void setException(Throwable exception)
+ {
+ queue.add(new QueueEntry<E>(exception));
+ }
+
+ public void close()
+ {
+ synchronized (closeLock)
+ {
+ if (!closed)
+ {
+ closed = true;
+ queue.add(QUEUE_CLOSED);
+ }
+ }
+ }
+
+ public boolean isClosed()
+ {
+ synchronized (closeLock)
+ {
+ return closed;
+ }
+ }
+
+ public boolean add(E e)
+ {
+ return queue.add(new QueueEntry<E>(e));
+ }
+
+ public void clear()
+ {
+ queue.clear();
+ }
+
+ public boolean contains(Object o)
+ {
+ return queue.contains(o);
+ }
+
+ public E element()
+ {
+ return checkObject(queue.element());
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return queue.equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return queue.hashCode();
+ }
+
+ public boolean isEmpty()
+ {
+ return queue.isEmpty();
+ }
+
+ public BlockingCloseableIterator<E> iterator()
+ {
+ return new BlockingCloseableIteratorImpl();
+ }
+
+ public boolean offer(E e, long timeout, TimeUnit unit)
+ {
+ return queue.offer(new QueueEntry<E>(e), timeout, unit);
+ }
+
+ public boolean offer(E e)
+ {
+ return queue.offer(new QueueEntry<E>(e));
+ }
+
+ public E peek()
+ {
+ return checkObject(queue.peek());
+ }
+
+ public E poll(long timeout, TimeUnit unit) throws InterruptedException
+ {
+ return checkObject(queue.poll(timeout, unit));
+ }
+
+ public void put(E e)
+ {
+ queue.put(new QueueEntry<E>(e));
+ }
+
+ public int remainingCapacity()
+ {
+ return queue.remainingCapacity();
+ }
+
+ public E remove()
+ {
+ return checkObject(queue.remove());
+ }
+
+ public boolean remove(Object o)
+ {
+ return queue.remove(o);
+ }
+
+ public int size()
+ {
+ return queue.size();
+ }
+
+ public E take() throws InterruptedException
+ {
+ QueueEntry<E> entry = null;
+
+ entry = queue.take();
+
+ return checkObject(entry);
+ }
+
+ public Object[] toArray()
+ {
+ return queue.toArray();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object[] toArray(Object[] a)
+ {
+ return queue.toArray(a);
+ }
+
+ @Override
+ public String toString()
+ {
+ return queue.toString();
+ }
+
+ public E poll()
+ {
+ QueueEntry<E> entry = queue.poll();
+ return checkObject(entry);
+ }
+
+ public Comparator<?> comparator()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean containsAll(Collection<?> c)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean addAll(Collection<? extends E> c)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean removeAll(Collection<?> c)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean retainAll(Collection<?> c)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ private E checkObject(QueueEntry<E> entry)
+ {
+ if (entry == null || entry == QUEUE_CLOSED)
+ {
+ return null;
+ }
+
+ return entry.getObjectWithException();
+ }
+
+ /**
+ * @author Simon McDuff
+ * @since 2.0
+ */
+ private static class QueueEntry<E> implements Comparable<QueueEntry<E>>
+ {
+ private static final AtomicLong nextSeq = new AtomicLong(0);
+
+ private long seqNumber;
+
+ private Object internalObject;
+
+ public QueueEntry()
+ {
+ seqNumber = Long.MAX_VALUE;
+ }
+
+ public QueueEntry(E object)
+ {
+ internalObject = object;
+ seqNumber = nextSeq.getAndIncrement();
+ }
+
+ public QueueEntry(Throwable object)
+ {
+ internalObject = object;
+ seqNumber = nextSeq.getAndIncrement();
+ }
+
+ @SuppressWarnings("unchecked")
+ public E getObjectWithException()
+ {
+ Throwable exception = getException();
+ if (exception instanceof Exception)
+ {
+ throw WrappedException.wrap((Exception)exception);
+ }
+ else if (exception instanceof Error)
+ {
+ throw (Error)exception;
+ }
+
+ return (E)internalObject;
+ }
+
+ public Throwable getException()
+ {
+ if (internalObject instanceof Throwable)
+ {
+ return (Throwable)internalObject;
+ }
+
+ return null;
+ }
+
+ public int compareTo(QueueEntry<E> o)
+ {
+ if (getException() != null)
+ {
+ return -1;
+ }
+
+ if (o.getException() != null)
+ {
+ return 1;
+ }
+
+ if (this == o)
+ {
+ return 0;
+ }
+
+ if (seqNumber == o.seqNumber)
+ {
+ // Should not be possible
+ return 0;
+ }
+
+ return seqNumber < o.seqNumber ? -1 : 1;
+ }
+
+ // @Override
+ // public boolean equals(Object obj)
+ // {
+ // if (this == obj)
+ // {
+ // return true;
+ // }
+ //
+ // if (obj instanceof QueueEntry<?>)
+ // {
+ // @SuppressWarnings("unchecked")
+ // QueueEntry<E> that = (QueueEntry<E>)obj;
+ // return compareTo(that) == 0;
+ // }
+