org.eclipse.emf.cdo.server
Interface IStoreAccessor

All Superinterfaces:
IQueryHandlerProvider
All Known Subinterfaces:
IDBStoreAccessor, IHibernateStoreAccessor
All Known Implementing Classes:
LongIDStoreAccessor, StoreAccessor

public interface IStoreAccessor
extends IQueryHandlerProvider


Nested Class Summary
static interface IStoreAccessor.AdditionalRevisionCache
           
static interface IStoreAccessor.CommitContext
          Represents the state of a single, logical commit operation which is driven through multiple calls to several methods on the IStoreAccessor API.
static interface IStoreAccessor.QueryResourcesContext
           
 
Method Summary
 void commit(org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
          Flushes to the back-end and makes available the data for others.
 IStoreChunkReader createChunkReader(InternalCDORevision revision, org.eclipse.emf.ecore.EStructuralFeature feature)
           
 ISession getSession()
          Returns the session this accessor is associated with.
 IStore getStore()
          Returns the store this accessor is associated with.
 ITransaction getTransaction()
          Returns the transaction this accessor is associated with if isReader() returns false, null otherwise.
 boolean isReader()
          Returns true if this accessor has been configured for read-only access to the back-end, false otherwise.
 org.eclipse.emf.ecore.EPackage[] loadPackageUnit(InternalCDOPackageUnit packageUnit)
          Demand loads a given package proxy that has been created on startup of the repository.
 void queryResources(IStoreAccessor.QueryResourcesContext context)
           
 java.util.Collection<InternalCDOPackageUnit> readPackageUnits()
           
 CDOID readResourceID(CDOID folderID, java.lang.String name, long timeStamp)
          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.
 InternalCDORevision readRevision(CDOID id, int listChunk, IStoreAccessor.AdditionalRevisionCache cache)
          Reads a current revision (i.e. one with revised == 0) from the back-end.
 InternalCDORevision readRevisionByTime(CDOID id, int listChunk, IStoreAccessor.AdditionalRevisionCache cache, long timeStamp)
          Reads a revision from the back-end that was valid at the given timeStamp.
 InternalCDORevision readRevisionByVersion(CDOID id, int listChunk, IStoreAccessor.AdditionalRevisionCache cache, int version)
          Reads a revision with the given version from the back-end.
 void refreshRevisions()
          TODO Clarify the meaning of refreshRevisions()
 void release()
           
 void rollback()
          Note: write(CommitContext, OMMonitor) and rollback() could be called from different threads.
 InternalCDORevision verifyRevision(InternalCDORevision revision)
           
 void write(IStoreAccessor.CommitContext context, org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
          Called before committing.
 void writePackageUnits(InternalCDOPackageUnit[] packageUnits, org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
           
 
Methods inherited from interface org.eclipse.emf.cdo.server.IQueryHandlerProvider
getQueryHandler
 

Method Detail

getStore

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


release

void release()

isReader

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

Since:
2.0

getSession

ISession getSession()
Returns the session this accessor is associated with.

Since:
2.0

createChunkReader

IStoreChunkReader createChunkReader(InternalCDORevision revision,
                                    org.eclipse.emf.ecore.EStructuralFeature feature)
Since:
2.0

readPackageUnits

java.util.Collection<InternalCDOPackageUnit> readPackageUnits()
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.

It's left to the implementor's choice whether to load the ecore xml at this time already. In case it is not loaded at this time readPackageEcore() is called later on demand.

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

Since:
2.0
See Also:
InternalEPackage

readRevision

InternalCDORevision readRevision(CDOID id,
                                 int listChunk,
                                 IStoreAccessor.AdditionalRevisionCache cache)
Reads a current revision (i.e. one with revised == 0) from the back-end. Returns null if the id is invalid.

Since:
2.0

readRevisionByVersion

InternalCDORevision readRevisionByVersion(CDOID id,
                                          int listChunk,
                                          IStoreAccessor.AdditionalRevisionCache cache,
                                          int version)
Reads a revision with the given version from the back-end. This method will only be called by the framework if IRepository.isSupportingAudits() is true. Returns null if the id is invalid.

Since:
2.0

readRevisionByTime

InternalCDORevision readRevisionByTime(CDOID id,
                                       int listChunk,
                                       IStoreAccessor.AdditionalRevisionCache cache,
                                       long timeStamp)
Reads a revision from the back-end that was valid at the given timeStamp. This method will only be called by the framework if IRepository.isSupportingAudits() is true. Returns null if the id is invalid.

Since:
2.0

readResourceID

CDOID readResourceID(CDOID folderID,
                     java.lang.String name,
                     long timeStamp)
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:
2.0

verifyRevision

InternalCDORevision verifyRevision(InternalCDORevision revision)
Since:
2.0

refreshRevisions

void refreshRevisions()
TODO Clarify the meaning of refreshRevisions()

Since:
2.0

queryResources

void queryResources(IStoreAccessor.QueryResourcesContext context)
Since:
2.0

getTransaction

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

Since:
2.0

writePackageUnits

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

write

void write(IStoreAccessor.CommitContext context,
           org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
Called before committing. An instance of this accessor represents an instance of a back-end transaction. Could be called multiple times before commit it called. commit(OMMonitor) or rollback() will be called after any numbers of write(CommitContext, OMMonitor).

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

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(CommitContext, 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

rollback

void rollback()
Note: write(CommitContext, OMMonitor) and rollback() could be called from different threads.

Since:
2.0

Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
All Rights Reserved.