Class CDOPushTransaction
- All Implemented Interfaces:
IAdaptable,CDOBranchPoint,CDOBranchProvider,CDOCommonTransaction,CDOCommonView,CDOChangeSetDataProvider,CDOCommitHistory.Provider<CDOObject,,CDOObjectHistory> CDORevisionProvider,CDOTimeProvider,CDOTransaction,CDOUserTransaction,CDOUpdatable,CDOView,org.eclipse.net4j.util.collection.Closeable,org.eclipse.net4j.util.container.IContainer<CDOResourceNode>,org.eclipse.net4j.util.event.INotifier,org.eclipse.net4j.util.event.INotifier.INotifier2,org.eclipse.net4j.util.options.IOptionsContainer,org.eclipse.net4j.util.properties.IPropertiesContainer
transaction that persists changes to the object graph locally on commit and can later load
these changes and push them to the repository.- Since:
- 3.0
- Author:
- Eike Stepper
- No Extend
- This interface is not intended to be extended by clients.
- No Instantiate
- This class is not intended to be instantiated by clients.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.transaction.CDOTransaction
CDOTransaction.CommitResult<T>, CDOTransaction.OptionsNested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer
org.eclipse.net4j.util.container.IContainer.Modifiable<E extends Object>, org.eclipse.net4j.util.container.IContainer.Persistable<E extends Object>, org.eclipse.net4j.util.container.IContainer.Persistence<E extends Object>Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2 -
Field Summary
Fields inherited from interface org.eclipse.emf.cdo.common.branch.CDOBranchPoint
INVALID_DATE, UNSPECIFIED_DATEFields inherited from interface org.eclipse.emf.cdo.util.CDOUpdatable
NO_TIMEOUTFields inherited from interface org.eclipse.emf.cdo.view.CDOView
PROP_LIFECYCLE_EXCEPTION_HANDLER, PROP_TIME_MACHINE_DISABLED -
Constructor Summary
ConstructorsConstructorDescriptionCDOPushTransaction(CDOTransaction delegate) CDOPushTransaction(CDOTransaction delegate, File file) CDOPushTransaction(CDOTransaction delegate, File file, boolean reconstructSavepoints) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(org.eclipse.net4j.util.event.IListener listener) voidaddObjectHandler(CDOObjectHandler handler) voidvoidvoidclose()commit()Same ascommit(null).commit(Runnable runnable, int attempts, IProgressMonitor monitor) commit(Runnable runnable, Predicate<Long> retry, IProgressMonitor monitor) commit(Runnable runnable, org.eclipse.net4j.util.Predicate<Long> retry, IProgressMonitor monitor) Deprecated.<T> CDOTransaction.CommitResult<T>commit(Callable<T> callable, int attempts, IProgressMonitor monitor) <T> CDOTransaction.CommitResult<T>commit(Callable<T> callable, Predicate<Long> retry, IProgressMonitor monitor) <T> CDOTransaction.CommitResult<T>commit(Callable<T> callable, org.eclipse.net4j.util.Predicate<Long> retry, IProgressMonitor monitor) Deprecated.commit(IProgressMonitor monitor) Commits the modifications of this transaction to the repository and returns acommit infoobject if successful.commitAndClose(IProgressMonitor monitor, boolean keepOpenAfterCommitProblem) compareRevisions(CDOBranchPoint source) createBinaryResource(String path) createQuery(String language, String queryString) Same ascreateQuery(language, queryString, null).createQuery(String language, String queryString, boolean considerDirtyState) createQuery(String language, String queryString, Object context) createQuery(String language, String queryString, Object context, boolean considerDirtyState) createResource(String path) createResourceFolder(String path) createResourceURI(String path) Returns aURIthat can be used inResourceSet.getResource(URI, boolean)to load the resource with the specified path.static FilecreateTempFile(CDOTransaction transaction) createTextResource(String path) voiddisableDurableLocking(boolean releaseLocks) Disables the storage of all information that's needed toreopenthis view at a later point in time.Enables the storage of all information that's needed toreopenthis view at a later point in time.enableDurableLocking(boolean enable) Deprecated.getAdapter(Class adapter) getBinaryResource(String path) Returns the branch of this branch point, ornullif this branch point is thebaseof themain branch.Returns the comment to be used in the next commit operation.Returns the set of objects that are conflicting with remote modifications or an empty set ifCDOTransaction.hasConflict()returnsfalse.getFile()getHistory(CDOObject object) longlongReturns the time stamp of the last commit operation.org.eclipse.net4j.util.event.IListener[]getLockStates(Collection<CDOID> ids) Get an array oflock statescorresponding to the specified collection ofids.getLockStates(Collection<CDOID> ids, boolean loadOnDemand) Get an array oflock statescorresponding to the specified collection ofids.getLockStatesOfObjects(Collection<? extends CDOObject> objects) Get an array oflock statescorresponding to the specified collection ofobjects.Returns the object for the given CDOID.Returns the object for the given CDOID.<T extends EObject>
TgetObject(T objectFromDifferentView) Takes an object from a (possibly) different view and contextifies it for the usage with this view.getObjects(Collection<CDOID> ids) Returns the objects with the given CDOIDs.getOrCreateResource(String path) Returns theproviderthat has opened this view.getResource(String path) Same asgetResource(String, true).getResource(String path, boolean loadOnDemand) getResourceFolder(String path) getResourceNode(String path) Returns the resource node with the given path.Returns theresource setthis view is associated with.getRevision(CDOID id) Returns the root resource of the repository.Returns thesessionthis view was opened by.intgetTextResource(String path) longReturns the time stamp of this branch point, or the fixed special time stampunspecifiedif this branch point marks theheadof a branch.intReturns theview setthis view is associated with.booleanReturnstrueif this transaction contains local modifications that are conflicting with remote modifications,falseotherwise.booleanbooleanhasResource(String path) Returnstrueif a resource with the given path exists in the repository,false.importChanges(InputStream in, boolean reconstructSavepoints) booleanisClosed()booleanisDirty()Returnstrueif this transaction is not closed and contains uncommitted changes,falseotherwise.booleanbooleanisEmpty()booleanbooleanbooleanDeprecated.booleanDeprecated.booleanbooleanvoidlockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, long timeout) Locks the given objects.voidlockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, long timeout, boolean recursive) merge(CDOBranchPoint source, CDOBranchPoint sourceBase, CDOBranchPoint targetBase, CDOMerger merger) Merges the changes between the given source base point and the given source point into this transaction.merge(CDOBranchPoint source, CDOBranchPoint sourceBase, CDOMerger merger) Merges the changes between the given source base point and the given source point into this transaction.merge(CDOBranchPoint source, CDOMerger merger) Merges the changes from the given source point into this transaction and possibly considers previous merges from thatbranchby inspecting themerge sourceinformation of thecommit history.Merges the changes from the given source branch into this transaction and possibly considers previous merges from that branch by inspecting themerge sourceinformation of thecommit history.options()Returns theoptionsof this view.voidpush()voidpush(IProgressMonitor progressMonitor) queryInstances(EClass type) Returns a list of the instances of the given type.<T extends EObject>
org.eclipse.net4j.util.collection.CloseableIterator<T>queryInstancesAsync(EClass type) Returns an iterator over the instances of the given type.<T extends EObject>
org.eclipse.net4j.util.collection.CloseableIterator<T>queryInstancesAsync(EClass type, boolean exact) Returns an iterator over the instances of the given type.queryResources(CDOResourceFolder folder, String name, boolean exactMatch) Returns a list of the resources in the given folder with a name equal to or starting with the value of the name parameter.org.eclipse.net4j.util.collection.CloseableIterator<CDOResourceNode>queryResourcesAsync(CDOResourceFolder folder, String name, boolean exactMatch) Returns an iterator over the resources in the given folder with a name equal to or starting with the value of the name parameter.queryXRefs(Set<CDOObject> targetObjects, EReference... sourceReferences) Returns a list ofobject referencesthat represent the cross references to the specified target objects.queryXRefs(CDOObject targetObject, EReference... sourceReferences) Returns a list ofobject referencesthat represent the cross references to the specified target object.org.eclipse.net4j.util.collection.CloseableIterator<CDOObjectReference>queryXRefsAsync(Set<CDOObject> targetObjects, EReference... sourceReferences) Returns an iterator over theobject referencesthat represent the cross references to the specified target objects.voidrefreshLockStates(Consumer<CDOLockState> consumer) Deprecated.intDeprecated.voidremoveListener(org.eclipse.net4j.util.event.IListener listener) voidremoveObjectHandler(CDOObjectHandler handler) voidvoidrevertTo(CDOBranchPoint branchPoint) voidrollback()booleanrunAfterUpdate(long updateTime, Runnable runnable) booleanSame as callingsetBranchPoint(branch, getTimeStamp()).booleansetBranch(CDOBranch branch, IProgressMonitor monitor) Same asCDOView.setBranch(CDOBranch)withIProgressMonitor.booleansetBranchPoint(CDOBranch branch, long timeStamp) Sets thebranchand the point in (repository) time this view should refer to.booleansetBranchPoint(CDOBranch branch, long timeStamp, IProgressMonitor monitor) Same asCDOView.setBranchPoint(CDOBranch, long)with aIProgressMonitor.booleansetBranchPoint(CDOBranchPoint branchPoint) Same as callingsetBranchPoint(branchPoint.getBranch(), branchPoint.getTimeStamp()).booleansetBranchPoint(CDOBranchPoint branchPoint, IProgressMonitor monitor) Same as callingCDOView.setBranchPoint(CDOBranchPoint)with aIProgressMonitor.voidsetCommitComment(String comment) Sets the comment to be used in the next commit operation.voidsetCommittables(Set<? extends EObject> committables) protected voidsetDirty(boolean dirty) voidsetResourcePathCache(Map<String, CDOID> resourcePathCache) Sets the newmapto be used as a cache for variousget*Resource*(String path)methods.Creates a save point in theCDOTransactionthat can be used to roll back a part of the transactionbooleansetTimeStamp(long timeStamp) Same as callingsetBranchPoint(getBranch(), timeStamp).booleansetTimeStamp(long timeStamp, IProgressMonitor monitor) Same asCDOView.setTimeStamp(long)withIProgressMonitor.void<V> VtoString()voidUnlocks all locked objects of this view.voidunlockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType) Unlocks the given locked objects of this view.voidunlockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, boolean recursive) voidwaitForUpdate(long updateTime) Blocks the calling thread until a commit operation with the given time stamp (or higher) has occurred.booleanwaitForUpdate(long updateTime, long timeoutMillis) Blocks the calling thread until a commit operation with the given time stamp (or higher) has occurred or the given timeout has expired.Methods inherited from class org.eclipse.net4j.util.event.Notifier
addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getNotificationService, hasListener, lastListenerRemoved, listenerAdded, listenerRemoved
-
Constructor Details
-
CDOPushTransaction
- Throws:
IOException
-
CDOPushTransaction
- Throws:
IOException
-
CDOPushTransaction
public CDOPushTransaction(CDOTransaction delegate, File file, boolean reconstructSavepoints) throws IOException - Throws:
IOException
-
-
Method Details
-
getDelegate
-
getFile
-
properties
- Specified by:
propertiesin interfaceorg.eclipse.net4j.util.properties.IPropertiesContainer- Since:
- 4.4
-
isDirty
public boolean isDirty()Description copied from interface:CDOTransactionReturnstrueif this transaction is not closed and contains uncommitted changes,falseotherwise.- Specified by:
isDirtyin interfaceCDOTransaction- Specified by:
isDirtyin interfaceCDOView- See Also:
-
setDirty
protected void setDirty(boolean dirty) -
commit
Description copied from interface:CDOUserTransactionSame ascommit(null).- Specified by:
commitin interfaceCDOUserTransaction- Throws:
CommitException
-
commit
Description copied from interface:CDOUserTransactionCommits the modifications of this transaction to the repository and returns acommit infoobject if successful.Various kinds of problems can cause the commit to fail and not all of them can be avoided by acquiring pessimistic
lockson the modified objects. In particular you must expect and handlecontainment cycle exceptions. The following example shows how write robust transactions:CDOTransaction transaction = null; try { transaction = session.openTransaction(); for (;;) { transaction.getViewLock().lock(); try { CDOResource resource = transaction.getResource("/stock/resource1"); // Modify the model here... transaction.commit(); break; } catch (ConcurrentAccessException ex) { transaction.rollback(); } catch (CommitException ex) { throw ex.wrap(); } finally { transaction.getViewLock().unlock(); } } } finally { if (transaction != null) { transaction.close(); } }Note that the transaction stays functional after a any call to thecommit()methods. If the transaction is not closed after a commit it can be used to apply additional modifications to the model.- Specified by:
commitin interfaceCDOUserTransaction- Throws:
CommitException
-
commit
@Deprecated public <T> CDOTransaction.CommitResult<T> commit(Callable<T> callable, org.eclipse.net4j.util.Predicate<Long> retry, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException, Exception Deprecated.- Specified by:
commitin interfaceCDOTransaction- Throws:
ConcurrentAccessExceptionCommitExceptionException
-
commit
public <T> CDOTransaction.CommitResult<T> commit(Callable<T> callable, Predicate<Long> retry, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException, Exception - Specified by:
commitin interfaceCDOTransaction- Throws:
ConcurrentAccessExceptionCommitExceptionException
-
commit
public <T> CDOTransaction.CommitResult<T> commit(Callable<T> callable, int attempts, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException, Exception - Specified by:
commitin interfaceCDOTransaction- Throws:
ConcurrentAccessExceptionCommitExceptionException
-
commit
@Deprecated public CDOCommitInfo commit(Runnable runnable, org.eclipse.net4j.util.Predicate<Long> retry, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException Deprecated.- Specified by:
commitin interfaceCDOTransaction- Throws:
ConcurrentAccessExceptionCommitException
-
commit
public CDOCommitInfo commit(Runnable runnable, Predicate<Long> retry, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException - Specified by:
commitin interfaceCDOTransaction- Throws:
ConcurrentAccessExceptionCommitException
-
commit
public CDOCommitInfo commit(Runnable runnable, int attempts, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException - Specified by:
commitin interfaceCDOTransaction- Throws:
ConcurrentAccessExceptionCommitException
-
commitAndClose
public CDOCommitInfo commitAndClose(IProgressMonitor monitor, boolean keepOpenAfterCommitProblem) throws CommitException - Specified by:
commitAndClosein interfaceCDOTransaction- Throws:
CommitException
-
rollback
public void rollback()- Specified by:
rollbackin interfaceCDOUserTransaction
-
push
- Throws:
CommitException
-
push
- Throws:
CommitException
-
exportChanges
- Specified by:
exportChangesin interfaceCDOTransaction- Throws:
IOException
-
importChanges
public CDOSavepoint[] importChanges(InputStream in, boolean reconstructSavepoints) throws IOException - Specified by:
importChangesin interfaceCDOTransaction- Throws:
IOException
-
getLastCommitTime
public long getLastCommitTime()- Specified by:
getLastCommitTimein interfaceCDOTransaction
-
addListener
public void addListener(org.eclipse.net4j.util.event.IListener listener) - Specified by:
addListenerin interfaceorg.eclipse.net4j.util.event.INotifier- Overrides:
addListenerin classorg.eclipse.net4j.util.event.Notifier
-
removeListener
public void removeListener(org.eclipse.net4j.util.event.IListener listener) - Specified by:
removeListenerin interfaceorg.eclipse.net4j.util.event.INotifier- Overrides:
removeListenerin classorg.eclipse.net4j.util.event.Notifier
-
hasListeners
public boolean hasListeners()- Specified by:
hasListenersin interfaceorg.eclipse.net4j.util.event.INotifier- Overrides:
hasListenersin classorg.eclipse.net4j.util.event.Notifier
-
getListeners
public org.eclipse.net4j.util.event.IListener[] getListeners()- Specified by:
getListenersin interfaceorg.eclipse.net4j.util.event.INotifier- Overrides:
getListenersin classorg.eclipse.net4j.util.event.Notifier
-
addObjectHandler
- Specified by:
addObjectHandlerin interfaceCDOView
-
addRegistrationHandler
- Specified by:
addRegistrationHandlerin interfaceCDOView- Since:
- 4.6
-
addTransactionHandler
- Specified by:
addTransactionHandlerin interfaceCDOTransaction- Since:
- 4.0
-
close
public void close()- Specified by:
closein interfaceorg.eclipse.net4j.util.collection.Closeable
-
createQuery
Description copied from interface:CDOViewSame ascreateQuery(language, queryString, null).- Specified by:
createQueryin interfaceCDOView- See Also:
-
createQuery
- Specified by:
createQueryin interfaceCDOView- Since:
- 4.0
-
createQuery
- Specified by:
createQueryin interfaceCDOTransaction- Since:
- 4.0
-
createQuery
public CDOQuery createQuery(String language, String queryString, Object context, boolean considerDirtyState) - Specified by:
createQueryin interfaceCDOTransaction- Since:
- 4.0
-
createResourceFolder
- Specified by:
createResourceFolderin interfaceCDOTransaction- Since:
- 4.0
-
createResource
- Specified by:
createResourcein interfaceCDOTransaction- See Also:
-
isLegacyModeEnabled
Deprecated.- Specified by:
isLegacyModeEnabledin interfaceCDOView- See Also:
-
getLastUpdateTime
public long getLastUpdateTime()Description copied from interface:CDOUpdatableReturns the time stamp of the last commit operation. May not be accurate ifpassive updatesare disabled.- Specified by:
getLastUpdateTimein interfaceCDOUpdatable
-
waitForUpdate
public void waitForUpdate(long updateTime) Description copied from interface:CDOUpdatableBlocks the calling thread until a commit operation with the given time stamp (or higher) has occurred.- Specified by:
waitForUpdatein interfaceCDOUpdatable- Parameters:
updateTime- the time stamp of the update to wait for in milliseconds since Unix epoch.
-
waitForUpdate
public boolean waitForUpdate(long updateTime, long timeoutMillis) Description copied from interface:CDOUpdatableBlocks the calling thread until a commit operation with the given time stamp (or higher) has occurred or the given timeout has expired.- Specified by:
waitForUpdatein interfaceCDOUpdatable- Parameters:
updateTime- the time stamp of the update to wait for in milliseconds since Unix epoch.timeoutMillis- the maximum number of milliseconds to wait for the update to occur, orCDOUpdatable.NO_TIMEOUTto wait indefinitely.- Returns:
trueif the specified commit operation has occurred within the given timeout period,falseotherwise.
-
runAfterUpdate
- Specified by:
runAfterUpdatein interfaceCDOUpdatable- Since:
- 4.3
-
getConflicts
Description copied from interface:CDOTransactionReturns the set of objects that are conflicting with remote modifications or an empty set ifCDOTransaction.hasConflict()returnsfalse.- Specified by:
getConflictsin interfaceCDOTransaction
-
getChangeSetData
- Specified by:
getChangeSetDatain interfaceCDOChangeSetDataProvider- Since:
- 4.0
-
getDetachedObjects
- Specified by:
getDetachedObjectsin interfaceCDOTransaction
-
getDirtyObjects
- Specified by:
getDirtyObjectsin interfaceCDOTransaction
-
getRevision
- Specified by:
getRevisionin interfaceCDORevisionProvider- Since:
- 4.0
-
getFirstSavepoint
- Specified by:
getFirstSavepointin interfaceCDOTransaction- Since:
- 4.1
-
getLastSavepoint
- Specified by:
getLastSavepointin interfaceCDOTransaction- Specified by:
getLastSavepointin interfaceCDOUserTransaction
-
isInvalidationRunnerActive
Deprecated.- Specified by:
isInvalidationRunnerActivein interfaceCDOView- Since:
- 4.0
-
isInvalidating
public boolean isInvalidating()- Specified by:
isInvalidatingin interfaceCDOView- Since:
- 4.7
-
getNewObjects
- Specified by:
getNewObjectsin interfaceCDOTransaction
-
getObjects
Description copied from interface:CDOViewReturns the objects with the given CDOIDs.If objects are missing from the local cache they are loaded from the server in one round-trip.
- Specified by:
getObjectsin interfaceCDOView- Parameters:
ids- the collection of CDOIDs that identify the CDOObjects to return.- Returns:
- a map that contains the CDOObjects with the given CDOIDs.
- Since:
- 4.13
-
getObject
Description copied from interface:CDOViewReturns the object for the given CDOID. -
getObject
Description copied from interface:CDOViewReturns the object for the given CDOID.Same as
getObject(id, true). -
getObject
Description copied from interface:CDOViewTakes an object from a (possibly) different view and contextifies it for the usage with this view.- If the given object is contained in this view it is returned unmodified.
- If the given object can not be cast to
CDOObjectit is returned unmodified. - If the view of the given object is contained in a different session an
IllegalArgumentExceptionis thrown. - If
nullis passednullis returned.
-
getObjectHandlers
- Specified by:
getObjectHandlersin interfaceCDOView
-
getRegistrationHandlers
- Specified by:
getRegistrationHandlersin interfaceCDOView- Since:
- 4.6
-
getOrCreateResource
- Specified by:
getOrCreateResourcein interfaceCDOTransaction
-
getOrCreateResourceFolder
- Specified by:
getOrCreateResourceFolderin interfaceCDOTransaction- Since:
- 4.0
-
getResource
public CDOResource getResource(String path, boolean loadOnDemand) throws CDOResourceNodeNotFoundException - Specified by:
getResourcein interfaceCDOView- Throws:
CDOResourceNodeNotFoundException- See Also:
-
getResource
Description copied from interface:CDOViewSame asgetResource(String, true).- Specified by:
getResourcein interfaceCDOView- Throws:
CDOResourceNodeNotFoundException- See Also:
-
getResourceNode
Description copied from interface:CDOViewReturns the resource node with the given path.- Specified by:
getResourceNodein interfaceCDOView- Returns:
- never
null. - Throws:
CDOResourceNodeNotFoundException
-
createTextResource
- Specified by:
createTextResourcein interfaceCDOTransaction- Since:
- 4.2
-
getOrCreateTextResource
- Specified by:
getOrCreateTextResourcein interfaceCDOTransaction- Since:
- 4.2
-
createBinaryResource
- Specified by:
createBinaryResourcein interfaceCDOTransaction- Since:
- 4.2
-
getOrCreateBinaryResource
- Specified by:
getOrCreateBinaryResourcein interfaceCDOTransaction- Since:
- 4.2
-
getTextResource
- Specified by:
getTextResourcein interfaceCDOView- Throws:
CDOResourceNodeNotFoundException- Since:
- 4.2
-
getBinaryResource
- Specified by:
getBinaryResourcein interfaceCDOView- Throws:
CDOResourceNodeNotFoundException- Since:
- 4.2
-
getResourceFolder
- Specified by:
getResourceFolderin interfaceCDOView- Throws:
CDOResourceNodeNotFoundException- Since:
- 4.2
-
setResourcePathCache
Description copied from interface:CDOViewSets the newmapto be used as a cache for variousget*Resource*(String path)methods.Can be used to reset/clear the resource path cache by passing a
new HashMap<String, CDOID>(). Smarter maps could implement a LRU eviction policy to limit the map capacity. Passingnulldisables resource path caching.The default value is
new HashMap<String, CDOID>().- Specified by:
setResourcePathCachein interfaceCDOView- Since:
- 4.2
- See Also:
-
getResourceSet
Description copied from interface:CDOViewReturns theresource setthis view is associated with.Same as calling getViewSet().getResourceSet().
- Specified by:
getResourceSetin interfaceCDOView- See Also:
-
getRevisionDeltas
- Specified by:
getRevisionDeltasin interfaceCDOTransaction
-
getRootResource
Description copied from interface:CDOViewReturns the root resource of the repository.The root resource is a special resource with only
CDOResourceNodesin its contents list. You can use it as the main entry into the new resource and folder structure.- Specified by:
getRootResourcein interfaceCDOView
-
getSession
Description copied from interface:CDOViewReturns thesessionthis view was opened by.- Specified by:
getSessionin interfaceCDOCommonView- Specified by:
getSessionin interfaceCDOView- Returns:
- The session this view was opened by, or
nullif this view is closed. - See Also:
-
Closeable.close()Closeable.isClosed()CDOViewContainer.openView()CDOTransactionContainer.openTransaction()
-
getProvider
Description copied from interface:CDOViewReturns theproviderthat has opened this view.- Specified by:
getProviderin interfaceCDOView- Since:
- 4.4
-
createResourceURI
Description copied from interface:CDOViewReturns aURIthat can be used inResourceSet.getResource(URI, boolean)to load the resource with the specified path.- Specified by:
createResourceURIin interfaceCDOView- Since:
- 4.4
-
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
-
getDurableLockingID
- Specified by:
getDurableLockingIDin interfaceCDOCommonView- Since:
- 4.0
-
getTransactionHandlers
- Specified by:
getTransactionHandlersin interfaceCDOTransaction
-
getTransactionHandlers1
- Specified by:
getTransactionHandlers1in interfaceCDOTransaction- Since:
- 4.0
-
getTransactionHandlers2
- Specified by:
getTransactionHandlers2in interfaceCDOTransaction- Since:
- 4.0
-
getSessionID
public int getSessionID()- Specified by:
getSessionIDin interfaceCDOCommonView- Since:
- 4.1
-
isDurableView
public boolean isDurableView()- Specified by:
isDurableViewin interfaceCDOCommonView- Since:
- 4.1
-
getLockOwner
- Specified by:
getLockOwnerin interfaceCDOCommonView- Since:
- 4.15
-
getViewID
public int getViewID()- Specified by:
getViewIDin interfaceCDOCommonView
-
getViewSet
Description copied from interface:CDOViewReturns theview setthis view is associated with.- Specified by:
getViewSetin interfaceCDOView- Returns:
- The view set this view is associated with, never
null. - See Also:
-
getViewLock
- Specified by:
getViewLockin interfaceCDOView- Since:
- 4.5
-
syncExec
-
syncExec
-
hasConflict
public boolean hasConflict()Description copied from interface:CDOTransactionReturnstrueif this transaction contains local modifications that are conflicting with remote modifications,falseotherwise.- Specified by:
hasConflictin interfaceCDOTransaction- Specified by:
hasConflictin interfaceCDOView- See Also:
-
hasResource
Description copied from interface:CDOViewReturnstrueif a resource with the given path exists in the repository,false. Applies tofile resources, as well.- Specified by:
hasResourcein interfaceCDOView- See Also:
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceorg.eclipse.net4j.util.collection.Closeable
-
isObjectRegistered
Description copied from interface:CDOView- Specified by:
isObjectRegisteredin interfaceCDOView
-
refreshLockStates
Deprecated.Description copied from interface:CDOViewRefreshes thelock statesof thisviewwith the latest states from the repository. If a lock state consumer is passed it is called for each resulting new lock state.- Specified by:
refreshLockStatesin interfaceCDOView- Since:
- 4.12
-
getLockStates
Description copied from interface:CDOViewGet an array oflock statescorresponding to the specified collection ofids. If the collection ofidsis empty,lock statesof all objects are returned.- Specified by:
getLockStatesin interfaceCDOView- Since:
- 4.6
-
getLockStates
Description copied from interface:CDOViewGet an array oflock statescorresponding to the specified collection ofids. If the collection ofidsis empty,lock statesof all objects are returned.- Specified by:
getLockStatesin interfaceCDOView
-
getLockStatesOfObjects
Description copied from interface:CDOViewGet an array oflock statescorresponding to the specified collection ofobjects. If the collection ofobjectsis empty,lock statesof all locked objects are returned.- Specified by:
getLockStatesOfObjectsin interfaceCDOView- Since:
- 4.6
-
lockObjects
public void lockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, long timeout) throws InterruptedException Description copied from interface:CDOViewLocks the given objects. Once the objects are locked, they will not be changed remotely or go in conflict state.- Specified by:
lockObjectsin interfaceCDOView- Throws:
InterruptedException
-
lockObjects
public void lockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, long timeout, boolean recursive) throws InterruptedException - Specified by:
lockObjectsin interfaceCDOView- Throws:
InterruptedException
-
options
Description copied from interface:CDOCommonViewReturns theoptionsof this view.- Specified by:
optionsin interfaceCDOCommonView- Specified by:
optionsin interfaceCDOTransaction- Specified by:
optionsin interfaceCDOView- Specified by:
optionsin interfaceorg.eclipse.net4j.util.options.IOptionsContainer
-
queryResources
public List<CDOResourceNode> queryResources(CDOResourceFolder folder, String name, boolean exactMatch) Description copied from interface:CDOViewReturns a list of the resources in the given folder with a name equal to or starting with the value of the name parameter.- Specified by:
queryResourcesin interfaceCDOView- Parameters:
folder- The folder to search in, ornullfor top level resource nodes.name- the name or prefix of the resource nodes to return.exactMatch-trueif the complete name of the resource must match,falseif only a common prefix of the name must match.
-
queryResourcesAsync
public org.eclipse.net4j.util.collection.CloseableIterator<CDOResourceNode> queryResourcesAsync(CDOResourceFolder folder, String name, boolean exactMatch) Description copied from interface:CDOViewReturns an iterator over the resources in the given folder with a name equal to or starting with the value of the name parameter. The underlying query will be executed asynchronously.- Specified by:
queryResourcesAsyncin interfaceCDOView- Parameters:
folder- The folder to search in, ornullfor top level resource nodes.name- the name or prefix of the resource nodes to return.exactMatch-trueif the complete name of the resource must match,falseif only a common prefix of the name must match.
-
queryInstances
Description copied from interface:CDOViewReturns a list of the instances of the given type.- Specified by:
queryInstancesin interfaceCDOView- Since:
- 4.3
-
queryInstancesAsync
public <T extends EObject> org.eclipse.net4j.util.collection.CloseableIterator<T> queryInstancesAsync(EClass type) Description copied from interface:CDOViewReturns an iterator over the instances of the given type. The underlying query will be executed asynchronously.- Specified by:
queryInstancesAsyncin interfaceCDOView- Since:
- 4.3
-
queryInstancesAsync
public <T extends EObject> org.eclipse.net4j.util.collection.CloseableIterator<T> queryInstancesAsync(EClass type, boolean exact) Description copied from interface:CDOViewReturns an iterator over the instances of the given type. The underlying query will be executed asynchronously.- Specified by:
queryInstancesAsyncin interfaceCDOView- Since:
- 4.6
-
queryXRefs
Description copied from interface:CDOViewReturns a list ofobject referencesthat represent the cross references to the specified target object.- Specified by:
queryXRefsin interfaceCDOView- Parameters:
targetObject- The target object that referencing objects are requested for. An external target object can be used with the help ofCDOUtil.wrapExternalObject().sourceReferences- The reference features that referencing objects are requested for, or an empty array if all reference features are to be used in the request.- Since:
- 4.0
- See Also:
-
queryXRefs
public List<CDOObjectReference> queryXRefs(Set<CDOObject> targetObjects, EReference... sourceReferences) Description copied from interface:CDOViewReturns a list ofobject referencesthat represent the cross references to the specified target objects.- Specified by:
queryXRefsin interfaceCDOView- Parameters:
targetObjects- The set of target objects that referencing objects are requested for. External target objects can be used with the help ofCDOUtil.wrapExternalObject().sourceReferences- The reference features that referencing objects are requested for, or an empty array if all reference features are to be used in the request.- See Also:
-
queryXRefsAsync
public org.eclipse.net4j.util.collection.CloseableIterator<CDOObjectReference> queryXRefsAsync(Set<CDOObject> targetObjects, EReference... sourceReferences) Description copied from interface:CDOViewReturns an iterator over theobject referencesthat represent the cross references to the specified target objects. The underlying query will be executed asynchronously.- Specified by:
queryXRefsAsyncin interfaceCDOView- Parameters:
targetObjects- The set of target objects that referencing objects are requested for. External target objects can be used with the help ofCDOUtil.wrapExternalObject().sourceReferences- The reference features that referencing objects are requested for, or an empty array if all reference features are to be used in the request.- See Also:
-
reload
Deprecated.Description copied from interface:CDOViewReloads the givenobjectsfrom the repository. -
removeObjectHandler
- Specified by:
removeObjectHandlerin interfaceCDOView
-
removeRegistrationHandler
- Specified by:
removeRegistrationHandlerin interfaceCDOView- Since:
- 4.6
-
removeTransactionHandler
- Specified by:
removeTransactionHandlerin interfaceCDOTransaction- Since:
- 4.0
-
revertTo
- Specified by:
revertToin interfaceCDOTransaction- Since:
- 4.15
-
merge
Description copied from interface:CDOTransactionMerges the changes from the given source branch into this transaction and possibly considers previous merges from that branch by inspecting themerge sourceinformation of thecommit history.- Specified by:
mergein interfaceCDOTransaction- Since:
- 4.6
- See Also:
-
merge
Description copied from interface:CDOTransactionMerges the changes from the given source point into this transaction and possibly considers previous merges from thatbranchby inspecting themerge sourceinformation of thecommit history.- Specified by:
mergein interfaceCDOTransaction
-
merge
Description copied from interface:CDOTransactionMerges the changes between the given source base point and the given source point into this transaction.Warning: If the branch of this transaction already contains merges from the given source point range (i.e., if this merge is a "remerge") this method will likely fail. One of the following methods should be used instead:
- Specified by:
mergein interfaceCDOTransaction- Since:
- 4.0
-
merge
public CDOChangeSetData merge(CDOBranchPoint source, CDOBranchPoint sourceBase, CDOBranchPoint targetBase, CDOMerger merger) Description copied from interface:CDOTransactionMerges the changes between the given source base point and the given source point into this transaction.When specifying an adequate target base point this method is able to perform a proper "remerge".
- Specified by:
mergein interfaceCDOTransaction- Since:
- 4.6
- See Also:
-
compareRevisions
- Specified by:
compareRevisionsin interfaceCDOView- Since:
- 4.0
-
getHistory
- Specified by:
getHistoryin interfaceCDOCommitHistory.Provider<CDOObject,CDOObjectHistory> - Since:
- 4.2
-
getHistory
- Specified by:
getHistoryin interfaceCDOCommitHistory.Provider<CDOObject,CDOObjectHistory> - Since:
- 4.2
-
setSavepoint
Description copied from interface:CDOUserTransactionCreates a save point in theCDOTransactionthat can be used to roll back a part of the transactionSave points do not involve the server side, everything is done on the client side.
- Specified by:
setSavepointin interfaceCDOTransaction- Specified by:
setSavepointin interfaceCDOUserTransaction
-
unlockObjects
public void unlockObjects()Description copied from interface:CDOViewUnlocks all locked objects of this view.- Specified by:
unlockObjectsin interfaceCDOView
-
unlockObjects
public void unlockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType) Description copied from interface:CDOViewUnlocks the given locked objects of this view.- Specified by:
unlockObjectsin interfaceCDOView
-
unlockObjects
public void unlockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, boolean recursive) - Specified by:
unlockObjectsin interfaceCDOView
-
enableDurableLocking
Deprecated.UseenableDurableLocking()instead ordisableDurableLocking(boolean), respectively.- Specified by:
enableDurableLockingin interfaceCDOView- Since:
- 4.0
-
enableDurableLocking
Description copied from interface:CDOViewEnables the storage of all information that's needed toreopenthis view at a later point in time. This information includes thebranch point, the user ID of thesession, whether it's a read-only view or atransactionand all the locks that are acquired or will be acquired while durable locking is enabled. -
disableDurableLocking
public void disableDurableLocking(boolean releaseLocks) Description copied from interface:CDOViewDisables the storage of all information that's needed toreopenthis view at a later point in time. If such information is stored when this method is called it is removed. Note that locks acquired by this view are only released iftrueis passed to thereleaseLocksparameter.- Specified by:
disableDurableLockingin interfaceCDOView- Since:
- 4.1
- See Also:
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnlyin interfaceCDOCommonView
-
isHistorical
public boolean isHistorical()- Specified by:
isHistoricalin interfaceCDOCommonView- Since:
- 4.5
-
getBranch
Description copied from interface:CDOBranchPointReturns the branch of this branch point, ornullif this branch point is thebaseof themain branch.- Specified by:
getBranchin interfaceCDOBranchPoint- Specified by:
getBranchin interfaceCDOBranchProvider
-
setBranchPoint
Description copied from interface:CDOViewSets thebranchand the point in (repository) time this view should refer to.Objectsprovided by this view will bevalidat this time. The special valueUNSPECIFIED_DATEdenotes a "floating view" that always shows the latest state of the repository.- Specified by:
setBranchPointin interfaceCDOView- Returns:
trueif the branch point was changed,falseotherwise.
-
setBranchPoint
Description copied from interface:CDOViewSame asCDOView.setBranchPoint(CDOBranch, long)with aIProgressMonitor.- Specified by:
setBranchPointin interfaceCDOView- Since:
- 4.4
-
setBranchPoint
Description copied from interface:CDOViewSame as callingsetBranchPoint(branchPoint.getBranch(), branchPoint.getTimeStamp()).- Specified by:
setBranchPointin interfaceCDOView
-
setBranchPoint
Description copied from interface:CDOViewSame as callingCDOView.setBranchPoint(CDOBranchPoint)with aIProgressMonitor.- Specified by:
setBranchPointin interfaceCDOView- Since:
- 4.4
-
setBranch
Description copied from interface:CDOViewSame as callingsetBranchPoint(branch, getTimeStamp()). -
setBranch
Description copied from interface:CDOViewSame asCDOView.setBranch(CDOBranch)withIProgressMonitor. -
setTimeStamp
public boolean setTimeStamp(long timeStamp) Description copied from interface:CDOViewSame as callingsetBranchPoint(getBranch(), timeStamp).- Specified by:
setTimeStampin interfaceCDOView
-
setTimeStamp
Description copied from interface:CDOViewSame asCDOView.setTimeStamp(long)withIProgressMonitor.- Specified by:
setTimeStampin interfaceCDOView- Since:
- 4.4
-
getURIHandler
- Specified by:
getURIHandlerin interfaceCDOView
-
getUnitManager
- Specified by:
getUnitManagerin interfaceCDOView- Since:
- 4.5
-
getCommitComment
Description copied from interface:CDOTransactionReturns the comment to be used in the next commit operation.- Specified by:
getCommitCommentin interfaceCDOTransaction- See Also:
-
setCommitComment
Description copied from interface:CDOTransactionSets the comment to be used in the next commit operation.- Specified by:
setCommitCommentin interfaceCDOTransaction- See Also:
-
setCommittables
- Specified by:
setCommittablesin interfaceCDOTransaction- Since:
- 4.0
-
getCommittables
- Specified by:
getCommittablesin interfaceCDOTransaction- Since:
- 4.0
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceorg.eclipse.net4j.util.container.IContainer<CDOResourceNode>- Since:
- 4.2
-
getElements
- Specified by:
getElementsin interfaceorg.eclipse.net4j.util.container.IContainer<CDOResourceNode>- Since:
- 4.2
-
toString
-
getAdapter
- Specified by:
getAdapterin interfaceIAdaptable- Since:
- 4.2
-
createTempFile
- Throws:
IOException
-
enableDurableLocking()instead ordisableDurableLocking(boolean), respectively.