Interface CDOView

    • Field Detail

      • PROP_TIME_MACHINE_DISABLED

        static final java.lang.String PROP_TIME_MACHINE_DISABLED
        Since:
        4.5
        See Also:
        Constant Field Values
    • Method Detail

      • getViewLock

        java.util.concurrent.locks.Lock getViewLock()
        Since:
        4.5
      • syncExec

        void syncExec​(java.lang.Runnable runnable)
        Since:
        4.5
      • syncExec

        <V> V syncExec​(java.util.concurrent.Callable<V> callable)
                throws java.lang.Exception
        Throws:
        java.lang.Exception
        Since:
        4.5
      • getResourceSet

        org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
        Returns the resource set this view is associated with.

        Same as calling getViewSet().getResourceSet().

        See Also:
        CDOViewSet.getResourceSet()
      • getURIHandler

        org.eclipse.emf.ecore.resource.URIHandler getURIHandler()
      • setBranchPoint

        boolean setBranchPoint​(CDOBranch branch,
                               long timeStamp)
        Sets the 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.
        Returns:
        true if the branch point was changed, false otherwise.
        Since:
        3.0
      • isInvalidating

        boolean isInvalidating()
        Since:
        4.8
      • isInvalidationRunnerActive

        @Deprecated
        boolean isInvalidationRunnerActive()
        Deprecated.
        As of 4.7 use isInvalidating().
        Since:
        4.0
      • hasResource

        boolean hasResource​(java.lang.String path)
        Returns true if a resource with the given path exists in the repository, false. Applies to file resources, as well.
        See Also:
        getResource(String, boolean)
      • 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.

      • createResourceURI

        org.eclipse.emf.common.util.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.
        Since:
        4.4
      • queryResources

        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.
        Parameters:
        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.
      • queryResourcesAsync

        org.eclipse.net4j.util.collection.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. The underlying query will be executed asynchronously.
        Parameters:
        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.
      • queryInstances

        <T extends org.eclipse.emf.ecore.EObject> java.util.List<T> queryInstances​(org.eclipse.emf.ecore.EClass type)
        Returns a list of the instances of the given type.
        Since:
        4.3
      • queryInstancesAsync

        <T extends org.eclipse.emf.ecore.EObject> org.eclipse.net4j.util.collection.CloseableIterator<T> queryInstancesAsync​(org.eclipse.emf.ecore.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 org.eclipse.emf.ecore.EObject> org.eclipse.net4j.util.collection.CloseableIterator<T> queryInstancesAsync​(org.eclipse.emf.ecore.EClass type,
                                                                                                                             boolean exact)
        Returns an iterator over the instances of the given type. The underlying query will be executed asynchronously.
        Since:
        4.6
      • getObjects

        java.util.Map<CDOID,​CDOObject> getObjects​(java.util.Collection<CDOID> ids)
        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

        CDOObject getObject​(CDOID id,
                            boolean loadOnDemand)
        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, or null if there isn't one and loadOnDemand is false.
      • getObject

        <T extends org.eclipse.emf.ecore.EObject> T getObject​(T objectFromDifferentView)
        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 passed null is returned.
      • isObjectRegistered

        boolean isObjectRegistered​(CDOID id)
        Returns true if an object with the given id is currently registered in this view, false otherwise.
      • reload

        @Deprecated
        int reload​(CDOObject... objects)
        Deprecated.
        As of 4.3 no longer supported because it is unsafe to reload single objects.
        Reloads the given objects from the repository.
      • refreshLockStates

        void refreshLockStates​(java.util.function.Consumer<CDOLockState> consumer)
        Refreshes the lock states of this view 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

        CDOLockState[] getLockStates​(java.util.Collection<CDOID> ids)
        Get an array of lock states corresponding to the specified collection of ids. If the collection of ids is empty, lock states of all locked objects are returned.
        Since:
        4.6
      • getLockStatesOfObjects

        CDOLockState[] getLockStatesOfObjects​(java.util.Collection<? extends CDOObject> objects)
        Get an array of lock states corresponding to the specified collection of objects. If the collection of objects is empty, lock states of all locked objects are returned.
        Since:
        4.6
      • lockObjects

        void lockObjects​(java.util.Collection<? extends CDOObject> objects,
                         org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType,
                         long timeout)
                  throws java.lang.InterruptedException
        Locks the given objects. Once the objects are locked, they will not be changed remotely or go in conflict state.
        Throws:
        java.lang.InterruptedException
        Since:
        3.0
      • lockObjects

        void lockObjects​(java.util.Collection<? extends CDOObject> objects,
                         org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType,
                         long timeout,
                         boolean recursive)
                  throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • unlockObjects

        void unlockObjects​(java.util.Collection<? extends CDOObject> objects,
                           org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType)
        Unlocks the given locked objects of this view.
      • unlockObjects

        void unlockObjects​(java.util.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
      • disableDurableLocking

        void disableDurableLocking​(boolean releaseLocks)
        Disables the storage of all information that's needed to 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.
        Since:
        4.1
        See Also:
        enableDurableLocking()
      • addObjectHandler

        void addObjectHandler​(CDOObjectHandler handler)
        Since:
        3.0
      • removeObjectHandler

        void removeObjectHandler​(CDOObjectHandler handler)
        Since:
        3.0
      • createQuery

        CDOQuery createQuery​(java.lang.String language,
                             java.lang.String queryString,
                             java.lang.Object context)
        Since:
        4.0