Interface IStoreAccessor

    • Method Detail

      • getStore

        IStore getStore()
        Returns the store this accessor is associated with.
      • getSession

        InternalSession getSession()
        Returns the session this accessor is associated with.
        Since:
        3.0
      • getTransaction

        ITransaction getTransaction()
        Returns the transaction this accessor is associated with if isReader() returns false, null otherwise.
        Since:
        2.0
      • isReader

        boolean isReader()
        Returns true if this accessor has been configured for read-only access to the back-end, false otherwise.
        Since:
        2.0
      • loadPackageUnit

        org.eclipse.emf.ecore.EPackage[] loadPackageUnit​(InternalCDOPackageUnit packageUnit)
        Demand loads a given package proxy that has been created on startup of the repository.

        This method must only load the given package, not possible contained packages.

        Since:
        2.0
      • handleRevisions

        void handleRevisions​(org.eclipse.emf.ecore.EClass eClass,
                             CDOBranch branch,
                             long timeStamp,
                             boolean exactTime,
                             CDORevisionHandler handler)
        Passes all revisions of the store to the handler if all of the following conditions are met:
        • The eClass parameter is null or equal to revision.getEClass().
        • The branch parameter is null or equal to revision.getBranch().
        • One of the following conditions is met:
          • The timeStamp parameter is INVALID.
          • The exactTime parameter is true and the timeStamp parameter is UNSPECIFIED or equal to revision.getTimeStamp().
          • The exactTime parameter is false and the timeStamp parameter is between revision.getTimeStamp() and revision.getRevised().
        Since:
        4.0
      • readChangeSet

        java.util.Set<CDOID> readChangeSet​(org.eclipse.net4j.util.om.monitor.OMMonitor monitor,
                                           CDOChangeSetSegment... segments)
        Returns a set of CDOIDs that have at least one revision in any of the passed branches and time ranges. DetachedCDORevisions must also be considered!
        Since:
        4.0
      • readResourceID

        CDOID readResourceID​(CDOID folderID,
                             java.lang.String name,
                             CDOBranchPoint branchPoint)
        Returns the CDOID of the resource node with the given folderID and name if a resource with this folderID and name exists in the store, null otherwise.
        Since:
        3.0
      • queryLobs

        void queryLobs​(java.util.List<byte[]> ids)
        Determines which of the large objects identified by the given IDs are known in the backend represented by this IStoreAccessor by removing the unknown IDs from the passed collection.

        The identifier of a large object is the SHA-1 digest of the content of this large object.

        Usage context: This method is only called in the context of a commit operation of a client transaction if that transaction contains additions of or changes to large objects.

        Parameters:
        ids - the collection of large object IDs that the unknown IDs are supposed to be removed from.
        Since:
        4.0
      • loadLob

        void loadLob​(byte[] id,
                     java.io.OutputStream out)
              throws java.io.IOException
        Serializes the content of the large object identified by the given ID to the given stream.

        The identifier of a large object is the SHA-1 digest of the content of this large object.

        Parameters:
        id - the ID of the large object whose content is to be written to the stream.
        Throws:
        java.io.IOException - if the stream could not be written to.
        Since:
        4.0
      • handleLobs

        void handleLobs​(long fromTime,
                        long toTime,
                        CDOLobHandler handler)
                 throws java.io.IOException
        Throws:
        java.io.IOException
        Since:
        4.0
      • writePackageUnits

        void writePackageUnits​(InternalCDOPackageUnit[] packageUnits,
                               org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
        Since:
        2.0
      • commit

        void commit​(org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
        Flushes to the back-end and makes available the data for others.

        Note: write(InternalCommitContext, OMMonitor) and commit(OMMonitor) could be called from different threads.

        Note: Implementors should detect if dirty write occurred. In this case it should throw an exception.

         if (revision.getVersion() != revisionDelta.getOriginVersion())
         {
           throw new ConcurrentModificationException("Trying to update object " + revisionDelta.getID()
               + " that was already modified");
         }
         
        Since:
        2.0
      • release

        void release()