Class DelegatingCDORevision
- java.lang.Object
-
- org.eclipse.emf.cdo.spi.common.revision.DelegatingCDORevision
-
- All Implemented Interfaces:
CDOBranchPoint,CDOBranchProvider,CDOBranchVersion,CDOIdentifiable,CDOIDAndVersion,CDORevisable,CDORevision,CDORevisionData,CDORevisionKey,CDOTimeProvider,CDOVersionProvider,CDOBranchAdjustable,CDOReferenceAdjustable,InternalCDORevision
public abstract class DelegatingCDORevision extends java.lang.Object implements InternalCDORevision
If the meaning of this type isn't clear, there really should be more of a description here...- Since:
- 3.0
- Author:
- Eike Stepper
-
-
Field Summary
-
Fields inherited from interface org.eclipse.emf.cdo.common.branch.CDOBranchPoint
INVALID_DATE, UNSPECIFIED_DATE
-
Fields inherited from interface org.eclipse.emf.cdo.common.branch.CDOBranchVersion
UNSPECIFIED_VERSION
-
Fields inherited from interface org.eclipse.emf.cdo.common.revision.CDORevision
DEPTH_INFINITE, DEPTH_NONE, FIRST_VERSION, MAIN_BRANCH_ID, PERMISSION_PROVIDER, UNCHUNKED
-
Fields inherited from interface org.eclipse.emf.cdo.common.revision.CDORevisionData
NIL
-
Fields inherited from interface org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision
DO_NOT_CREATE_LIST
-
-
Constructor Summary
Constructors Constructor Description DelegatingCDORevision()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccept(CDORevisionValueVisitor visitor)voidaccept(CDORevisionValueVisitor visitor, java.util.function.Predicate<org.eclipse.emf.ecore.EStructuralFeature> filter)voidaccept(CDORevisionValueVisitor visitor, org.eclipse.net4j.util.Predicate<org.eclipse.emf.ecore.EStructuralFeature> filter)Deprecated.voidadd(org.eclipse.emf.ecore.EStructuralFeature feature, int index, java.lang.Object value)voidadjustBranches(CDOBranchManager newBranchManager)voidadjustForCommit(CDOBranch branch, long timeStamp)booleanadjustReferences(CDOReferenceAdjuster referenceAdjuster)booleanbypassPermissionChecks(boolean on)Enables or disables permission checking for this revision.voidclear(org.eclipse.emf.ecore.EStructuralFeature feature)org.eclipse.emf.ecore.EStructuralFeature[]clearValues()InternalCDORevisionDeltacompare(CDORevision origin)booleancontains(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)voidconvertEObjects(CDOIDProvider oidProvider)InternalCDORevisioncopy()CDORevisionDatadata()voidfreeze()java.lang.Objectget(org.eclipse.emf.ecore.EStructuralFeature feature, int index)InternalCDOBranchgetBranch()Returns the branch of this branch version.InternalCDOClassInfogetClassInfo()java.lang.ObjectgetContainerID()intgetContainingFeatureID()Provides the input to the calculation of the feature in the container revision that actually holds this revision.abstract InternalCDORevisiongetDelegate()org.eclipse.emf.ecore.EClassgetEClass()CDOIDgetID()CDOListgetList(org.eclipse.emf.ecore.EStructuralFeature feature)Deprecated.CDOListgetList(org.eclipse.emf.ecore.EStructuralFeature feature, int initialCapacity)Deprecated.CDOListgetListOrNull(org.eclipse.emf.ecore.EStructuralFeature feature)CDOListgetOrCreateList(org.eclipse.emf.ecore.EStructuralFeature feature)Same asgetOrCreateList(feature, 0).CDOListgetOrCreateList(org.eclipse.emf.ecore.EStructuralFeature feature, int size)Returns the list that represents the passed feature, possibly creates it if needed.CDOPermissiongetPermission()InternalCDORevisiongetProperRevision()CDOIDgetResourceID()java.lang.StringgetResourceNodeName()longgetRevised()InternalCDORevisiongetRevisionForID(CDOID id)longgetTimeStamp()Returns the time stamp of this branch point, or the fixed special time stampunspecifiedif this branch point marks theheadof a branch.java.lang.ObjectgetValue(org.eclipse.emf.ecore.EStructuralFeature feature)Should never returnCDORevisionData.NILintgetVersion()Returns the version number of this branch version.inthashCode(org.eclipse.emf.ecore.EStructuralFeature feature)intindexOf(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)booleanisEmpty(org.eclipse.emf.ecore.EStructuralFeature feature)booleanisFrozen()booleanisHistorical()Returnstrueexactly ifCDOBranchPoint.getTimeStamp()does not returnCDOBranchPoint.UNSPECIFIED_DATE,falseotherwise.booleanisListPreserving()booleanisReadable()booleanisResource()booleanisResourceFolder()booleanisResourceNode()booleanisUnchunked()booleanisValid(long timeStamp)booleanisValid(CDOBranchPoint branchPoint)booleanisWritable()intlastIndexOf(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)voidmerge(CDORevisionDelta delta)java.lang.Objectmove(org.eclipse.emf.ecore.EStructuralFeature feature, int targetIndex, int sourceIndex)voidread(CDODataInput in)booleanreadValues(CDODataInput in)java.lang.Objectremove(org.eclipse.emf.ecore.EStructuralFeature feature, int index)CDORevisionrevision()java.lang.Objectset(org.eclipse.emf.ecore.EStructuralFeature feature, int index, java.lang.Object value)voidsetBranchPoint(CDOBranchPoint branchPoint)voidsetContainerID(java.lang.Object containerID)voidsetContainingFeatureID(int containingFeatureID)voidsetID(CDOID id)voidsetList(org.eclipse.emf.ecore.EStructuralFeature feature, InternalCDOList list)voidsetListPreserving()The 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)voidsetUnchunked()java.lang.ObjectsetValue(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)voidsetVersion(int version)intsize(org.eclipse.emf.ecore.EStructuralFeature feature)java.lang.Object[]toArray(org.eclipse.emf.ecore.EStructuralFeature feature)<T> T[]toArray(org.eclipse.emf.ecore.EStructuralFeature feature, T[] array)voidunset(org.eclipse.emf.ecore.EStructuralFeature feature)voidwrite(CDODataOutput out, int referenceChunk)voidwrite(CDODataOutput out, int referenceChunk, CDOBranchPoint securityContext)voidwriteValues(CDODataOutput out, int referenceChunk)
-
-
-
Method Detail
-
getDelegate
public abstract InternalCDORevision getDelegate()
-
getRevisionForID
public InternalCDORevision getRevisionForID(CDOID id)
- Specified by:
getRevisionForIDin interfaceInternalCDORevision- Since:
- 4.2
-
getProperRevision
public InternalCDORevision getProperRevision()
- Specified by:
getProperRevisionin interfaceInternalCDORevision- Since:
- 4.2
-
adjustReferences
public boolean adjustReferences(CDOReferenceAdjuster referenceAdjuster)
- Specified by:
adjustReferencesin interfaceCDOReferenceAdjustable- Since:
- 4.0
-
adjustBranches
public void adjustBranches(CDOBranchManager newBranchManager)
- Specified by:
adjustBranchesin interfaceCDOBranchAdjustable- Since:
- 4.3
-
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.- Specified by:
getTimeStampin interfaceCDOBranchPoint- Specified by:
getTimeStampin interfaceCDOTimeProvider
-
getBranch
public InternalCDOBranch getBranch()
Description copied from interface:CDOBranchVersionReturns the branch of this branch version.- Specified by:
getBranchin interfaceCDOBranchPoint- Specified by:
getBranchin interfaceCDOBranchProvider- Specified by:
getBranchin interfaceCDOBranchVersion- Specified by:
getBranchin interfaceInternalCDORevision- Since:
- 4.2
-
isHistorical
public boolean isHistorical()
Description copied from interface:CDORevisionReturnstrueexactly ifCDOBranchPoint.getTimeStamp()does not returnCDOBranchPoint.UNSPECIFIED_DATE,falseotherwise.- Specified by:
isHistoricalin interfaceCDORevision
-
getID
public CDOID getID()
- Specified by:
getIDin interfaceCDOIdentifiable
-
revision
public CDORevision revision()
- Specified by:
revisionin interfaceCDORevisionData
-
getResourceID
public CDOID getResourceID()
- Specified by:
getResourceIDin interfaceCDORevisionData
-
getContainerID
public java.lang.Object getContainerID()
- Specified by:
getContainerIDin interfaceCDORevisionData
-
getContainingFeatureID
public int getContainingFeatureID()
Description copied from interface:CDORevisionDataProvides 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 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();- Specified by:
getContainingFeatureIDin interfaceCDORevisionData- See Also:
BasicEObjectImpl.eContainingFeature(),CDORevisionData.getContainerID()
-
get
public java.lang.Object get(org.eclipse.emf.ecore.EStructuralFeature feature, int index)- Specified by:
getin interfaceCDORevisionData
-
getEClass
public org.eclipse.emf.ecore.EClass getEClass()
- Specified by:
getEClassin interfaceCDORevision
-
getVersion
public int getVersion()
Description copied from interface:CDOBranchVersionReturns the version number of this branch version.- Specified by:
getVersionin interfaceCDOBranchVersion- Specified by:
getVersionin interfaceCDOIDAndVersion- Specified by:
getVersionin interfaceCDOVersionProvider
-
size
public int size(org.eclipse.emf.ecore.EStructuralFeature feature)
- Specified by:
sizein interfaceCDORevisionData
-
getRevised
public long getRevised()
- Specified by:
getRevisedin interfaceCDORevisable
-
isEmpty
public boolean isEmpty(org.eclipse.emf.ecore.EStructuralFeature feature)
- Specified by:
isEmptyin interfaceCDORevisionData
-
isValid
public boolean isValid(long timeStamp)
- Specified by:
isValidin interfaceCDORevision
-
isValid
public boolean isValid(CDOBranchPoint branchPoint)
- Specified by:
isValidin interfaceCDORevision- Since:
- 4.0
-
copy
public InternalCDORevision copy()
- Specified by:
copyin interfaceCDORevision- Specified by:
copyin interfaceInternalCDORevision- Since:
- 4.0
-
getClassInfo
public InternalCDOClassInfo getClassInfo()
- Specified by:
getClassInfoin interfaceCDORevision- Specified by:
getClassInfoin interfaceInternalCDORevision- Since:
- 4.2
-
setID
public void setID(CDOID id)
- Specified by:
setIDin interfaceInternalCDORevision
-
contains
public boolean contains(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)- Specified by:
containsin interfaceCDORevisionData
-
isResourceNode
public boolean isResourceNode()
- Specified by:
isResourceNodein interfaceCDORevision
-
setVersion
public void setVersion(int version)
- Specified by:
setVersionin interfaceInternalCDORevision
-
isResourceFolder
public boolean isResourceFolder()
- Specified by:
isResourceFolderin interfaceCDORevision
-
indexOf
public int indexOf(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)- Specified by:
indexOfin interfaceCDORevisionData
-
isResource
public boolean isResource()
- Specified by:
isResourcein interfaceCDORevision
-
setBranchPoint
public void setBranchPoint(CDOBranchPoint branchPoint)
- Specified by:
setBranchPointin interfaceInternalCDORevision
-
adjustForCommit
public void adjustForCommit(CDOBranch branch, long timeStamp)
- Specified by:
adjustForCommitin interfaceInternalCDORevision
-
data
public CDORevisionData data()
- Specified by:
datain interfaceCDORevision
-
lastIndexOf
public int lastIndexOf(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)- Specified by:
lastIndexOfin interfaceCDORevisionData
-
setRevised
public void setRevised(long revised)
- Specified by:
setRevisedin interfaceInternalCDORevision
-
compare
public InternalCDORevisionDelta compare(CDORevision origin)
- Specified by:
comparein interfaceCDORevision- Specified by:
comparein interfaceInternalCDORevision
-
setResourceID
public void setResourceID(CDOID resourceID)
- Specified by:
setResourceIDin interfaceInternalCDORevision
-
merge
public void merge(CDORevisionDelta delta)
- Specified by:
mergein interfaceCDORevision
-
toArray
public <T> T[] toArray(org.eclipse.emf.ecore.EStructuralFeature feature, T[] array)- Specified by:
toArrayin interfaceCDORevisionData
-
setContainerID
public void setContainerID(java.lang.Object containerID)
- Specified by:
setContainerIDin interfaceInternalCDORevision
-
setContainingFeatureID
public void setContainingFeatureID(int containingFeatureID)
- Specified by:
setContainingFeatureIDin interfaceInternalCDORevision
-
toArray
public java.lang.Object[] toArray(org.eclipse.emf.ecore.EStructuralFeature feature)
- Specified by:
toArrayin interfaceCDORevisionData
-
add
public void add(org.eclipse.emf.ecore.EStructuralFeature feature, int index, java.lang.Object value)- Specified by:
addin interfaceInternalCDORevision
-
hashCode
public int hashCode(org.eclipse.emf.ecore.EStructuralFeature feature)
- Specified by:
hashCodein interfaceCDORevisionData
-
clear
public void clear(org.eclipse.emf.ecore.EStructuralFeature feature)
- Specified by:
clearin interfaceInternalCDORevision
-
move
public java.lang.Object move(org.eclipse.emf.ecore.EStructuralFeature feature, int targetIndex, int sourceIndex)- Specified by:
movein interfaceInternalCDORevision
-
remove
public java.lang.Object remove(org.eclipse.emf.ecore.EStructuralFeature feature, int index)- Specified by:
removein interfaceInternalCDORevision
-
set
public java.lang.Object set(org.eclipse.emf.ecore.EStructuralFeature feature, int index, java.lang.Object value)- Specified by:
setin interfaceInternalCDORevision
-
unset
public void unset(org.eclipse.emf.ecore.EStructuralFeature feature)
- Specified by:
unsetin interfaceInternalCDORevision
-
getValue
public java.lang.Object getValue(org.eclipse.emf.ecore.EStructuralFeature feature)
Description copied from interface:InternalCDORevisionShould never returnCDORevisionData.NIL- Specified by:
getValuein interfaceInternalCDORevision
-
setValue
public java.lang.Object setValue(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)- Specified by:
setValuein interfaceInternalCDORevision
-
setList
public void setList(org.eclipse.emf.ecore.EStructuralFeature feature, InternalCDOList list)- Specified by:
setListin interfaceInternalCDORevision
-
getList
@Deprecated public CDOList getList(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.- Specified by:
getListin interfaceInternalCDORevision
-
getList
@Deprecated public CDOList getList(org.eclipse.emf.ecore.EStructuralFeature feature, int initialCapacity)
Deprecated.- Specified by:
getListin interfaceInternalCDORevision
-
getListOrNull
public CDOList getListOrNull(org.eclipse.emf.ecore.EStructuralFeature feature)
- Specified by:
getListOrNullin interfaceInternalCDORevision
-
getOrCreateList
public CDOList getOrCreateList(org.eclipse.emf.ecore.EStructuralFeature feature)
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!- Specified by:
getOrCreateListin interfaceInternalCDORevision
-
getOrCreateList
public CDOList getOrCreateList(org.eclipse.emf.ecore.EStructuralFeature feature, int size)
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!- Specified by:
getOrCreateListin interfaceInternalCDORevisionsize- 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:
InternalCDORevision.DO_NOT_CREATE_LIST
-
read
public void read(CDODataInput in) throws java.io.IOException
- Specified by:
readin interfaceInternalCDORevision- Throws:
java.io.IOException
-
readValues
public boolean readValues(CDODataInput in) throws java.io.IOException
- Specified by:
readValuesin interfaceInternalCDORevision- Throws:
java.io.IOException- Since:
- 4.3
-
write
public void write(CDODataOutput out, int referenceChunk) throws java.io.IOException
- Specified by:
writein interfaceInternalCDORevision- Throws:
java.io.IOException
-
write
public void write(CDODataOutput out, int referenceChunk, CDOBranchPoint securityContext) throws java.io.IOException
- Specified by:
writein interfaceInternalCDORevision- Throws:
java.io.IOException- Since:
- 4.1
-
writeValues
public void writeValues(CDODataOutput out, int referenceChunk) throws java.io.IOException
- Specified by:
writeValuesin interfaceInternalCDORevision- Throws:
java.io.IOException- Since:
- 4.3
-
convertEObjects
public void convertEObjects(CDOIDProvider oidProvider)
- Specified by:
convertEObjectsin interfaceInternalCDORevision
-
clearValues
public org.eclipse.emf.ecore.EStructuralFeature[] clearValues()
- Specified by:
clearValuesin interfaceInternalCDORevision- Since:
- 4.2
-
getResourceNodeName
public java.lang.String getResourceNodeName()
- Specified by:
getResourceNodeNamein interfaceInternalCDORevision- Since:
- 4.3
-
getPermission
public CDOPermission getPermission()
- Specified by:
getPermissionin interfaceCDORevision- Since:
- 4.1
-
setPermission
public void setPermission(CDOPermission permission)
- Specified by:
setPermissionin interfaceInternalCDORevision- Since:
- 4.1
-
isReadable
public boolean isReadable()
- Specified by:
isReadablein interfaceCDORevision- Since:
- 4.1
-
isWritable
public boolean isWritable()
- Specified by:
isWritablein interfaceCDORevision- Since:
- 4.1
-
accept
public void accept(CDORevisionValueVisitor visitor)
- Specified by:
acceptin interfaceCDORevisionData- Since:
- 4.2
-
accept
@Deprecated public void accept(CDORevisionValueVisitor visitor, org.eclipse.net4j.util.Predicate<org.eclipse.emf.ecore.EStructuralFeature> filter)
Deprecated.- Specified by:
acceptin interfaceCDORevisionData- Since:
- 4.2
-
accept
public void accept(CDORevisionValueVisitor visitor, java.util.function.Predicate<org.eclipse.emf.ecore.EStructuralFeature> filter)
- Specified by:
acceptin interfaceCDORevisionData- Since:
- 4.2
-
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).
- Specified by:
bypassPermissionChecksin interfaceInternalCDORevision- Since:
- 4.3
-
isListPreserving
public boolean isListPreserving()
- Specified by:
isListPreservingin interfaceInternalCDORevision- 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.- Specified by:
setListPreservingin interfaceInternalCDORevision- Since:
- 4.3
-
freeze
public void freeze()
- Specified by:
freezein interfaceInternalCDORevision- Since:
- 4.0
-
isFrozen
public boolean isFrozen()
- Specified by:
isFrozenin interfaceInternalCDORevision- Since:
- 4.2
-
isUnchunked
public boolean isUnchunked()
- Specified by:
isUnchunkedin interfaceInternalCDORevision- Since:
- 4.1
-
setUnchunked
public void setUnchunked()
- Specified by:
setUnchunkedin interfaceInternalCDORevision- Since:
- 4.1
-
-