Interface CDOView
- All Superinterfaces:
CDOBranchPoint
,CDOBranchProvider
,CDOCommitHistory.Provider<CDOObject,
,CDOObjectHistory> CDOCommonView
,CDORevisionProvider
,CDOTimeProvider
,CDOUpdatable
,org.eclipse.net4j.util.collection.Closeable
,IAdaptable
,org.eclipse.net4j.util.container.IContainer<CDOResourceNode>
,org.eclipse.net4j.util.event.INotifier
,org.eclipse.net4j.util.options.IOptionsContainer
,org.eclipse.net4j.util.properties.IPropertiesContainer
- All Known Subinterfaces:
CDOTransaction
,InternalCDOTransaction
,InternalCDOView
- All Known Implementing Classes:
CDOPushTransaction
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(); ...
- Since:
- 2.0
- Author:
- Eike Stepper
- No Implement
- This interface is not intended to be implemented by clients.
- No Extend
- This interface is not intended to be extended by clients.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Encapsulates a set of notifyingview
configuration options.Nested 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_DATE
Fields inherited from interface org.eclipse.emf.cdo.util.CDOUpdatable
NO_TIMEOUT
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addObjectHandler
(CDOObjectHandler handler) void
compareRevisions
(CDOBranchPoint source) createQuery
(String language, String queryString) Same ascreateQuery(language, queryString, null)
.createQuery
(String language, String queryString, Object context) createResourceURI
(String path) Returns aURI
that can be used inResourceSet.getResource(URI, boolean)
to load the resource with the specified path.void
disableDurableLocking
(boolean releaseLocks) Disables the storage of all information that's needed toreopen
this view at a later point in time.Enables the storage of all information that's needed toreopen
this view at a later point in time.enableDurableLocking
(boolean enable) Deprecated.getBinaryResource
(String path) getLockStates
(Collection<CDOID> ids) Get an array oflock states
corresponding to the specified collection ofids
.getLockStates
(Collection<CDOID> ids, boolean loadOnDemand) Get an array oflock states
corresponding to the specified collection ofids
.getLockStatesOfObjects
(Collection<? extends CDOObject> objects) Get an array oflock states
corresponding 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.Returns theprovider
that 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 set
this view is associated with.Returns the root resource of the repository.Returns thesession
this view was opened by.getTextResource
(String path) getURI()
Returns theview set
this view is associated with.boolean
Returns alwaysfalse
.boolean
hasResource
(String path) Returnstrue
if a resource with the given path exists in the repository,false
.boolean
isDirty()
Returns alwaysfalse
.boolean
boolean
Deprecated.As of 4.7 useisInvalidating()
.boolean
Deprecated.As of 4.2 the legacy mode is always enabled.boolean
void
lockObjects
(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, long timeout) Locks the given objects.void
lockObjects
(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, long timeout, boolean recursive) options()
Returns theoptions
of this view.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 references
that represent the cross references to the specified target objects.queryXRefs
(CDOObject targetObject, EReference... sourceReferences) Returns a list ofobject references
that 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 references
that represent the cross references to the specified target objects.void
refreshLockStates
(Consumer<CDOLockState> consumer) Refreshes thelock states
of thisview
with the latest states from the repository.int
Deprecated.As of 4.3 no longer supported because it is unsafe to reload single objects.void
removeObjectHandler
(CDOObjectHandler handler) void
boolean
Same as callingsetBranchPoint(branch, getTimeStamp())
.boolean
setBranch
(CDOBranch branch, IProgressMonitor monitor) Same assetBranch(CDOBranch)
withIProgressMonitor
.boolean
setBranchPoint
(CDOBranch branch, long timeStamp) Sets thebranch
and the point in (repository) time this view should refer to.boolean
setBranchPoint
(CDOBranch branch, long timeStamp, IProgressMonitor monitor) Same assetBranchPoint(CDOBranch, long)
with aIProgressMonitor
.boolean
setBranchPoint
(CDOBranchPoint branchPoint) Same as callingsetBranchPoint(branchPoint.getBranch(), branchPoint.getTimeStamp())
.boolean
setBranchPoint
(CDOBranchPoint branchPoint, IProgressMonitor monitor) Same as callingsetBranchPoint(CDOBranchPoint)
with aIProgressMonitor
.void
setResourcePathCache
(Map<String, CDOID> resourcePathCache) Sets the newmap
to be used as a cache for variousget*Resource*(String path)
methods.boolean
setTimeStamp
(long timeStamp) Same as callingsetBranchPoint(getBranch(), timeStamp)
.boolean
setTimeStamp
(long timeStamp, IProgressMonitor monitor) Same assetTimeStamp(long)
withIProgressMonitor
.void
<V> V
void
Unlocks all locked objects of this view.void
unlockObjects
(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType) Unlocks the given locked objects of this view.void
unlockObjects
(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, boolean recursive) Methods inherited from interface org.eclipse.emf.cdo.common.branch.CDOBranchPoint
getBranch, getTimeStamp
Methods inherited from interface org.eclipse.emf.cdo.common.commit.CDOCommitHistory.Provider
getHistory, getHistory
Methods inherited from interface org.eclipse.emf.cdo.common.CDOCommonView
getDurableLockingID, getLockOwner, getSessionID, getViewID, isDurableView, isHistorical, isReadOnly
Methods inherited from interface org.eclipse.emf.cdo.common.revision.CDORevisionProvider
getRevision
Methods inherited from interface org.eclipse.emf.cdo.util.CDOUpdatable
getLastUpdateTime, runAfterUpdate, waitForUpdate, waitForUpdate
Methods inherited from interface org.eclipse.net4j.util.collection.Closeable
close, isClosed
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
Methods inherited from interface org.eclipse.net4j.util.container.IContainer
getElements, isEmpty
Methods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
Methods inherited from interface org.eclipse.net4j.util.properties.IPropertiesContainer
properties
-
Field Details
-
PROP_TIME_MACHINE_DISABLED
- Since:
- 4.5
- See Also:
-
PROP_LIFECYCLE_EXCEPTION_HANDLER
- Since:
- 4.19
- See Also:
-
-
Method Details
-
getSession
CDOSession getSession()Returns thesession
this view was opened by.- Specified by:
getSession
in interfaceCDOCommonView
- Returns:
- The session this view was opened by, or
null
if this view is closed. - See Also:
-
Closeable.close()
Closeable.isClosed()
CDOViewContainer.openView()
CDOTransactionContainer.openTransaction()
-
getProvider
CDOViewProvider getProvider()Returns theprovider
that has opened this view.- Since:
- 4.4
-
getURI
URI getURI()- Since:
- 4.24
-
getViewSet
CDOViewSet getViewSet()Returns theview set
this view is associated with.- Returns:
- The view set this view is associated with, never
null
. - See Also:
-
getViewLock
Lock getViewLock()- Since:
- 4.5
-
syncExec
- Since:
- 4.5
-
syncExec
- Throws:
Exception
- Since:
- 4.5
-
getResourceSet
ResourceSet getResourceSet()Returns theresource set
this view is associated with.Same as calling getViewSet().getResourceSet().
- See Also:
-
getURIHandler
URIHandler getURIHandler() -
getUnitManager
CDOUnitManager getUnitManager()- Since:
- 4.5
-
setBranchPoint
Sets thebranch
and the point in (repository) time this view should refer to.Objects
provided by this view will bevalid
at this time. The special valueUNSPECIFIED_DATE
denotes a "floating view" that always shows the latest state of the repository.- Returns:
true
if the branch point was changed,false
otherwise.- Since:
- 3.0
-
setBranchPoint
Same assetBranchPoint(CDOBranch, long)
with aIProgressMonitor
.- Since:
- 4.4
-
setBranchPoint
Same as callingsetBranchPoint(branchPoint.getBranch(), branchPoint.getTimeStamp())
.- Since:
- 3.0
-
setBranchPoint
Same as callingsetBranchPoint(CDOBranchPoint)
with aIProgressMonitor
.- Since:
- 4.4
-
setBranch
Same as callingsetBranchPoint(branch, getTimeStamp())
.- Since:
- 3.0
-
setBranch
Same assetBranch(CDOBranch)
withIProgressMonitor
.- Since:
- 4.4
-
setTimeStamp
boolean setTimeStamp(long timeStamp) Same as callingsetBranchPoint(getBranch(), timeStamp)
.- Since:
- 3.0
-
setTimeStamp
Same assetTimeStamp(long)
withIProgressMonitor
.- Since:
- 4.4
-
isInvalidating
boolean isInvalidating()- Since:
- 4.8
-
isInvalidationRunnerActive
Deprecated.As of 4.7 useisInvalidating()
.- Since:
- 4.0
-
isLegacyModeEnabled
Deprecated.As of 4.2 the legacy mode is always enabled.- Since:
- 3.0
- See Also:
-
isDirty
boolean isDirty()Returns alwaysfalse
.This method has a special implementation in
CDOTransaction
as well.- See Also:
-
hasConflict
boolean hasConflict()Returns alwaysfalse
.This method has a special implementation in
CDOTransaction
as well.- See Also:
-
hasResource
Returnstrue
if a resource with the given path exists in the repository,false
. Applies tofile resources
, as well.- See Also:
-
getResource
- Throws:
CDOResourceNodeNotFoundException
- See Also:
-
getResource
Same asgetResource(String, true)
.- Throws:
CDOResourceNodeNotFoundException
- See Also:
-
getTextResource
- Throws:
CDOResourceNodeNotFoundException
- Since:
- 4.2
-
getBinaryResource
- Throws:
CDOResourceNodeNotFoundException
- Since:
- 4.2
-
getResourceNode
Returns the resource node with the given path.- Returns:
- never
null
. - Throws:
CDOException
- if no such resource node exists.CDOResourceNodeNotFoundException
-
getResourceFolder
- Throws:
CDOResourceNodeNotFoundException
- Since:
- 4.2
-
getRootResource
CDOResource getRootResource()Returns the root resource of the repository.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. -
setResourcePathCache
Sets the newmap
to 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. Passingnull
disables resource path caching.The default value is
new HashMap<String, CDOID>()
. -
createResourceURI
Returns aURI
that can be used inResourceSet.getResource(URI, boolean)
to load the resource with the specified path.- Since:
- 4.4
-
queryResources
Returns a list of the resources in the given folder with a name equal to or starting with the value of the name parameter.- Parameters:
folder
- The folder to search in, ornull
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.
-
queryResourcesAsync
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. The underlying query will be executed asynchronously.- Parameters:
folder
- The folder to search in, ornull
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.
-
queryInstances
Returns a list of the instances of the given type.- Since:
- 4.3
-
queryInstancesAsync
<T extends EObject> org.eclipse.net4j.util.collection.CloseableIterator<T> queryInstancesAsync(EClass type) Returns an iterator over the instances of the given type. The underlying query will be executed asynchronously.- Since:
- 4.3
-
queryInstancesAsync
<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. The underlying query will be executed asynchronously.- Since:
- 4.6
-
queryXRefs
Returns a list ofobject references
that represent the cross references to the specified target object.- 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
Returns a list ofobject references
that represent the cross references to the specified target objects.- 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.- Since:
- 3.0
- See Also:
-
queryXRefsAsync
org.eclipse.net4j.util.collection.CloseableIterator<CDOObjectReference> queryXRefsAsync(Set<CDOObject> targetObjects, EReference... sourceReferences) Returns an iterator over theobject references
that represent the cross references to the specified target objects. The underlying query will be executed asynchronously.- 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.- Since:
- 3.0
- See Also:
-
getObjects
Returns the objects with the given CDOIDs.If objects are missing from the local cache they are loaded from the server in one round-trip.
- 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
Returns the object for the given CDOID.- Parameters:
loadOnDemand
- whether to create and load the object, if it doesn't already exist.- Returns:
- the object resolved by the CDOID if the id is not
null
, ornull
if there isn't one and loadOnDemand isfalse
.
-
getObject
Returns the object for the given CDOID.Same as
getObject(id, true)
.- See Also:
-
getObject
Takes 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
CDOObject
it is returned unmodified. - If the view of the given object is contained in a different session an
IllegalArgumentException
is thrown. - If
null
is passednull
is returned.
-
isObjectRegistered
-
reload
Deprecated.As of 4.3 no longer supported because it is unsafe to reload single objects.Reloads the givenobjects
from the repository. -
refreshLockStates
Refreshes thelock states
of thisview
with the latest states from the repository. If a lock state consumer is passed it is called for each resulting new lock state.- Since:
- 4.12
-
getLockStates
Get an array oflock states
corresponding to the specified collection ofids
. If the collection ofids
is empty,lock states
of all objects are returned.- Since:
- 4.6
-
getLockStates
Get an array oflock states
corresponding to the specified collection ofids
. If the collection ofids
is empty,lock states
of all objects are returned.- Since:
- 4.19
-
getLockStatesOfObjects
Get an array oflock states
corresponding to the specified collection ofobjects
. If the collection ofobjects
is empty,lock states
of all locked objects are returned.- Since:
- 4.6
-
lockObjects
void lockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, long timeout) throws InterruptedException Locks the given objects. Once the objects are locked, they will not be changed remotely or go in conflict state.- Throws:
InterruptedException
- Since:
- 3.0
-
lockObjects
void lockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, long timeout, boolean recursive) throws InterruptedException - Throws:
InterruptedException
-
unlockObjects
void unlockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType) Unlocks the given locked objects of this view. -
unlockObjects
void unlockObjects(Collection<? extends CDOObject> objects, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, boolean recursive) -
unlockObjects
void unlockObjects()Unlocks all locked objects of this view.- Since:
- 2.0
-
enableDurableLocking
Deprecated.UseenableDurableLocking()
instead ordisableDurableLocking(boolean)
, respectively.- Since:
- 4.0
-
enableDurableLocking
String enableDurableLocking()Enables the storage of all information that's needed toreopen
this 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 atransaction
and all the locks that are acquired or will be acquired while durable locking is enabled. -
disableDurableLocking
void disableDurableLocking(boolean releaseLocks) Disables the storage of all information that's needed toreopen
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 iftrue
is passed to thereleaseLocks
parameter.- Since:
- 4.1
- See Also:
-
addObjectHandler
- Since:
- 3.0
-
removeObjectHandler
- Since:
- 3.0
-
getObjectHandlers
CDOObjectHandler[] getObjectHandlers()- Since:
- 3.0
-
addRegistrationHandler
- Since:
- 4.6
-
removeRegistrationHandler
- Since:
- 4.6
-
getRegistrationHandlers
CDORegistrationHandler[] getRegistrationHandlers()- Since:
- 4.6
-
createQuery
Same ascreateQuery(language, queryString, null)
.- Since:
- 2.0
- See Also:
-
createQuery
- Since:
- 4.0
-
compareRevisions
- Since:
- 4.0
-
options
CDOView.Options options()Description copied from interface:CDOCommonView
Returns theoptions
of this view.- Specified by:
options
in interfaceCDOCommonView
- Specified by:
options
in interfaceorg.eclipse.net4j.util.options.IOptionsContainer
- Since:
- 2.0
-
enableDurableLocking()
instead ordisableDurableLocking(boolean)
, respectively.