Class 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
    • Field Detail

      • UNSPECIFIED_DATE

        @Deprecated
        public static final long UNSPECIFIED_DATE
        Deprecated.
        Use CDOBranchPoint.UNSPECIFIED_DATE
        Since:
        3.0
        See Also:
        Constant Field Values
    • Method Detail

      • getType

        public final java.lang.String getType()
        Specified by:
        getType in interface IStore
      • setObjectIDTypes

        protected void setObjectIDTypes​(java.util.Set<CDOID.ObjectType> objectIDTypes)
        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 interface IStore
        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 interface IStore
        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 interface IStore
        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-local branch.
        Specified by:
        getLastNonLocalCommitTime in interface IStore
        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 interface IStore
        Parameters:
        session - The session that should be used as a context for read access or null. 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 a LifecycleEventAdapter with it to intercept cleanup on session close. Note however that the session can be null, 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 interface IStore
        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 a LifecycleEventAdapter 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 interface IStore
      • releaseAccessor

        protected void releaseAccessor​(StoreAccessorBase accessor)
        Since:
        4.0
      • getReaderPool

        protected abstract StoreAccessorPool getReaderPool​(ISession session,
                                                           boolean forReleasing)
        Returns a pool that may contain IStoreAccessor instances that are compatible with the given session. The implementor may return null 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 the ISessionManager (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 be null.
        forReleasing - Enables lazy pool creation. The implementor is not supposed to create a new pool if false is passed. If true 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 a pool that may contain IStoreAccessor instances that are compatible with the given session. The implementor may return null 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 the ISessionManager (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 be null.
        forReleasing - Enables lazy pool creation. The implementor is not supposed to create a new pool if false is passed. If true 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 new IStoreAccessor instance. The caller of this method is responsible for activating the new instance.
      • createWriter

        protected abstract IStoreAccessor createWriter​(ITransaction transaction)
        Creates and returns a new IStoreAccessor instance. The caller of this method is responsible for activating 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