Class Store
- java.lang.Object
-
- org.eclipse.net4j.util.event.Notifier
-
- org.eclipse.net4j.util.lifecycle.Lifecycle
-
- org.eclipse.emf.cdo.spi.server.Store
-
- All Implemented Interfaces:
IStore
,InternalStore
,org.eclipse.net4j.util.event.INotifier
,org.eclipse.net4j.util.event.INotifier.INotifier2
,org.eclipse.net4j.util.lifecycle.IDeactivateable
,org.eclipse.net4j.util.lifecycle.ILifecycle
,org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation
- Direct Known Subclasses:
LongIDStore
public abstract class Store extends org.eclipse.net4j.util.lifecycle.Lifecycle implements InternalStore
If the meaning of this type isn't clear, there really should be more of a description here...- Since:
- 2.0
- Author:
- Eike Stepper
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation
-
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2
-
Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.spi.server.InternalStore
InternalStore.NoChangeSets, InternalStore.NoCommitInfos, InternalStore.NoDurableLocking, InternalStore.NoExternalReferences, InternalStore.NoFeatureMaps, InternalStore.NoHandleRevisions, InternalStore.NoLargeObjects, InternalStore.NoQueryXRefs, InternalStore.NoRawAccess
-
Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.server.IStore
IStore.CanHandleClientAssignedIDs, IStore.ChangeFormat, IStore.RevisionParallelism, IStore.RevisionTemporality
-
-
Field Summary
Fields Modifier and Type Field Description static long
UNSPECIFIED_DATE
Deprecated.Use CDOBranchPoint.UNSPECIFIED_DATE
-
Constructor Summary
Constructors Constructor Description Store(java.lang.String type)
Store(java.lang.String type, java.util.Set<CDOID.ObjectType> objectIDTypes, java.util.Set<IStore.ChangeFormat> supportedChangeFormats, java.util.Set<IStore.RevisionTemporality> supportedRevisionTemporalities, java.util.Set<IStore.RevisionParallelism> supportedRevisionParallelisms)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static IStoreAccessor.QueryResourcesContext.ExactMatch
createExactMatchContext(CDOID folderID, java.lang.String name, CDOBranchPoint branchPoint)
protected abstract IStoreAccessor
createReader(ISession session)
Creates and returns a newIStoreAccessor
instance.InternalCDORevision
createRevision(EClass eClass, CDOID id)
protected abstract IStoreAccessor
createWriter(ITransaction transaction)
Creates and returns a newIStoreAccessor
instance.org.eclipse.net4j.util.om.monitor.ProgressDistributor
getIndicatingCommitDistributor()
int
getLastBranchID()
Returns the id of the last branch that has been created in this store.long
getLastCommitTime()
Returns the time stamp of the last successful commit operation.int
getLastLocalBranchID()
Returns the id of the last local branch that has been created in this store.long
getLastNonLocalCommitTime()
Returns the time stamp of the last successful commit operation to a non-localbranch
.int
getNextBranchID()
int
getNextLocalBranchID()
java.util.Set<CDOID.ObjectType>
getObjectIDTypes()
IStoreAccessor
getReader(ISession session)
Returns a reader that can be used to read from this store in the context of the given session.protected abstract StoreAccessorPool
getReaderPool(ISession session, boolean forReleasing)
Returns apool
that may containIStoreAccessor
instances that are compatible with the given session.InternalRepository
getRepository()
IStore.RevisionParallelism
getRevisionParallelism()
IStore.RevisionTemporality
getRevisionTemporality()
java.util.Set<IStore.ChangeFormat>
getSupportedChangeFormats()
java.util.Set<IStore.RevisionParallelism>
getSupportedRevisionParallelisms()
java.util.Set<IStore.RevisionTemporality>
getSupportedRevisionTemporalities()
java.lang.String
getType()
IStoreAccessor
getWriter(ITransaction transaction)
Returns a writer that can be used to write to this store in the context of the given view.protected abstract StoreAccessorPool
getWriterPool(IView view, boolean forReleasing)
Returns apool
that may containIStoreAccessor
instances that are compatible with the given session.static java.lang.String
idToString(CDOID id)
boolean
isDropAllDataOnActivate()
protected void
releaseAccessor(StoreAccessorBase accessor)
protected static <T> java.util.Set<T>
set(T... elements)
void
setDropAllDataOnActivate(boolean dropAllDataOnActivate)
void
setLastBranchID(int lastBranchID)
void
setLastCommitTime(long lastCommitTime)
void
setLastLocalBranchID(int lastLocalBranchID)
void
setLastNonLocalCommitTime(long lastNonLocalCommitTime)
protected void
setObjectIDTypes(java.util.Set<CDOID.ObjectType> objectIDTypes)
void
setRepository(IRepository repository)
void
setRevisionParallelism(IStore.RevisionParallelism revisionParallelism)
void
setRevisionTemporality(IStore.RevisionTemporality revisionTemporality)
static CDOID
stringToID(java.lang.String string)
-
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString
-
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
activate, deactivate, getLifecycleState, isActive
-
Methods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
-
Methods inherited from interface org.eclipse.emf.cdo.spi.server.InternalStore
isLocal, setCreationTime
-
Methods inherited from interface org.eclipse.emf.cdo.server.IStore
createObjectID, getCreationTime, getPersistentProperties, isFirstStart, removePersistentProperties, setPersistentProperties
-
-
-
-
Field Detail
-
UNSPECIFIED_DATE
@Deprecated public static final long UNSPECIFIED_DATE
Deprecated.Use CDOBranchPoint.UNSPECIFIED_DATE- Since:
- 3.0
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Store
public Store(java.lang.String type, java.util.Set<CDOID.ObjectType> objectIDTypes, java.util.Set<IStore.ChangeFormat> supportedChangeFormats, java.util.Set<IStore.RevisionTemporality> supportedRevisionTemporalities, java.util.Set<IStore.RevisionParallelism> supportedRevisionParallelisms)
- Since:
- 3.0
-
Store
public Store(java.lang.String type)
- Since:
- 4.2
-
-
Method Detail
-
getObjectIDTypes
public java.util.Set<CDOID.ObjectType> getObjectIDTypes()
- Specified by:
getObjectIDTypes
in interfaceIStore
- Since:
- 3.0
-
setObjectIDTypes
protected void setObjectIDTypes(java.util.Set<CDOID.ObjectType> objectIDTypes)
- Since:
- 4.0
-
getSupportedChangeFormats
public java.util.Set<IStore.ChangeFormat> getSupportedChangeFormats()
- Specified by:
getSupportedChangeFormats
in interfaceIStore
-
getSupportedRevisionTemporalities
public java.util.Set<IStore.RevisionTemporality> getSupportedRevisionTemporalities()
- Specified by:
getSupportedRevisionTemporalities
in interfaceIStore
-
getSupportedRevisionParallelisms
public final java.util.Set<IStore.RevisionParallelism> getSupportedRevisionParallelisms()
- Specified by:
getSupportedRevisionParallelisms
in interfaceIStore
-
getRevisionTemporality
public IStore.RevisionTemporality getRevisionTemporality()
- Specified by:
getRevisionTemporality
in interfaceIStore
-
setRevisionTemporality
public void setRevisionTemporality(IStore.RevisionTemporality revisionTemporality)
- Specified by:
setRevisionTemporality
in interfaceInternalStore
-
getRevisionParallelism
public IStore.RevisionParallelism getRevisionParallelism()
- Specified by:
getRevisionParallelism
in interfaceIStore
-
setRevisionParallelism
public void setRevisionParallelism(IStore.RevisionParallelism revisionParallelism)
- Specified by:
setRevisionParallelism
in interfaceInternalStore
-
getRepository
public InternalRepository getRepository()
- Specified by:
getRepository
in interfaceInternalStore
- Specified by:
getRepository
in interfaceIStore
- Since:
- 3.0
-
setRepository
public void setRepository(IRepository repository)
- Specified by:
setRepository
in interfaceInternalStore
-
isDropAllDataOnActivate
public boolean isDropAllDataOnActivate()
- Specified by:
isDropAllDataOnActivate
in interfaceInternalStore
- Since:
- 4.0
-
setDropAllDataOnActivate
public void setDropAllDataOnActivate(boolean dropAllDataOnActivate)
- Specified by:
setDropAllDataOnActivate
in interfaceInternalStore
- Since:
- 4.0
-
getLastBranchID
public int getLastBranchID()
Description copied from interface:IStore
Returns the id of the last branch that has been created in this store.- Specified by:
getLastBranchID
in interfaceIStore
- Since:
- 3.0
-
setLastBranchID
public void setLastBranchID(int lastBranchID)
- Specified by:
setLastBranchID
in interfaceInternalStore
- Since:
- 3.0
-
getNextBranchID
public int getNextBranchID()
- Specified by:
getNextBranchID
in interfaceInternalStore
- Since:
- 3.0
-
getLastLocalBranchID
public int getLastLocalBranchID()
Description copied from interface:IStore
Returns the id of the last local branch that has been created in this store.- Specified by:
getLastLocalBranchID
in interfaceIStore
- Since:
- 3.0
-
setLastLocalBranchID
public void setLastLocalBranchID(int lastLocalBranchID)
- Specified by:
setLastLocalBranchID
in interfaceInternalStore
- Since:
- 3.0
-
getNextLocalBranchID
public int getNextLocalBranchID()
- Specified by:
getNextLocalBranchID
in interfaceInternalStore
- Since:
- 3.0
-
getLastCommitTime
public long getLastCommitTime()
Description copied from interface:IStore
Returns the time stamp of the last successful commit operation.- Specified by:
getLastCommitTime
in interfaceIStore
- Since:
- 3.0
-
setLastCommitTime
public void setLastCommitTime(long lastCommitTime)
- Specified by:
setLastCommitTime
in interfaceInternalStore
- Since:
- 3.0
-
getLastNonLocalCommitTime
public long getLastNonLocalCommitTime()
Description copied from interface:IStore
Returns the time stamp of the last successful commit operation to a non-localbranch
.- Specified by:
getLastNonLocalCommitTime
in interfaceIStore
- Since:
- 3.0
-
setLastNonLocalCommitTime
public void setLastNonLocalCommitTime(long lastNonLocalCommitTime)
- Specified by:
setLastNonLocalCommitTime
in interfaceInternalStore
- Since:
- 3.0
-
getReader
public IStoreAccessor getReader(ISession session)
Description copied from interface:IStore
Returns a reader that can be used to read from this store in the context of the given session.- Specified by:
getReader
in interfaceIStore
- Parameters:
session
- The session that should be used as a context for read access ornull
. The store implementor is free to interpret and use the session in a manner suitable for him or ignore it at all. It is meant only as a hint. Implementor can use it as a key into a cache and/or register aLifecycleEventAdapter
with it to intercept cleanup on session close. Note however that the session can benull
, for example during startup of the server while the repositories are initialized but before any user session has been opened.- Returns:
- a reader that can be used to read from this store in the context of the given session, never
null
.
-
getWriter
public IStoreAccessor getWriter(ITransaction transaction)
Description copied from interface:IStore
Returns a writer that can be used to write to this store in the context of the given view. The given view is always marked as a transaction.- Specified by:
getWriter
in interfaceIStore
- Parameters:
transaction
- The view that must be used as a context for write access. The store implementor is free to interpret and use the view in a manner suitable for him or ignore it at all. It is meant only as a hint. Implementor can use it as a key into a cache and/or register aLifecycleEventAdapter
with it to intercept cleanup on view close.- Returns:
- a writer that can be used to write to this store in the context of the given view, never
null
.
-
getIndicatingCommitDistributor
public org.eclipse.net4j.util.om.monitor.ProgressDistributor getIndicatingCommitDistributor()
- Specified by:
getIndicatingCommitDistributor
in interfaceIStore
-
createRevision
public InternalCDORevision createRevision(EClass eClass, CDOID id)
- Since:
- 3.0
-
releaseAccessor
protected void releaseAccessor(StoreAccessorBase accessor)
- Since:
- 4.0
-
getReaderPool
protected abstract StoreAccessorPool getReaderPool(ISession session, boolean forReleasing)
Returns apool
that may containIStoreAccessor
instances that are compatible with the given session. The implementor may returnnull
to indicate that no pooling occurs. It's also left to the implementors choice how to determine the appropriate pool instance to be used for the given session, for example it could always return the same pool instance, regardless of the given session.If the implementor of this method decides to create pools that are only compatible with certain sessions or views, then it is his responsibility to listen to
REMOVED
events sent by either theISessionManager
(indicating that a session is closed) or any of its sessions (indicating that a view is closed). Note: Closing a session implies that all contained views are closed sliently without firing respective events!- Parameters:
session
- The context which the pool must be compatible with. Must not benull
.forReleasing
- Enables lazy pool creation. The implementor is not supposed to create a new pool iffalse
is passed. Iftrue
is passed it's up to the implementor whether to create a new pool or not.
-
getWriterPool
protected abstract StoreAccessorPool getWriterPool(IView view, boolean forReleasing)
Returns apool
that may containIStoreAccessor
instances that are compatible with the given session. The implementor may returnnull
to indicate that no pooling occurs. It's also left to the implementors choice how to determine the appropriate pool instance to be used for the given session, for example it could always return the same pool instance, regardless of the given session.If the implementor of this method decides to create pools that are only compatible with certain sessions or views, then it is his responsibility to listen to
REMOVED
events sent by either theISessionManager
(indicating that a session is closed) or any of its sessions (indicating that a view is closed). Note: Closing a session implies that all contained views are closed sliently without firing respective events!- Parameters:
view
- The context which the pool must be compatible with. Must not benull
.forReleasing
- Enables lazy pool creation. The implementor is not supposed to create a new pool iffalse
is passed. Iftrue
is passed it's up to the implementor whether to create a new pool or not.
-
createReader
protected abstract IStoreAccessor createReader(ISession session)
Creates and returns a newIStoreAccessor
instance. The caller of this method is responsible foractivating
the new instance.
-
createWriter
protected abstract IStoreAccessor createWriter(ITransaction transaction)
Creates and returns a newIStoreAccessor
instance. The caller of this method is responsible foractivating
the new instance.
-
set
@SafeVarargs protected static <T> java.util.Set<T> set(T... elements)
-
idToString
public static java.lang.String idToString(CDOID id)
- Since:
- 4.0
-
stringToID
public static CDOID stringToID(java.lang.String string)
- Since:
- 4.0
-
createExactMatchContext
public static IStoreAccessor.QueryResourcesContext.ExactMatch createExactMatchContext(CDOID folderID, java.lang.String name, CDOBranchPoint branchPoint)
- Since:
- 3.0
-
-