public interface CDOView extends CDOCommonView, CDOUpdatable, CDOCommitHistory.Provider<CDOObject,CDOObjectHistory>, IContainer<CDOResourceNode>
session at a
specific time at a specific branch.
If the time of a view is unspecified the objects
provided and managed by that view always show the latest state the repository graph.
Objects that are accessed through this view are immutable for the client. Each attempt to call a mutator on one of
these objects or one of their feature lists will result in a ReadOnlyException being thrown immediately.
Mutable objects can be provided by a transaction.
A view is opened through API of the underlying session like this:
CDOSession session = ... CDOView view = session.openView(); ...
| Modifier and Type | Interface and Description |
|---|---|
static interface |
CDOView.Options
Encapsulates a set of notifying
view configuration options. |
IContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROP_TIME_MACHINE_DISABLED |
INVALID_DATE, UNSPECIFIED_DATENO_TIMEOUT| Modifier and Type | Method and Description |
|---|---|
void |
addObjectHandler(CDOObjectHandler handler) |
void |
addRegistrationHandler(CDORegistrationHandler handler) |
CDOChangeSetData |
compareRevisions(CDOBranchPoint source) |
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,
java.lang.Object context) |
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. |
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. |
CDOBinaryResource |
getBinaryResource(java.lang.String path) |
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. |
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() |
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. |
CDOResource |
getRootResource()
Returns the root resource of the repository.
|
CDOSession |
getSession()
Returns the
session this view was opened by. |
CDOTextResource |
getTextResource(java.lang.String path) |
CDOUnitManager |
getUnitManager() |
URIHandler |
getURIHandler() |
java.util.concurrent.locks.Lock |
getViewLock() |
CDOViewSet |
getViewSet()
Returns the
view set this view is associated with. |
boolean |
hasConflict()
Returns always
false. |
boolean |
hasResource(java.lang.String path)
Returns
true if a resource with the given path exists in the repository, false. |
boolean |
isDirty()
Returns always
false. |
boolean |
isInvalidating() |
boolean |
isInvalidationRunnerActive()
Deprecated.
As of 4.7 use
isInvalidating(). |
boolean |
isLegacyModeEnabled()
Deprecated.
As of 4.2 the legacy mode is always enabled.
|
boolean |
isObjectRegistered(CDOID id)
|
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) |
CDOView.Options |
options()
Returns the
options of this view. |
<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.
As of 4.3 no longer supported because it is unsafe to reload single objects.
|
void |
removeObjectHandler(CDOObjectHandler handler) |
void |
removeRegistrationHandler(CDORegistrationHandler handler) |
boolean |
setBranch(CDOBranch branch)
Same as calling
setBranchPoint(branch, getTimeStamp()). |
boolean |
setBranch(CDOBranch branch,
IProgressMonitor monitor)
Same as
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
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
setBranchPoint(CDOBranchPoint) with a IProgressMonitor . |
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. |
boolean |
setTimeStamp(long timeStamp)
Same as calling
setBranchPoint(getBranch(), timeStamp). |
boolean |
setTimeStamp(long timeStamp,
IProgressMonitor monitor)
Same as
setTimeStamp(long) with IProgressMonitor. |
<V> V |
syncExec(java.util.concurrent.Callable<V> callable) |
void |
syncExec(java.lang.Runnable runnable) |
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) |
getDurableLockingID, getViewID, isHistorical, isReadOnlygetSessionID, isDurableViewgetBranch, getTimeStampgetRevisionpropertiesgetAdaptergetLastUpdateTime, runAfterUpdate, waitForUpdate, waitForUpdategetHistory, getHistorygetElements, isEmptyaddListener, getListeners, hasListeners, removeListenerstatic final java.lang.String PROP_TIME_MACHINE_DISABLED
CDOSession getSession()
session this view was opened by.getSession in interface CDOCommonViewnull if this view is closed.Closeable.close(),
Closeable.isClosed(),
CDOViewContainer.openView(),
CDOTransactionContainer.openTransaction()CDOViewProvider getProvider()
provider that has opened this view.CDOViewSet getViewSet()
view set this view is associated with.null.CDOViewSet.getViews()java.util.concurrent.locks.Lock getViewLock()
void syncExec(java.lang.Runnable runnable)
<V> V syncExec(java.util.concurrent.Callable<V> callable)
throws java.lang.Exception
java.lang.ExceptionResourceSet getResourceSet()
resource set this view is associated with.
Same as calling getViewSet().getResourceSet().
CDOViewSet.getResourceSet()URIHandler getURIHandler()
CDOUnitManager getUnitManager()
boolean setBranchPoint(CDOBranch branch, long timeStamp)
branch 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.true if the branch point was changed, false otherwise.boolean setBranchPoint(CDOBranch branch, long timeStamp, IProgressMonitor monitor)
setBranchPoint(CDOBranch, long) with a IProgressMonitor.boolean setBranchPoint(CDOBranchPoint branchPoint)
setBranchPoint(branchPoint.getBranch(),
branchPoint.getTimeStamp()).boolean setBranchPoint(CDOBranchPoint branchPoint, IProgressMonitor monitor)
setBranchPoint(CDOBranchPoint) with a IProgressMonitor .boolean setBranch(CDOBranch branch)
setBranchPoint(branch, getTimeStamp()).boolean setBranch(CDOBranch branch, IProgressMonitor monitor)
setBranch(CDOBranch) with IProgressMonitor.boolean setTimeStamp(long timeStamp)
setBranchPoint(getBranch(), timeStamp).boolean setTimeStamp(long timeStamp,
IProgressMonitor monitor)
setTimeStamp(long) with IProgressMonitor.boolean isInvalidating()
@Deprecated boolean isInvalidationRunnerActive()
isInvalidating().@Deprecated boolean isLegacyModeEnabled()
CDOUtil.setLegacyModeDefault(boolean)boolean isDirty()
false.
This method has a special implementation in CDOTransaction as well.
CDOTransaction.isDirty()boolean hasConflict()
false.
This method has a special implementation in CDOTransaction as well.
CDOTransaction.hasConflict()boolean hasResource(java.lang.String path)
true if a resource with the given path exists in the repository, false.
Applies to file resources, as well.getResource(String, boolean)CDOResource getResource(java.lang.String path, boolean loadOnDemand) throws CDOResourceNodeNotFoundException
CDOResourceNodeNotFoundExceptionResourceSet.getResource(URI, boolean)CDOResource getResource(java.lang.String path) throws CDOResourceNodeNotFoundException
getResource(String, true).CDOResourceNodeNotFoundExceptionResourceSet.getResource(URI, boolean)CDOTextResource getTextResource(java.lang.String path) throws CDOResourceNodeNotFoundException
CDOResourceNodeNotFoundExceptionCDOBinaryResource getBinaryResource(java.lang.String path) throws CDOResourceNodeNotFoundException
CDOResourceNodeNotFoundExceptionCDOResourceNode getResourceNode(java.lang.String path) throws CDOResourceNodeNotFoundException
null.CDOException - if no such resource node exists.CDOResourceNodeNotFoundExceptionCDOResourceFolder getResourceFolder(java.lang.String path) throws CDOResourceNodeNotFoundException
CDOResourceNodeNotFoundExceptionCDOResource getRootResource()
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.
void setResourcePathCache(java.util.Map<java.lang.String,CDOID> resourcePathCache)
map 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>().
URI createResourceURI(java.lang.String path)
URI that can be used in ResourceSet.getResource(URI, boolean) to load the resource with the specified path.java.util.List<CDOResourceNode> queryResources(CDOResourceFolder folder, java.lang.String name, boolean exactMatch)
folder - 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.CloseableIterator<CDOResourceNode> queryResourcesAsync(CDOResourceFolder folder, java.lang.String name, boolean exactMatch)
folder - 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.<T extends EObject> java.util.List<T> queryInstances(EClass type)
<T extends EObject> CloseableIterator<T> queryInstancesAsync(EClass type)
<T extends EObject> CloseableIterator<T> queryInstancesAsync(EClass type, boolean exact)
java.util.List<CDOObjectReference> queryXRefs(CDOObject targetObject, EReference... sourceReferences)
object references that represent the cross references to the specified
target object.targetObject - 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.queryXRefs(Set, EReference...),
queryXRefsAsync(Set, EReference...),
CDOUtil.wrapExternalObject(EObject, CDOView)java.util.List<CDOObjectReference> queryXRefs(java.util.Set<CDOObject> targetObjects, EReference... sourceReferences)
object references that represent the cross references to the specified
target objects.targetObjects - 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.queryXRefs(CDOObject, EReference...),
queryXRefsAsync(Set, EReference...),
CDOUtil.wrapExternalObject(EObject, CDOView)CloseableIterator<CDOObjectReference> queryXRefsAsync(java.util.Set<CDOObject> targetObjects, EReference... sourceReferences)
object references that represent the cross references to
the specified target objects. The underlying query will be executed asynchronously.targetObjects - 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.queryXRefs(CDOObject, EReference...),
queryXRefs(Set, EReference...),
CDOUtil.wrapExternalObject(EObject, CDOView)CDOObject getObject(CDOID id, boolean loadOnDemand)
loadOnDemand - whether to create and load the object, if it doesn't already exist.null, or null if there isn't
one and loadOnDemand is false.CDOObject getObject(CDOID id)
Same as getObject(id, true).
getObject(CDOID, boolean)<T extends EObject> T getObject(T objectFromDifferentView)
CDOObject it is returned unmodified.
IllegalArgumentException is
thrown.
null is passed null is returned.
boolean isObjectRegistered(CDOID id)
@Deprecated int reload(CDOObject... objects)
objects from the repository.CDOLockState[] getLockStates(java.util.Collection<CDOID> ids)
lock states corresponding to the specified collection of ids.
If the collection of ids is empty, lock states of all locked objects are returned.CDOLockState[] getLockStatesOfObjects(java.util.Collection<? extends CDOObject> objects)
lock states corresponding to the specified collection of objects.
If the collection of objects is empty, lock states of all locked objects are returned.void lockObjects(java.util.Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType, long timeout) throws java.lang.InterruptedException
java.lang.InterruptedExceptionvoid lockObjects(java.util.Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType, long timeout, boolean recursive) throws java.lang.InterruptedException
java.lang.InterruptedExceptionvoid unlockObjects(java.util.Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType)
void unlockObjects(java.util.Collection<? extends CDOObject> objects, IRWLockManager.LockType lockType, boolean recursive)
void unlockObjects()
@Deprecated java.lang.String enableDurableLocking(boolean enable)
enableDurableLocking() instead or disableDurableLocking(boolean), respectively.java.lang.String enableDurableLocking()
reopen 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.void disableDurableLocking(boolean releaseLocks)
reopen 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.enableDurableLocking()void addObjectHandler(CDOObjectHandler handler)
void removeObjectHandler(CDOObjectHandler handler)
CDOObjectHandler[] getObjectHandlers()
void addRegistrationHandler(CDORegistrationHandler handler)
void removeRegistrationHandler(CDORegistrationHandler handler)
CDORegistrationHandler[] getRegistrationHandlers()
CDOQuery createQuery(java.lang.String language, java.lang.String queryString)
createQuery(language, queryString, null).createQuery(String, String, Object)CDOQuery createQuery(java.lang.String language, java.lang.String queryString, java.lang.Object context)
CDOChangeSetData compareRevisions(CDOBranchPoint source)
CDOView.Options options()
CDOCommonViewoptions of this view.options in interface CDOCommonViewoptions in interface IOptionsContainerCopyright (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