public class CDOPushTransaction extends Notifier implements CDOTransaction
transaction that persists changes to the object graph locally on commit and can later load
these changes and push them to the repository.CDOTransaction.CommitResult<T>, CDOTransaction.OptionsIContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>PROP_TIME_MACHINE_DISABLEDNO_TIMEOUTINVALID_DATE, UNSPECIFIED_DATE| Constructor and Description |
|---|
CDOPushTransaction(CDOTransaction delegate) |
CDOPushTransaction(CDOTransaction delegate,
java.io.File file) |
CDOPushTransaction(CDOTransaction delegate,
java.io.File file,
boolean reconstructSavepoints) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(IListener listener) |
void |
addObjectHandler(CDOObjectHandler handler) |
void |
addRegistrationHandler(CDORegistrationHandler handler) |
void |
addTransactionHandler(CDOTransactionHandlerBase handler) |
void |
close() |
CDOCommitInfo |
commit()
Same as
commit(null). |
<T> CDOTransaction.CommitResult<T> |
commit(java.util.concurrent.Callable<T> callable,
int attempts,
IProgressMonitor monitor) |
<T> CDOTransaction.CommitResult<T> |
commit(java.util.concurrent.Callable<T> callable,
Predicate<java.lang.Long> retry,
IProgressMonitor monitor) |
CDOCommitInfo |
commit(IProgressMonitor monitor)
Commits the modifications of this transaction to the repository and returns a
commit info object if successful. |
CDOCommitInfo |
commit(java.lang.Runnable runnable,
int attempts,
IProgressMonitor monitor) |
CDOCommitInfo |
commit(java.lang.Runnable runnable,
Predicate<java.lang.Long> retry,
IProgressMonitor monitor) |
CDOChangeSetData |
compareRevisions(CDOBranchPoint source) |
CDOBinaryResource |
createBinaryResource(java.lang.String path) |
CDOQuery |
createQuery(java.lang.String language,
java.lang.String queryString)
Same as
createQuery(language, queryString, null). |
CDOQuery |
createQuery(java.lang.String language,
java.lang.String queryString,
boolean considerDirtyState) |
CDOQuery |
createQuery(java.lang.String language,
java.lang.String queryString,
java.lang.Object context) |
CDOQuery |
createQuery(java.lang.String language,
java.lang.String queryString,
java.lang.Object context,
boolean considerDirtyState) |
CDOResource |
createResource(java.lang.String path) |
CDOResourceFolder |
createResourceFolder(java.lang.String path) |
URI |
createResourceURI(java.lang.String path)
Returns a
URI that can be used in ResourceSet.getResource(URI, boolean) to load the resource with the specified path. |
static java.io.File |
createTempFile(CDOTransaction transaction) |
CDOTextResource |
createTextResource(java.lang.String path) |
void |
disableDurableLocking(boolean releaseLocks)
Disables the storage of all information that's needed to
reopen this view at a
later point in time. |
java.lang.String |
enableDurableLocking()
Enables the storage of all information that's needed to
reopen this view at a
later point in time. |
java.lang.String |
enableDurableLocking(boolean enable)
Deprecated.
Use
enableDurableLocking() instead or disableDurableLocking(boolean), respectively. |
CDOSavepoint[] |
exportChanges(java.io.OutputStream out) |
java.lang.Object |
getAdapter(java.lang.Class adapter) |
CDOBinaryResource |
getBinaryResource(java.lang.String path) |
CDOBranch |
getBranch()
Returns the branch of this branch point, or
null if this branch point is the
base of the main branch. |
CDOChangeSetData |
getChangeSetData() |
java.lang.String |
getCommitComment()
Returns the comment to be used in the next commit operation.
|
java.util.Set<? extends EObject> |
getCommittables() |
java.util.Set<CDOObject> |
getConflicts()
Returns the set of objects that are conflicting with remote modifications or an empty set if
CDOTransaction.hasConflict() returns false. |
CDOTransaction |
getDelegate() |
java.util.Map<CDOID,CDOObject> |
getDetachedObjects() |
java.util.Map<CDOID,CDOObject> |
getDirtyObjects() |
java.lang.String |
getDurableLockingID() |
CDOResourceNode[] |
getElements() |
java.io.File |
getFile() |
CDOSavepoint |
getFirstSavepoint() |
CDOCommitHistory |
getHistory() |
CDOObjectHistory |
getHistory(CDOObject object) |
long |
getLastCommitTime() |
CDOSavepoint |
getLastSavepoint() |
long |
getLastUpdateTime()
Returns the time stamp of the last commit operation.
|
IListener[] |
getListeners() |
CDOLockState[] |
getLockStates(java.util.Collection<CDOID> ids)
Get an array of
lock states corresponding to the specified collection of ids. |
CDOLockState[] |
getLockStatesOfObjects(java.util.Collection<? extends CDOObject> objects)
Get an array of
lock states corresponding to the specified collection of objects. |
java.util.Map<CDOID,CDOObject> |
getNewObjects() |
CDOObject |
getObject(CDOID id)
Returns the object for the given CDOID.
|
CDOObject |
getObject(CDOID id,
boolean loadOnDemand)
Returns the object for the given CDOID.
|
<T extends EObject> |
getObject(T objectFromDifferentView)
Takes an object from a (possibly) different view and contextifies it for the usage with this view.
|
CDOObjectHandler[] |
getObjectHandlers() |
CDOBinaryResource |
getOrCreateBinaryResource(java.lang.String path) |
CDOResource |
getOrCreateResource(java.lang.String path) |
CDOResourceFolder |
getOrCreateResourceFolder(java.lang.String path) |
CDOTextResource |
getOrCreateTextResource(java.lang.String path) |
CDOViewProvider |
getProvider()
Returns the
provider that has opened this view. |
CDORegistrationHandler[] |
getRegistrationHandlers() |
CDOResource |
getResource(java.lang.String path)
Same as
getResource(String, true). |
CDOResource |
getResource(java.lang.String path,
boolean loadOnDemand) |
CDOResourceFolder |
getResourceFolder(java.lang.String path) |
CDOResourceNode |
getResourceNode(java.lang.String path)
Returns the resource node with the given path.
|
ResourceSet |
getResourceSet()
Returns the
resource set this view is associated with. |
CDORevision |
getRevision(CDOID id) |
java.util.Map<CDOID,CDORevisionDelta> |
getRevisionDeltas() |
CDOResource |
getRootResource()
Returns the root resource of the repository.
|
CDOSession |
getSession()
Returns the
session this view was opened by. |
int |
getSessionID() |
CDOTextResource |
getTextResource(java.lang.String path) |
long |
getTimeStamp()
Returns the time stamp of this branch point, or the fixed special time stamp
unspecified if this branch point marks the head of a branch. |
CDOTransactionHandler[] |
getTransactionHandlers() |
CDOTransactionHandler1[] |
getTransactionHandlers1() |
CDOTransactionHandler2[] |
getTransactionHandlers2() |
CDOUnitManager |
getUnitManager() |
URIHandler |
getURIHandler() |
int |
getViewID() |
java.util.concurrent.locks.Lock |
getViewLock() |
CDOViewSet |
getViewSet()
Returns the
view set this view is associated with. |
boolean |
hasConflict()
Returns
true if this transaction contains local modifications that are conflicting with remote
modifications, false otherwise. |
boolean |
hasListeners() |
boolean |
hasResource(java.lang.String path)
Returns
true if a resource with the given path exists in the repository, false. |
CDOSavepoint[] |
importChanges(java.io.InputStream in,
boolean reconstructSavepoints) |
boolean |
isClosed() |
boolean |
isDirty()
Returns
true if this transaction is not closed and contains uncommitted changes, false
otherwise. |
boolean |
isDurableView() |
boolean |
isEmpty() |
boolean |
isHistorical() |
boolean |
isInvalidating() |
boolean |
isInvalidationRunnerActive()
Deprecated.
|
boolean |
isLegacyModeEnabled()
Deprecated.
|
boolean |
isObjectRegistered(CDOID id)
|
boolean |
isReadOnly() |
void |
lockObjects(java.util.Collection<? extends CDOObject> objects,
IRWLockManager.LockType lockType,
long timeout)
Locks the given objects.
|
void |
lockObjects(java.util.Collection<? extends CDOObject> objects,
IRWLockManager.LockType lockType,
long timeout,
boolean recursive) |
CDOChangeSetData |
merge(CDOBranch source,
CDOMerger merger)
Merges the changes from the given source branch into this transaction and possibly considers previous merges
from that branch by inspecting the
merge source
information of the commit history. |
CDOChangeSetData |
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.
|
CDOChangeSetData |
merge(CDOBranchPoint source,
CDOBranchPoint sourceBase,
CDOMerger merger)
Merges the changes between the given source base point and the given source point into this transaction.
|
CDOChangeSetData |
merge(CDOBranchPoint source,
CDOMerger merger)
Merges the changes from the given source point into this transaction and possibly considers previous merges
from that
branch by inspecting the merge source
information of the commit history. |
CDOTransaction.Options |
options()
Returns the
options of this view. |
IRegistry<java.lang.String,java.lang.Object> |
properties() |
void |
push() |
void |
push(IProgressMonitor progressMonitor) |
<T extends EObject> |
queryInstances(EClass type)
Returns a list of the instances of the given type.
|
<T extends EObject> |
queryInstancesAsync(EClass type)
Returns an iterator over the instances of the given type.
|
<T extends EObject> |
queryInstancesAsync(EClass type,
boolean exact)
Returns an iterator over the instances of the given type.
|
java.util.List<CDOResourceNode> |
queryResources(CDOResourceFolder folder,
java.lang.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.
|
CloseableIterator<CDOResourceNode> |
queryResourcesAsync(CDOResourceFolder folder,
java.lang.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.
|
java.util.List<CDOObjectReference> |
queryXRefs(CDOObject targetObject,
EReference... sourceReferences)
Returns a list of
object references that represent the cross references to the specified
target object. |
java.util.List<CDOObjectReference> |
queryXRefs(java.util.Set<CDOObject> targetObjects,
EReference... sourceReferences)
Returns a list of
object references that represent the cross references to the specified
target objects. |
CloseableIterator<CDOObjectReference> |
queryXRefsAsync(java.util.Set<CDOObject> targetObjects,
EReference... sourceReferences)
Returns an iterator over the
object references that represent the cross references to
the specified target objects. |
int |
reload(CDOObject... objects)
Deprecated.
|
void |
removeListener(IListener listener) |
void |
removeObjectHandler(CDOObjectHandler handler) |
void |
removeRegistrationHandler(CDORegistrationHandler handler) |
void |
removeTransactionHandler(CDOTransactionHandlerBase handler) |
void |
rollback() |
boolean |
runAfterUpdate(long updateTime,
java.lang.Runnable runnable) |
boolean |
setBranch(CDOBranch branch)
Same as calling
setBranchPoint(branch, getTimeStamp()). |
boolean |
setBranch(CDOBranch branch,
IProgressMonitor monitor)
Same as
CDOView.setBranch(CDOBranch) with IProgressMonitor. |
boolean |
setBranchPoint(CDOBranch branch,
long timeStamp)
Sets the
branch and the point in (repository) time this view should refer to. |
boolean |
setBranchPoint(CDOBranch branch,
long timeStamp,
IProgressMonitor monitor)
Same as
CDOView.setBranchPoint(CDOBranch, long) with a IProgressMonitor. |
boolean |
setBranchPoint(CDOBranchPoint branchPoint)
Same as calling
setBranchPoint(branchPoint.getBranch(),
branchPoint.getTimeStamp()). |
boolean |
setBranchPoint(CDOBranchPoint branchPoint,
IProgressMonitor monitor)
Same as calling
CDOView.setBranchPoint(CDOBranchPoint) with a IProgressMonitor . |
void |
setCommitComment(java.lang.String comment)
Sets the comment to be used in the next commit operation.
|
void |
setCommittables(java.util.Set<? extends EObject> committables) |
protected void |
setDirty(boolean dirty) |
void |
setResourcePathCache(java.util.Map<java.lang.String,CDOID> resourcePathCache)
Sets the new
map to be used as a cache for various get*Resource*(String path) methods. |
CDOSavepoint |
setSavepoint()
Creates a save point in the
CDOTransaction that can be used to roll back a part of the transaction |
boolean |
setTimeStamp(long timeStamp)
Same as calling
setBranchPoint(getBranch(), timeStamp). |
boolean |
setTimeStamp(long timeStamp,
IProgressMonitor monitor)
Same as
CDOView.setTimeStamp(long) with IProgressMonitor. |
<V> V |
syncExec(java.util.concurrent.Callable<V> callable) |
void |
syncExec(java.lang.Runnable runnable) |
java.lang.String |
toString() |
void |
unlockObjects()
Unlocks all locked objects of this view.
|
void |
unlockObjects(java.util.Collection<? extends CDOObject> objects,
IRWLockManager.LockType lockType)
Unlocks the given locked objects of this view.
|
void |
unlockObjects(java.util.Collection<? extends CDOObject> objects,
IRWLockManager.LockType lockType,
boolean recursive) |
void |
waitForUpdate(long updateTime)
Blocks the calling thread until a commit operation with the given time stamp (or higher) has occurred.
|
boolean |
waitForUpdate(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.
|
fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getNotificationService, lastListenerRemovedpublic CDOPushTransaction(CDOTransaction delegate) throws java.io.IOException
java.io.IOExceptionpublic CDOPushTransaction(CDOTransaction delegate, java.io.File file) throws java.io.IOException
java.io.IOExceptionpublic CDOPushTransaction(CDOTransaction delegate, java.io.File file, boolean reconstructSavepoints) throws java.io.IOException
java.io.IOExceptionpublic CDOTransaction getDelegate()
public java.io.File getFile()
public final IRegistry<java.lang.String,java.lang.Object> properties()
properties in interface IPropertiesContainerpublic boolean isDirty()
CDOTransactiontrue if this transaction is not closed and contains uncommitted changes, false
otherwise.isDirty in interface CDOTransactionisDirty in interface CDOViewCDOTransaction.isDirty()protected void setDirty(boolean dirty)
public CDOCommitInfo commit() throws CommitException
CDOUserTransactioncommit(null).commit in interface CDOUserTransactionCommitExceptionpublic CDOCommitInfo commit(IProgressMonitor monitor) throws CommitException
CDOUserTransactioncommit info object if successful.
Various kinds of problems can cause the commit to fail and not all of them can be avoided by acquiring pessimistic locks
on the modified objects. In particular you must expect and handle containment 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 the commit() methods. If the transaction is not closed after a commit
it can be used to apply additional modifications to the model.commit in interface CDOUserTransactionCommitExceptionpublic <T> CDOTransaction.CommitResult<T> commit(java.util.concurrent.Callable<T> callable, Predicate<java.lang.Long> retry, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException, java.lang.Exception
commit in interface CDOTransactionConcurrentAccessExceptionCommitExceptionjava.lang.Exceptionpublic <T> CDOTransaction.CommitResult<T> commit(java.util.concurrent.Callable<T> callable, int attempts, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException, java.lang.Exception
commit in interface CDOTransactionConcurrentAccessExceptionCommitExceptionjava.lang.Exceptionpublic CDOCommitInfo commit(java.lang.Runnable runnable, Predicate<java.lang.Long> retry, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException
commit in interface CDOTransactionConcurrentAccessExceptionCommitExceptionpublic CDOCommitInfo commit(java.lang.Runnable runnable, int attempts, IProgressMonitor monitor) throws ConcurrentAccessException, CommitException
commit in interface CDOTransactionConcurrentAccessExceptionCommitExceptionpublic void rollback()
rollback in interface CDOUserTransactionpublic void push()
throws CommitException
CommitExceptionpublic void push(IProgressMonitor progressMonitor) throws CommitException
CommitExceptionpublic CDOSavepoint[] exportChanges(java.io.OutputStream out) throws java.io.IOException
exportChanges in interface CDOTransactionjava.io.IOExceptionpublic CDOSavepoint[] importChanges(java.io.InputStream in, boolean reconstructSavepoints) throws java.io.IOException
importChanges in interface CDOTransactionjava.io.IOExceptionpublic long getLastCommitTime()
getLastCommitTime in interface CDOTransactionpublic void addListener(IListener listener)
addListener in interface INotifieraddListener in class Notifierpublic void removeListener(IListener listener)
removeListener in interface INotifierremoveListener in class Notifierpublic boolean hasListeners()
hasListeners in interface INotifierhasListeners in class Notifierpublic IListener[] getListeners()
getListeners in interface INotifiergetListeners in class Notifierpublic void addObjectHandler(CDOObjectHandler handler)
addObjectHandler in interface CDOViewpublic void addRegistrationHandler(CDORegistrationHandler handler)
addRegistrationHandler in interface CDOViewpublic void addTransactionHandler(CDOTransactionHandlerBase handler)
addTransactionHandler in interface CDOTransactionpublic CDOQuery createQuery(java.lang.String language, java.lang.String queryString)
CDOViewcreateQuery(language, queryString, null).createQuery in interface CDOViewCDOView.createQuery(String, String, Object)public CDOQuery createQuery(java.lang.String language, java.lang.String queryString, java.lang.Object context)
createQuery in interface CDOViewpublic CDOQuery createQuery(java.lang.String language, java.lang.String queryString, boolean considerDirtyState)
createQuery in interface CDOTransactionpublic CDOQuery createQuery(java.lang.String language, java.lang.String queryString, java.lang.Object context, boolean considerDirtyState)
createQuery in interface CDOTransactionpublic CDOResourceFolder createResourceFolder(java.lang.String path)
createResourceFolder in interface CDOTransactionpublic CDOResource createResource(java.lang.String path)
createResource in interface CDOTransactionResourceSet.createResource(URI)@Deprecated public boolean isLegacyModeEnabled()
isLegacyModeEnabled in interface CDOViewCDOUtil.setLegacyModeDefault(boolean)public long getLastUpdateTime()
CDOUpdatablepassive updates are disabled.getLastUpdateTime in interface CDOUpdatablepublic void waitForUpdate(long updateTime)
CDOUpdatablewaitForUpdate in interface CDOUpdatablepublic boolean waitForUpdate(long updateTime,
long timeoutMillis)
CDOUpdatablewaitForUpdate in interface CDOUpdatabletrue if the specified commit operation has occurred within the given timeout period,
false otherwise.public boolean runAfterUpdate(long updateTime,
java.lang.Runnable runnable)
runAfterUpdate in interface CDOUpdatablepublic java.util.Set<CDOObject> getConflicts()
CDOTransactionCDOTransaction.hasConflict() returns false.getConflicts in interface CDOTransactionpublic CDOChangeSetData getChangeSetData()
getChangeSetData in interface CDOChangeSetDataProviderpublic java.util.Map<CDOID,CDOObject> getDetachedObjects()
getDetachedObjects in interface CDOTransactionpublic java.util.Map<CDOID,CDOObject> getDirtyObjects()
getDirtyObjects in interface CDOTransactionpublic CDORevision getRevision(CDOID id)
getRevision in interface CDORevisionProviderpublic CDOSavepoint getFirstSavepoint()
getFirstSavepoint in interface CDOTransactionpublic CDOSavepoint getLastSavepoint()
getLastSavepoint in interface CDOTransactiongetLastSavepoint in interface CDOUserTransaction@Deprecated public boolean isInvalidationRunnerActive()
isInvalidationRunnerActive in interface CDOViewpublic boolean isInvalidating()
isInvalidating in interface CDOViewpublic java.util.Map<CDOID,CDOObject> getNewObjects()
getNewObjects in interface CDOTransactionpublic CDOObject getObject(CDOID id, boolean loadOnDemand)
CDOViewpublic CDOObject getObject(CDOID id)
CDOView
Same as getObject(id, true).
getObject in interface CDOViewCDOView.getObject(CDOID, boolean)public <T extends EObject> T getObject(T objectFromDifferentView)
CDOViewCDOObject it is returned unmodified.
IllegalArgumentException is
thrown.
null is passed null is returned.
public CDOObjectHandler[] getObjectHandlers()
getObjectHandlers in interface CDOViewpublic CDORegistrationHandler[] getRegistrationHandlers()
getRegistrationHandlers in interface CDOViewpublic CDOResource getOrCreateResource(java.lang.String path)
getOrCreateResource in interface CDOTransactionpublic CDOResourceFolder getOrCreateResourceFolder(java.lang.String path)
getOrCreateResourceFolder in interface CDOTransactionpublic CDOResource getResource(java.lang.String path, boolean loadOnDemand) throws CDOResourceNodeNotFoundException
getResource in interface CDOViewCDOResourceNodeNotFoundExceptionResourceSet.getResource(URI, boolean)public CDOResource getResource(java.lang.String path) throws CDOResourceNodeNotFoundException
CDOViewgetResource(String, true).getResource in interface CDOViewCDOResourceNodeNotFoundExceptionResourceSet.getResource(URI, boolean)public CDOResourceNode getResourceNode(java.lang.String path) throws CDOResourceNodeNotFoundException
CDOViewgetResourceNode in interface CDOViewnull.CDOResourceNodeNotFoundExceptionpublic CDOTextResource createTextResource(java.lang.String path)
createTextResource in interface CDOTransactionpublic CDOTextResource getOrCreateTextResource(java.lang.String path)
getOrCreateTextResource in interface CDOTransactionpublic CDOBinaryResource createBinaryResource(java.lang.String path)
createBinaryResource in interface CDOTransactionpublic CDOBinaryResource getOrCreateBinaryResource(java.lang.String path)
getOrCreateBinaryResource in interface CDOTransactionpublic CDOTextResource getTextResource(java.lang.String path) throws CDOResourceNodeNotFoundException
getTextResource in interface CDOViewCDOResourceNodeNotFoundExceptionpublic CDOBinaryResource getBinaryResource(java.lang.String path) throws CDOResourceNodeNotFoundException
getBinaryResource in interface CDOViewCDOResourceNodeNotFoundExceptionpublic CDOResourceFolder getResourceFolder(java.lang.String path) throws CDOResourceNodeNotFoundException
getResourceFolder in interface CDOViewCDOResourceNodeNotFoundExceptionpublic void setResourcePathCache(java.util.Map<java.lang.String,CDOID> resourcePathCache)
CDOViewmap to be used as a cache for various get*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.
Passing null disables resource path caching.
The default value is new HashMap<String, CDOID>().
setResourcePathCache in interface CDOViewCDOView.getResourceNode(String),
CDOView.getResource(String),
CDOView.getResource(String, boolean),
CDOView.getBinaryResource(String),
CDOView.getTextResource(String),
CDOView.getResourceFolder(String),
CDOView.hasResource(String)public ResourceSet getResourceSet()
CDOViewresource set this view is associated with.
Same as calling getViewSet().getResourceSet().
getResourceSet in interface CDOViewCDOViewSet.getResourceSet()public java.util.Map<CDOID,CDORevisionDelta> getRevisionDeltas()
getRevisionDeltas in interface CDOTransactionpublic CDOResource getRootResource()
CDOView
The root resource is a special resource with only CDOResourceNodes in its contents list.
You can use it as the main entry into the new resource and folder structure.
getRootResource in interface CDOViewpublic CDOSession getSession()
CDOViewsession this view was opened by.getSession in interface CDOCommonViewgetSession in interface CDOViewnull if this view is closed.Closeable.close(),
Closeable.isClosed(),
CDOViewContainer.openView(),
CDOTransactionContainer.openTransaction()public CDOViewProvider getProvider()
CDOViewprovider that has opened this view.getProvider in interface CDOViewpublic URI createResourceURI(java.lang.String path)
CDOViewURI that can be used in ResourceSet.getResource(URI, boolean) to load the resource with the specified path.createResourceURI in interface CDOViewpublic long getTimeStamp()
CDOBranchPointunspecified if this branch point marks the head of a branch.getTimeStamp in interface CDOBranchPointgetTimeStamp in interface CDOTimeProviderpublic java.lang.String getDurableLockingID()
getDurableLockingID in interface CDOCommonViewgetDurableLockingID in interface CDOLockOwnerpublic CDOTransactionHandler[] getTransactionHandlers()
getTransactionHandlers in interface CDOTransactionpublic CDOTransactionHandler1[] getTransactionHandlers1()
getTransactionHandlers1 in interface CDOTransactionpublic CDOTransactionHandler2[] getTransactionHandlers2()
getTransactionHandlers2 in interface CDOTransactionpublic int getSessionID()
getSessionID in interface CDOLockOwnerpublic boolean isDurableView()
isDurableView in interface CDOLockOwnerpublic int getViewID()
getViewID in interface CDOCommonViewgetViewID in interface CDOLockOwnerpublic CDOViewSet getViewSet()
CDOViewview set this view is associated with.getViewSet in interface CDOViewnull.CDOViewSet.getViews()public java.util.concurrent.locks.Lock getViewLock()
getViewLock in interface CDOViewpublic void syncExec(java.lang.Runnable runnable)
public <V> V syncExec(java.util.concurrent.Callable<V> callable)
throws java.lang.Exception
public boolean hasConflict()
CDOTransactiontrue if this transaction contains local modifications that are conflicting with remote
modifications, false otherwise.hasConflict in interface CDOTransactionhasConflict in interface CDOViewCDOTransaction.hasConflict()public boolean hasResource(java.lang.String path)
CDOViewtrue if a resource with the given path exists in the repository, false.
Applies to file resources, as well.hasResource in interface CDOViewCDOView.getResource(String, boolean)public boolean isObjectRegistered(CDOID id)
CDOViewisObjectRegistered in interface CDOViewpublic CDOLockState[] getLockStates(java.util.Collection<CDOID> ids)
CDOViewlock states corresponding to the specified collection of ids.
If the collection of ids is empty, lock states of all locked objects are returned.getLockStates in interface CDOViewpublic CDOLockState[] getLockStatesOfObjects(java.util.Collection<? extends CDOObject> objects)
CDOViewlock states corresponding to the specified collection of objects.
If the collection of objects is empty, lock states of all locked objects are returned.getLockStatesOfObjects in interface CDOViewpublic void lockObjects(java.util.Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType, long timeout) throws java.lang.InterruptedException
CDOViewlockObjects in interface CDOViewjava.lang.InterruptedExceptionpublic void lockObjects(java.util.Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType, long timeout, boolean recursive) throws java.lang.InterruptedException
lockObjects in interface CDOViewjava.lang.InterruptedExceptionpublic CDOTransaction.Options options()
CDOCommonViewoptions of this view.options in interface CDOCommonViewoptions in interface CDOTransactionoptions in interface CDOViewoptions in interface IOptionsContainerpublic java.util.List<CDOResourceNode> queryResources(CDOResourceFolder folder, java.lang.String name, boolean exactMatch)
CDOViewqueryResources in interface CDOViewfolder - The folder to search in, or null for top level resource nodes.name - the name or prefix of the resource nodes to return.exactMatch - true if the complete name of the resource must match, false if only a common
prefix of the name must match.public CloseableIterator<CDOResourceNode> queryResourcesAsync(CDOResourceFolder folder, java.lang.String name, boolean exactMatch)
CDOViewqueryResourcesAsync in interface CDOViewfolder - The folder to search in, or null for top level resource nodes.name - the name or prefix of the resource nodes to return.exactMatch - true if the complete name of the resource must match, false if only a common
prefix of the name must match.public <T extends EObject> java.util.List<T> queryInstances(EClass type)
CDOViewqueryInstances in interface CDOViewpublic <T extends EObject> CloseableIterator<T> queryInstancesAsync(EClass type)
CDOViewqueryInstancesAsync in interface CDOViewpublic <T extends EObject> CloseableIterator<T> queryInstancesAsync(EClass type, boolean exact)
CDOViewqueryInstancesAsync in interface CDOViewpublic java.util.List<CDOObjectReference> queryXRefs(CDOObject targetObject, EReference... sourceReferences)
CDOViewobject references that represent the cross references to the specified
target object.queryXRefs in interface CDOViewtargetObject - The target object that referencing objects are requested for.
An external target object can be used with the help of CDOUtil.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.CDOView.queryXRefs(Set, EReference...),
CDOView.queryXRefsAsync(Set, EReference...),
CDOUtil.wrapExternalObject(EObject, CDOView)public java.util.List<CDOObjectReference> queryXRefs(java.util.Set<CDOObject> targetObjects, EReference... sourceReferences)
CDOViewobject references that represent the cross references to the specified
target objects.queryXRefs in interface CDOViewtargetObjects - The set of target objects that referencing objects are requested for.
External target objects can be used with the help of CDOUtil.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.CDOView.queryXRefs(CDOObject, EReference...),
CDOView.queryXRefsAsync(Set, EReference...),
CDOUtil.wrapExternalObject(EObject, CDOView)public CloseableIterator<CDOObjectReference> queryXRefsAsync(java.util.Set<CDOObject> targetObjects, EReference... sourceReferences)
CDOViewobject references that represent the cross references to
the specified target objects. The underlying query will be executed asynchronously.queryXRefsAsync in interface CDOViewtargetObjects - The set of target objects that referencing objects are requested for.
External target objects can be used with the help of CDOUtil.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.CDOView.queryXRefs(CDOObject, EReference...),
CDOView.queryXRefs(Set, EReference...),
CDOUtil.wrapExternalObject(EObject, CDOView)@Deprecated public int reload(CDOObject... objects)
CDOViewobjects from the repository.public void removeObjectHandler(CDOObjectHandler handler)
removeObjectHandler in interface CDOViewpublic void removeRegistrationHandler(CDORegistrationHandler handler)
removeRegistrationHandler in interface CDOViewpublic void removeTransactionHandler(CDOTransactionHandlerBase handler)
removeTransactionHandler in interface CDOTransactionpublic CDOChangeSetData merge(CDOBranch source, CDOMerger merger)
CDOTransactionmerge source
information of the commit history.merge in interface CDOTransactionCDOTransaction.merge(CDOBranchPoint, CDOMerger)public CDOChangeSetData merge(CDOBranchPoint source, CDOMerger merger)
CDOTransactionbranch by inspecting the merge source
information of the commit history.merge in interface CDOTransactionpublic CDOChangeSetData merge(CDOBranchPoint source, CDOBranchPoint sourceBase, CDOMerger merger)
CDOTransactionWarning: 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:
merge in interface CDOTransactionpublic CDOChangeSetData merge(CDOBranchPoint source, CDOBranchPoint sourceBase, CDOBranchPoint targetBase, CDOMerger merger)
CDOTransactionWhen specifying an adequate target base point this method is able to perform a proper "remerge".
merge in interface CDOTransactionCDOTransaction.merge(CDOBranchPoint, CDOMerger),
CDOTransaction.merge(CDOBranch, CDOMerger)public CDOChangeSetData compareRevisions(CDOBranchPoint source)
compareRevisions in interface CDOViewpublic CDOCommitHistory getHistory()
getHistory in interface CDOCommitHistory.Provider<CDOObject,CDOObjectHistory>public CDOObjectHistory getHistory(CDOObject object)
getHistory in interface CDOCommitHistory.Provider<CDOObject,CDOObjectHistory>public CDOSavepoint setSavepoint()
CDOUserTransactionCDOTransaction that can be used to roll back a part of the transaction
Save points do not involve the server side, everything is done on the client side.
setSavepoint in interface CDOTransactionsetSavepoint in interface CDOUserTransactionpublic void unlockObjects()
CDOViewunlockObjects in interface CDOViewpublic void unlockObjects(java.util.Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType)
CDOViewunlockObjects in interface CDOViewpublic void unlockObjects(java.util.Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType, boolean recursive)
unlockObjects in interface CDOView@Deprecated public java.lang.String enableDurableLocking(boolean enable)
enableDurableLocking() instead or disableDurableLocking(boolean), respectively.enableDurableLocking in interface CDOViewpublic java.lang.String enableDurableLocking()
CDOViewreopen this view at a
later point in time. This information includes the branch point, the user ID of the
session, whether it's a read-only view or a transaction and all the locks
that are acquired or will be acquired while durable locking is enabled.enableDurableLocking in interface CDOViewCDOViewContainer.openView(String),
CDOViewOpener.openView(String, ResourceSet),
CDOTransactionContainer.openTransaction(String),
CDOTransactionOpener.openTransaction(String, ResourceSet),
CDOView.disableDurableLocking(boolean)public void disableDurableLocking(boolean releaseLocks)
CDOViewreopen this 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 if true is passed to the releaseLocks parameter.disableDurableLocking in interface CDOViewCDOView.enableDurableLocking()public boolean isReadOnly()
isReadOnly in interface CDOCommonViewpublic boolean isHistorical()
isHistorical in interface CDOCommonViewpublic CDOBranch getBranch()
CDOBranchPointnull if this branch point is the
base of the main branch.getBranch in interface CDOBranchPointgetBranch in interface CDOBranchProviderpublic boolean setBranchPoint(CDOBranch branch, long timeStamp)
CDOViewbranch and the point in (repository) time this view should refer to. Objects provided by this view will be valid at this time. The special value
UNSPECIFIED_DATE denotes a "floating view" that always shows the latest
state of the repository.setBranchPoint in interface CDOViewtrue if the branch point was changed, false otherwise.public boolean setBranchPoint(CDOBranch branch, long timeStamp, IProgressMonitor monitor)
CDOViewCDOView.setBranchPoint(CDOBranch, long) with a IProgressMonitor.setBranchPoint in interface CDOViewpublic boolean setBranchPoint(CDOBranchPoint branchPoint)
CDOViewsetBranchPoint(branchPoint.getBranch(),
branchPoint.getTimeStamp()).setBranchPoint in interface CDOViewpublic boolean setBranchPoint(CDOBranchPoint branchPoint, IProgressMonitor monitor)
CDOViewCDOView.setBranchPoint(CDOBranchPoint) with a IProgressMonitor .setBranchPoint in interface CDOViewpublic boolean setBranch(CDOBranch branch)
CDOViewsetBranchPoint(branch, getTimeStamp()).public boolean setBranch(CDOBranch branch, IProgressMonitor monitor)
CDOViewCDOView.setBranch(CDOBranch) with IProgressMonitor.public boolean setTimeStamp(long timeStamp)
CDOViewsetBranchPoint(getBranch(), timeStamp).setTimeStamp in interface CDOViewpublic boolean setTimeStamp(long timeStamp,
IProgressMonitor monitor)
CDOViewCDOView.setTimeStamp(long) with IProgressMonitor.setTimeStamp in interface CDOViewpublic URIHandler getURIHandler()
getURIHandler in interface CDOViewpublic CDOUnitManager getUnitManager()
getUnitManager in interface CDOViewpublic java.lang.String getCommitComment()
CDOTransactiongetCommitComment in interface CDOTransactionCDOCommitInfo.getComment()public void setCommitComment(java.lang.String comment)
CDOTransactionsetCommitComment in interface CDOTransactionCDOCommitInfo.getComment()public void setCommittables(java.util.Set<? extends EObject> committables)
setCommittables in interface CDOTransactionpublic java.util.Set<? extends EObject> getCommittables()
getCommittables in interface CDOTransactionpublic boolean isEmpty()
isEmpty in interface IContainer<CDOResourceNode>public CDOResourceNode[] getElements()
getElements in interface IContainer<CDOResourceNode>public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object getAdapter(java.lang.Class adapter)
getAdapter in interface IAdaptablepublic static java.io.File createTempFile(CDOTransaction transaction) throws java.io.IOException
java.io.IOExceptionCopyright (c) 2004-2019 Eike Stepper (Loehne, 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