Interface CDORevisionManager
-
- All Superinterfaces:
org.eclipse.net4j.util.event.INotifier
- All Known Subinterfaces:
InternalCDORevisionManager
- All Known Implementing Classes:
DelegatingCDORevisionManager
public interface CDORevisionManager extends org.eclipse.net4j.util.event.INotifierProvides access torevisionsin a CDOrepositoryby demand loading and caching them.Revisions are generally queried by:
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
sessionor to the backend store if it is contained by arepository.- Since:
- 3.0
- Author:
- Eike Stepper
- No Implement
- This interface is not intended to be implemented by clients.
- No Extend
- This interface is not intended to be extended by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontainsRevision(CDOID id, CDOBranchPoint branchPoint)Returnstrueif therevision cachecontains arevisionwith the givenIDat the givenbranch point(branch + timestamp),falseotherwise.booleancontainsRevisionByVersion(CDOID id, CDOBranchVersion branchVersion)Returnstrueif therevision cachecontains arevisionwith the givenIDat the givenbranch version(branch + version),falseotherwise.CDOBranchPointRangegetObjectLifetime(CDOID id, CDOBranchPoint branchPoint)org.eclipse.emf.ecore.EClassgetObjectType(CDOID id)Returns thetypeof an object if a revision for that object is in the revision cache,nullotherwise.org.eclipse.emf.ecore.EClassgetObjectType(CDOID id, CDOBranchManager branchManagerForLoadOnDemand)Returns thetypeof an object.CDORevisiongetRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)Returns therevisionwith the givenIDat the givenbranch point(branch + timestamp), optionally demand loading it if it is not already in thecache.CDORevisiongetRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk, boolean loadOnDemand)Returns therevisionwith the givenIDat the givenbranch version(branch + version), optionally demand loading it if it is not already in thecache.java.util.List<CDORevision>getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)Returns therevisionswith the givenIDsat the givenbranch point(branch + timestamp), optionally demand loading them if they are not already in thecache.java.util.List<CDORevision>getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, java.util.List<CDORevision> additionalRevisions)Returns therevisionswith the givenIDsat the givenbranch point(branch + timestamp), optionally demand loading them if they are not already in thecache.voidhandleRevisions(org.eclipse.emf.ecore.EClass eClass, CDOBranch branch, boolean exactBranch, long timeStamp, boolean exactTime, CDORevisionHandler handler)
-
-
-
Method Detail
-
getObjectType
org.eclipse.emf.ecore.EClass getObjectType(CDOID id)
Returns thetypeof an object if a revision for that object is in the revision cache,nullotherwise.Same as calling
getObjectType(id, null).- See Also:
EObject.eClass(),getObjectType(CDOID, CDOBranchManager)
-
getObjectType
org.eclipse.emf.ecore.EClass getObjectType(CDOID id, CDOBranchManager branchManagerForLoadOnDemand)
Returns thetypeof an object.If no revision for that object is found in the revision cache the following is tried:
- If
branchManagerForLoadOnDemandis notnullthe first revision of the object in the main branch is loaded from the server and its type is returned. - Otherwise (i.e., if
branchManagerForLoadOnDemandisnullor the object does not exist)nullis returned.
A
branch manageris required instead of just a boolean value to specify whether to demand-load or not because this revision manager must be able to access themain branchwhile demand-loading.- Since:
- 4.1
- See Also:
EObject.eClass(),getObjectType(CDOID)
- If
-
containsRevision
boolean containsRevision(CDOID id, CDOBranchPoint branchPoint)
Returnstrueif therevision cachecontains arevisionwith the givenIDat the givenbranch point(branch + timestamp),falseotherwise.
-
getRevision
CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)
Returns therevisionwith the givenIDat the givenbranch point(branch + timestamp), optionally demand loading it if it is not already in thecache.- Parameters:
referenceChunk- The number of targetIDsto load for each many-valued reference in the returned revision, orCDORevision.UNCHUNKEDfor all such list elements (IDs).prefetchDepth- The number of nested containment levels to load revisions for in one round trip. Use the symbolic constantsCDORevision.DEPTH_INFINITEto prefetch all contained revisions orCDORevision.DEPTH_NONEto not prefetch anything. Only the explicitly 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.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 ornullis returned.- See Also:
getRevisions(List, CDOBranchPoint, int, int, boolean),getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
-
getRevisions
java.util.List<CDORevision> getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)
Returns therevisionswith the givenIDsat the givenbranch point(branch + timestamp), optionally demand loading them if they are not already in thecache.- Parameters:
referenceChunk- The number of targetIDsto load for each many-valued reference in the returned revisions, orCDORevision.UNCHUNKEDfor all such list elements (IDs).prefetchDepth- The number of nested containment levels to load revisions for in one round trip. Use the symbolic constantsCDORevision.DEPTH_INFINITEto prefetch all contained revisions orCDORevision.DEPTH_NONEto not prefetch anything. Only the explicitly 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.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 ornullis placed in the list that is returned.- See Also:
getRevision(CDOID, CDOBranchPoint, int, int, boolean)
-
getRevisions
java.util.List<CDORevision> getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, java.util.List<CDORevision> additionalRevisions)
Returns therevisionswith the givenIDsat the givenbranch point(branch + timestamp), optionally demand loading them if they are not already in thecache.- Parameters:
referenceChunk- The number of targetIDsto load for each many-valued reference in the returned revisions, orCDORevision.UNCHUNKEDfor all such list elements (IDs).prefetchDepth- The number of nested containment levels to load revisions for in one round trip. Use the symbolic constantsCDORevision.DEPTH_INFINITEto prefetch all contained revisions orCDORevision.DEPTH_NONEto not prefetch anything. Only the explicitly 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.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 ornullis placed in the list that is returned.additionalRevisions- If non-null, a list to add additionally prefetched revisions to.- Since:
- 4.15
- See Also:
getRevision(CDOID, CDOBranchPoint, int, int, boolean)
-
containsRevisionByVersion
boolean containsRevisionByVersion(CDOID id, CDOBranchVersion branchVersion)
Returnstrueif therevision cachecontains arevisionwith the givenIDat the givenbranch version(branch + version),falseotherwise.
-
getRevisionByVersion
CDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk, boolean loadOnDemand)
Returns therevisionwith the givenIDat the givenbranch version(branch + version), optionally demand loading it if it is not already in thecache.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.
- Parameters:
referenceChunk- The number of targetIDsto load for each many-valued reference in the returned revision, orCDORevision.UNCHUNKEDfor all such list elements (IDs).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 ornullis returned.- See Also:
getRevision(CDOID, CDOBranchPoint, int, int, boolean)
-
getObjectLifetime
CDOBranchPointRange getObjectLifetime(CDOID id, CDOBranchPoint branchPoint)
- Since:
- 4.4
-
handleRevisions
void handleRevisions(org.eclipse.emf.ecore.EClass eClass, CDOBranch branch, boolean exactBranch, long timeStamp, boolean exactTime, CDORevisionHandler handler)- Since:
- 4.3
-
-