Class BaseCDORevision
java.lang.Object
org.eclipse.emf.cdo.spi.common.revision.AbstractCDORevision
org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision
- All Implemented Interfaces:
CDOBranchPoint,CDOBranchProvider,CDOBranchVersion,CDOIdentifiable,CDOIDAndVersion,CDORevisable,CDORevision,CDORevisionData,CDORevisionKey,CDOTimeProvider,CDOVersionProvider,CDOBranchAdjustable,CDOReferenceAdjustable,InternalCDOList.Owner,InternalCDORevision
Standard mutable revision representation used by CDO's revision factory. It stores object identity and branch
metadata alongside persistent feature values, and reads or writes that state through the CDO revision protocol with
support for permissions and partially loaded lists.
- Since:
- 3.0
- Author:
- Eike Stepper
- No Extend
- This class is not intended to be subclassed by clients.
-
Field Summary
Fields inherited from interface org.eclipse.emf.cdo.common.branch.CDOBranchPoint
INVALID_DATE, UNSPECIFIED_DATEFields inherited from interface org.eclipse.emf.cdo.common.branch.CDOBranchVersion
UNSPECIFIED_VERSIONFields inherited from interface org.eclipse.emf.cdo.common.revision.CDORevision
DEPTH_INFINITE, DEPTH_NONE, DEPTH_ONE, FIRST_VERSION, MAIN_BRANCH_ID, PERMISSION_PROVIDER, UNCHUNKEDFields inherited from interface org.eclipse.emf.cdo.common.revision.CDORevisionData
NILFields inherited from interface org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision
DO_NOT_CREATE_LIST -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseCDORevision(BaseCDORevision source) BaseCDORevision(EClass eClass) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(EStructuralFeature feature, int index, Object value) voidadjustBranches(CDOBranchManager newBranchManager) booleanadjustReferences(CDOReferenceAdjuster referenceAdjuster) booleanbypassPermissionChecks(boolean on) Enables or disables permission checking for this revision.static voidcheckNoFeatureMap(EStructuralFeature feature) Deprecated.voidclear(EStructuralFeature feature) compare(CDORevision origin) constructList(EStructuralFeature feature, int size) Constructs a new many-valued feature list for revision loading.constructList(EStructuralFeature feature, int size, int initialChunk) Constructs a list for a DB read with the given initial chunk size.booleancontains(EStructuralFeature feature, Object value) voidconvertEObjects(CDOIDProvider idProvider) protected abstract ObjectdoGetValue(int featureIndex) protected abstract voiddoSetValue(int featureIndex, Object value) static StringformatFlags(BaseCDORevision revision) voidfreeze()get(EStructuralFeature feature, int index) Returns the branch of this branch version.intReturns the container feature ID.intDeprecated.getID()getListOrNull(EStructuralFeature feature) getOrCreateList(EStructuralFeature feature) Same asgetOrCreateList(feature, 0).getOrCreateList(EStructuralFeature feature, int size) Returns the list that represents the passed feature, possibly creates it if needed.longlongReturns the time stamp of this branch point, or the fixed special time stampunspecifiedif this branch point marks theheadof a branch.protected ObjectgetValue(int featureIndex) getValue(EStructuralFeature feature) Should never returnCDORevisionData.NILintReturns the version number of this branch version.inthashCode(EStructuralFeature feature) intindexOf(EStructuralFeature feature, Object value) protected abstract voidinitValues(EStructuralFeature[] allPersistentFeatures) booleanisEmpty(EStructuralFeature feature) booleanisFrozen()booleanbooleanintlastIndexOf(EStructuralFeature feature, Object value) voidmerge(CDORevisionDelta delta) move(EStructuralFeature feature, int targetIndex, int sourceIndex) voidread(CDODataInput in) protected voidbooleanreadValue(CDODataInput in, EClass owner, EStructuralFeature feature, int i, boolean unchunked) booleanstatic Objectremove(EStructuralFeature feature, int index) set(EStructuralFeature feature, int index, Object value) voidsetBranchPoint(CDOBranchPoint branchPoint) voidsetContainerFeatureID(int containingFeatureID) voidsetContainerID(Object containerID) voidsetContainingFeatureID(int containerFeatureID) Deprecated.voidvoidsetList(EStructuralFeature feature, InternalCDOList list) voidThe default behavior of a revision for calls to theInternalCDORevision.clear(EStructuralFeature)andInternalCDORevision.unset(EStructuralFeature)methods is to set the feature's value to null (discarding the value itself, a List).voidsetPermission(CDOPermission permission) voidsetResourceID(CDOID resourceID) voidsetRevised(long revised) voidDeprecated.Compatibility no-op.protected voidsetValue(EStructuralFeature feature, Object value) voidsetVersion(int version) intsize(EStructuralFeature feature) Object[]toArray(EStructuralFeature feature) <T> T[]toArray(EStructuralFeature feature, T[] array) voidunfreeze()voidunset(EStructuralFeature feature) voidwrite(CDODataOutput out, int referenceChunk) voidwrite(CDODataOutput out, int referenceChunk, CDOBranchPoint securityContext) protected voidvoidwriteValue(CDODataOutput out, EClass owner, EStructuralFeature feature, int i, int referenceChunk) voidwriteValues(CDODataOutput out, int referenceChunk) Methods inherited from class org.eclipse.emf.cdo.spi.common.revision.AbstractCDORevision
accept, accept, accept, adjustForCommit, data, equals, getAllPersistentFeatures, getClassInfo, getEClass, getFeatureIndex, getList, getList, getProperRevision, getRevisionForID, getUnloadedCount, hashCode, initClassInfo, isHistorical, isReadable, isResource, isResourceFolder, isResourceNode, isValid, isValid, isWritable, revision, toString, unloadedCountChangedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.emf.cdo.common.revision.CDORevisionData
calculateContainerReferenceID, calculateContainingReferenceID, getContainingReferenceMethods inherited from interface org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision
copy, setContainingReference
-
Constructor Details
-
BaseCDORevision
- Since:
- 3.0
-
BaseCDORevision
-
-
Method Details
-
read
- Throws:
IOException- Since:
- 3.0
-
readSystemValues
- Throws:
IOException- Since:
- 4.0
-
readValues
- Throws:
IOException- Since:
- 4.3
-
readValue
public boolean readValue(CDODataInput in, EClass owner, EStructuralFeature feature, int i, boolean unchunked) throws IOException - Throws:
IOException- Since:
- 4.26
-
write
- Throws:
IOException- Since:
- 4.0
-
write
public void write(CDODataOutput out, int referenceChunk, CDOBranchPoint securityContext) throws IOException - Throws:
IOException- Since:
- 4.1
-
writeSystemValues
- Throws:
IOException- Since:
- 4.0
-
writeValues
- Throws:
IOException- Since:
- 4.3
-
writeValue
public void writeValue(CDODataOutput out, EClass owner, EStructuralFeature feature, int i, int referenceChunk) throws IOException - Throws:
IOException- Since:
- 4.26
-
convertEObjects
- Since:
- 3.0
- See Also:
-
getID
-
setID
-
getBranch
Description copied from interface:CDOBranchVersionReturns the branch of this branch version.- Since:
- 4.2
-
getTimeStamp
public long getTimeStamp()Description copied from interface:CDOBranchPointReturns the time stamp of this branch point, or the fixed special time stampunspecifiedif this branch point marks theheadof a branch.- Since:
- 3.0
-
setBranchPoint
- Since:
- 3.0
-
getVersion
public int getVersion()Description copied from interface:CDOBranchVersionReturns the version number of this branch version. -
setVersion
public void setVersion(int version) -
getRevised
public long getRevised() -
setRevised
public void setRevised(long revised) -
compare
-
merge
-
getResourceID
-
setResourceID
-
getContainerID
-
setContainerID
-
getContainerFeatureID
public int getContainerFeatureID()Description copied from interface:CDORevisionDataReturns the container feature ID. If the container isn't a navigable feature, this will be a negative ID indicating the inverse of the containment feature's ID.Provides the input to the calculation of the feature in the container revision that actually holds this revision.
Usage Example:
CDORevision revision = ...; CDORevision container = Util.getRevision(revision.data().getContainerID()); int containerFeatureID = revision.data().getContainerFeatureID(); EStructuralFeature feature = containerFeatureID <= InternalEObject.EOPPOSITE_FEATURE_BASE ? container.getEClass().getEStructuralFeature(InternalEObject.EOPPOSITE_FEATURE_BASE - containerFeatureID) : ((EReference)revision.getEClass().getEStructuralFeature(containerFeatureID)).getEOpposite();- Returns:
- the container feature ID.
- Since:
- 4.27
- See Also:
-
setContainerFeatureID
public void setContainerFeatureID(int containingFeatureID) - Since:
- 4.27
-
hashCode
-
get
-
contains
-
indexOf
-
lastIndexOf
-
isEmpty
-
size
-
toArray
-
toArray
- Type Parameters:
T- the array element type
-
add
-
clear
-
move
-
remove
-
set
-
unset
-
adjustReferences
- Since:
- 4.0
-
adjustBranches
- Since:
- 4.3
-
getValue
Description copied from interface:CDORevisionDataShould never returnCDORevisionData.NIL -
setValue
-
getListOrNull
- Since:
- 4.7
-
getOrCreateList
Description copied from interface:InternalCDORevisionSame asgetOrCreateList(feature, 0).Warning: Must be used with caution because list creation for an
unsettablefeature implies a transition from UNSET to SET! -
getOrCreateList
Description copied from interface:InternalCDORevisionReturns the list that represents the passed feature, possibly creates it if needed.Warning: Must be used with caution because list creation for an
unsettablefeature implies a transition from UNSET to SET!- Parameters:
size- the initialCapacity of a new list to be created if this revision has no list so far (its size will always be 0), or -1 to skip list creation and returnnullin this case.- See Also:
-
constructList
Description copied from interface:InternalCDORevisionConstructs a new many-valued feature list for revision loading. UnlikeInternalCDORevision.getOrCreateList(EStructuralFeature, int), this operation never reuses an existing value and creates the requested logical size with internal construction slots. -
constructList
Description copied from interface:InternalCDORevisionConstructs a list for a DB read with the given initial chunk size.- Parameters:
feature- the many-valued featuresize- the logical list sizeinitialChunk- the number of values requested by the read, orCDORevision.UNCHUNKEDfor a full read- Returns:
- the newly constructed list
-
setList
-
clearValues
- Since:
- 4.2
-
getResourceNodeName
- Since:
- 4.3
-
getPermission
- Since:
- 4.1
-
setPermission
- Since:
- 4.1
-
bypassPermissionChecks
public boolean bypassPermissionChecks(boolean on) Description copied from interface:InternalCDORevisionEnables or disables permission checking for this revision.This method is used on the client side if the framework changes the revision on another user's behalf, e.g., during invalidation or general revision copying. It's safe to offer this method on the client side because the server is always the permission checking authority (during load or commit).
- Since:
- 4.3
-
isListPreserving
public boolean isListPreserving()- Since:
- 4.3
-
setListPreserving
public void setListPreserving()Description copied from interface:InternalCDORevisionThe default behavior of a revision for calls to theInternalCDORevision.clear(EStructuralFeature)andInternalCDORevision.unset(EStructuralFeature)methods is to set the feature's value to null (discarding the value itself, a List). By calling thisInternalCDORevision.setListPreserving()method the default behavior is changed; instead of setting the feature's value to null, theList.clear()method is called on the feature's list instance.- Since:
- 4.3
-
freeze
public void freeze()- Since:
- 4.1
-
unfreeze
public void unfreeze()- Since:
- 4.11
-
isFrozen
public boolean isFrozen()- Since:
- 4.2
-
isUnchunked
public boolean isUnchunked()- Since:
- 4.1
-
setUnchunked
Deprecated.Compatibility no-op. Loaded state is derived from list contents.- Since:
- 4.1
-
getValue
-
setValue
-
initValues
-
doGetValue
- Since:
- 4.1
-
doSetValue
- Since:
- 4.1
-
remapID
-
formatFlags
- Since:
- 4.3
-
checkNoFeatureMap
Deprecated.As of 4.5feature mapsare no longer supported. -
getContainingFeatureID
Deprecated. -
setContainingFeatureID
Deprecated.
-
feature mapsare no longer supported.