Interface InternalSession
- All Superinterfaces:
AutoCloseable, CDOCommonSession, CDOCommonSession.Options, CDOIDProvider, CDOLobLoader, CDOPermissionProvider, org.eclipse.net4j.util.collection.Closeable, org.eclipse.net4j.util.collection.Entity.Store.Provider, IAdaptable, org.eclipse.net4j.util.container.IContainer<IView>, org.eclipse.net4j.util.concurrent.IExecutorServiceProvider, org.eclipse.net4j.util.event.INotifier, org.eclipse.net4j.util.options.IOptions, org.eclipse.net4j.util.options.IOptionsContainer, org.eclipse.net4j.util.properties.IPropertiesContainer, ISession, org.eclipse.net4j.util.security.IUserAware
public interface InternalSession
extends ISession, CDOIDProvider, CDOPermissionProvider, CDOCommonSession.Options, org.eclipse.net4j.util.concurrent.IExecutorServiceProvider, org.eclipse.net4j.util.collection.Entity.Store.Provider
Server representation of one connected client session. It owns that client's views and protocol, supplies ID and
permission context for requests, and projects repository notifications—including ordered lock changes—into the
state visible to that client.
- Since:
- 4.3
- Author:
- Eike Stepper
- No Implement
- This interface is not intended to be implemented by clients.
- No Extend
- This interface is not intended to be extended by clients.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a position reserved in this session's lock-change sequence.static interfaceThe session-specific result of a completed lock-change reservation.Nested classes/interfaces inherited from interface CDOCommonSession
CDOCommonSession.OptionsNested classes/interfaces inherited from interface CDOCommonSession.Options
CDOCommonSession.Options.LockNotificationEvent, CDOCommonSession.Options.LockNotificationMode, CDOCommonSession.Options.LockNotificationModeEvent, CDOCommonSession.Options.PassiveUpdateEvent, CDOCommonSession.Options.PassiveUpdateModeNested classes/interfaces inherited from interface CDOPermissionProvider
CDOPermissionProvider.ConstantNested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer
org.eclipse.net4j.util.container.IContainer.Modifiable<E>, org.eclipse.net4j.util.container.IContainer.Persistable<E>, org.eclipse.net4j.util.container.IContainer.Persistence<E>Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ThreadLocal<Boolean> Selects a thread-local user ID holder for protocol-free sessions constructed synchronously inside the current lexical scope.static final intFields inherited from interface CDOIDProvider
NOOPFields inherited from interface CDOPermissionProvider
NONE, READ, WRITE -
Method Summary
Modifier and TypeMethodDescriptionvoidWaits until all reserved lock changes for this session have completed.voidcollectContainedRevisions(InternalCDORevision revision, CDOBranchPoint branchPoint, int referenceChunk, Set<CDOID> revisions, List<CDORevision> additionalRevisions) Returns the complete modern collection-loading configuration snapshot.longlongReturns the last lock modification count assigned to this server session.getView(int viewID) getViews()booleanReturns whether all reserved lock changes for this session have completed.booleanReturns whether a lock state belongs in a snapshot for this session.booleanopenTransaction(int viewID, CDOBranchPoint branchPoint) openTransaction(int viewID, CDOBranchPoint branchPoint, String durableLockingID) openView(int viewID, CDOBranchPoint branchPoint) openView(int viewID, CDOBranchPoint branchPoint, String durableLockingID) reserveLockChange(boolean forceFull) Reserves this session's place in the lock-change notification sequence.voidsendBranchNotification(CDOBranchChangedEvent.ChangeKind changeKind, CDOBranch... branches) voidDeprecated.voidsendBranchNotification(InternalCDOBranch branch, CDOBranchChangedEvent.ChangeKind changeKind) Deprecated.As of 4.15 usesendBranchNotification(ChangeKind, CDOBranch...).voidsendCommitNotification(CDOCommitInfo commitInfo) Deprecated.As of 4.2 usesendCommitNotification(CDOCommitInfo, boolean).voidsendCommitNotification(CDOCommitInfo commitInfo, boolean clearResourcePathCache) Deprecated.As of 4.3 usesendCommitNotification(CommitNotificationInfo).voidvoidsendLockNotification(CDOLockChangeInfo lockChangeInfo) voidSends the visible result of a reserved lock change with its assigned sequence number.voidsendLockOwnerRemappedNotification(CDOBranch branch, CDOLockOwner oldOwner, CDOLockOwner newOwner) Deprecated.voidsendLockOwnerRemappedNotification(CDOBranch branch, CDOLockOwner oldOwner, CDOLockOwner newOwner, long lockModCount) Sends an owner remap with the sequence number assigned to this exact change for this session.voidsendRemoteMessageNotification(InternalSession sender, CDORemoteSessionMessage message) Deprecated.voidsendRemoteMessageNotification(InternalSession sender, InternalTopic topic, CDORemoteSessionMessage message) voidsendRemoteSessionNotification(InternalSession sender, byte opcode) Deprecated.voidsendRemoteSessionNotification(InternalSession sender, InternalTopic topic, byte opcode) voidsendRepositoryStateNotification(CDOCommonRepository.State oldState, CDOCommonRepository.State newState) voidsendRepositoryStateNotification(CDOCommonRepository.State oldState, CDOCommonRepository.State newState, CDOID rootResourceID) voidsendRepositoryTypeNotification(CDOCommonRepository.Type oldType, CDOCommonRepository.Type newType) voidsendTagNotification(int modCount, String oldName, String newName, CDOBranchPoint branchPoint) voidReplaces the complete modern collection-loading configuration snapshot.voidsetFirstUpdateTime(long firstUpdateTime) voidsetLockModCountBaseline(long lockModCount) Sets the initial lock-change sequence number when a server session is reconnected.voidsetOpeningTime(long openingTime) voidvoidsetSubscribed(boolean subscribed) voidvoidviewClosed(InternalView view) Deprecated.As of 4.15 useviewClosed(InternalView, boolean).voidviewClosed(InternalView view, boolean inverse) static <T> TwithThreadLocalUserIDHolder(Supplier<T> supplier) Executes an operation while marking protocol-free session construction on the current thread to use a thread-local user ID holder.<T> TwithUserID(String userID, Supplier<T> supplier) Executes an operation with a temporary user ID visible through this session on the current thread.Methods inherited from interface AutoCloseable
closeMethods inherited from interface CDOCommonSession
authorizeOperations, getBranchManager, getCommitInfoManager, getOpeningTime, getRevisionManager, getSessionID, optionsMethods inherited from interface CDOCommonSession.Options
getContainer, getLockNotificationMode, getPassiveUpdateMode, isLockNotificationEnabled, isPassiveUpdateEnabled, setLockNotificationEnabled, setLockNotificationMode, setPassiveUpdateEnabled, setPassiveUpdateModeMethods inherited from interface CDOIDProvider
provideCDOIDMethods inherited from interface CDOLobLoader
loadLobMethods inherited from interface CDOPermissionProvider
getPermissionMethods inherited from interface org.eclipse.net4j.util.collection.Closeable
close, isClosedMethods inherited from interface org.eclipse.net4j.util.collection.Entity.Store.Provider
getEntityStoreMethods inherited from interface IAdaptable
getAdapterMethods inherited from interface org.eclipse.net4j.util.container.IContainer
getElements, isEmptyMethods inherited from interface org.eclipse.net4j.util.concurrent.IExecutorServiceProvider
getExecutorServiceMethods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListenerMethods inherited from interface org.eclipse.net4j.util.properties.IPropertiesContainer
propertiesMethods inherited from interface ISession
getLastUpdateTime, getProtocol, isSubscribedMethods inherited from interface org.eclipse.net4j.util.security.IUserAware
getUserID
-
Field Details
-
TEMP_VIEW_ID
static final int TEMP_VIEW_ID- See Also:
-
CREATE_THREAD_LOCAL_USER_ID_HOLDER
Selects a thread-local user ID holder for protocol-free sessions constructed synchronously inside the current lexical scope. The flag is intended for infrastructure that deliberately shares one protocol-free session across concurrent request threads; ordinary sessions continue to use their existing session-wide user ID.- Since:
- 4.27
-
-
Method Details
-
withThreadLocalUserIDHolder
Executes an operation while marking protocol-free session construction on the current thread to use a thread-local user ID holder.The previous flag value is restored even if the operation fails. Nested scopes are supported and restore the enclosing scope's value.
- Type Parameters:
T- the operation's result type- Parameters:
supplier- the operation to execute synchronously- Returns:
- the operation's result
- Throws:
NullPointerException- ifsupplierisnull- Since:
- 4.27
-
getManager
InternalSessionManager getManager()- Specified by:
getManagerin interfaceISession
-
getRepository
InternalRepository getRepository()- Specified by:
getRepositoryin interfaceISession- Since:
- 4.13
-
setUserID
- Since:
- 4.2
-
withUserID
Executes an operation with a temporary user ID visible through this session on the current thread. The session's configured user ID is not changed, and the temporary identity is not inherited by other threads.Nested scopes restore the enclosing identity, and the configured identity is restored even if the operation fails. A
nulluser ID is a valid scoped identity.- Type Parameters:
T- the operation's result type- Parameters:
userID- the temporary user ID, ornullsupplier- the operation to execute synchronously- Returns:
- the operation's result
- Throws:
NullPointerException- ifsupplierisnull- Since:
- 4.27
-
getCollectionLoadingConfig
CDOCollectionLoadingConfig getCollectionLoadingConfig()Returns the complete modern collection-loading configuration snapshot.- Returns:
- the configuration, or
null - Since:
- 4.27
-
setCollectionLoadingConfig
Replaces the complete modern collection-loading configuration snapshot.- Parameters:
config- the configuration, ornullto disable modern partial collection loading- Since:
- 4.27
-
setOpeningTime
void setOpeningTime(long openingTime) - Since:
- 4.12
-
getFirstUpdateTime
long getFirstUpdateTime()- Since:
- 4.5
-
setFirstUpdateTime
void setFirstUpdateTime(long firstUpdateTime) - Since:
- 4.5
-
isOpenOnClientSide
boolean isOpenOnClientSide()- Since:
- 4.5
-
setOpenOnClientSide
void setOpenOnClientSide()- Since:
- 4.5
-
getViews
InternalView[] getViews()- Specified by:
getViewsin interfaceCDOCommonSession- Specified by:
getViewsin interfaceISession
-
getView
- Specified by:
getViewin interfaceCDOCommonSession- Specified by:
getViewin interfaceISession
-
openView
-
openView
-
openTransaction
- Specified by:
openTransactionin interfaceISession
-
openTransaction
InternalTransaction openTransaction(int viewID, CDOBranchPoint branchPoint, String durableLockingID) - Specified by:
openTransactionin interfaceISession- Since:
- 4.19
-
viewClosed
- Since:
- 4.15
-
setSubscribed
void setSubscribed(boolean subscribed) -
collectContainedRevisions
void collectContainedRevisions(InternalCDORevision revision, CDOBranchPoint branchPoint, int referenceChunk, Set<CDOID> revisions, List<CDORevision> additionalRevisions) -
sendRepositoryTypeNotification
void sendRepositoryTypeNotification(CDOCommonRepository.Type oldType, CDOCommonRepository.Type newType) throws Exception - Throws:
Exception
-
sendRepositoryStateNotification
void sendRepositoryStateNotification(CDOCommonRepository.State oldState, CDOCommonRepository.State newState, CDOID rootResourceID) throws Exception - Throws:
Exception- Since:
- 4.1
-
sendBranchNotification
void sendBranchNotification(CDOBranchChangedEvent.ChangeKind changeKind, CDOBranch... branches) throws Exception - Throws:
Exception- Since:
- 4.15
-
sendTagNotification
void sendTagNotification(int modCount, String oldName, String newName, CDOBranchPoint branchPoint) throws Exception - Throws:
Exception- Since:
- 4.10
-
sendCommitNotification
- Throws:
Exception- Since:
- 4.3
-
sendRemoteSessionNotification
void sendRemoteSessionNotification(InternalSession sender, InternalTopic topic, byte opcode) throws Exception - Throws:
Exception- Since:
- 4.17
-
sendRemoteMessageNotification
void sendRemoteMessageNotification(InternalSession sender, InternalTopic topic, CDORemoteSessionMessage message) throws Exception - Throws:
Exception- Since:
- 4.17
-
sendLockNotification
- Throws:
Exception- Since:
- 4.1
-
sendLockOwnerRemappedNotification
void sendLockOwnerRemappedNotification(CDOBranch branch, CDOLockOwner oldOwner, CDOLockOwner newOwner, long lockModCount) throws Exception Sends an owner remap with the sequence number assigned to this exact change for this session.- Throws:
Exception- Since:
- 4.27
-
getLockModCount
long getLockModCount()Returns the last lock modification count assigned to this server session.- Since:
- 4.27
-
setLockModCountBaseline
void setLockModCountBaseline(long lockModCount) Sets the initial lock-change sequence number when a server session is reconnected.- Since:
- 4.27
-
reserveLockChange
Reserves this session's place in the lock-change notification sequence.- Parameters:
forceFull- whether the resulting notification must contain the full change- Returns:
- the reservation, or
nullif this session is closed - Since:
- 4.27
-
isLockChangesQuiescent
boolean isLockChangesQuiescent()Returns whether all reserved lock changes for this session have completed.- Since:
- 4.27
-
awaitLockChangesQuiescent
void awaitLockChangesQuiescent()Waits until all reserved lock changes for this session have completed.- Since:
- 4.27
-
isLockStateRelevantForSnapshot
Returns whether a lock state belongs in a snapshot for this session.- Since:
- 4.27
-
sendLockNotification
Sends the visible result of a reserved lock change with its assigned sequence number.- Throws:
Exception- Since:
- 4.27
-
viewClosed
Deprecated.As of 4.15 useviewClosed(InternalView, boolean). -
sendRepositoryStateNotification
@Deprecated void sendRepositoryStateNotification(CDOCommonRepository.State oldState, CDOCommonRepository.State newState) throws Exception Deprecated.- Throws:
Exception
-
sendBranchNotification
Deprecated.As of 4.3 usesendBranchNotification(InternalCDOBranch, ChangeKind).- Throws:
Exception
-
sendBranchNotification
@Deprecated void sendBranchNotification(InternalCDOBranch branch, CDOBranchChangedEvent.ChangeKind changeKind) throws Exception Deprecated.As of 4.15 usesendBranchNotification(ChangeKind, CDOBranch...).- Throws:
Exception- Since:
- 4.3
-
sendCommitNotification
Deprecated.As of 4.2 usesendCommitNotification(CDOCommitInfo, boolean).- Throws:
Exception
-
sendCommitNotification
@Deprecated void sendCommitNotification(CDOCommitInfo commitInfo, boolean clearResourcePathCache) throws Exception Deprecated.As of 4.3 usesendCommitNotification(CommitNotificationInfo).- Throws:
Exception- Since:
- 4.2
-
sendRemoteSessionNotification
@Deprecated void sendRemoteSessionNotification(InternalSession sender, byte opcode) throws Exception Deprecated.- Throws:
Exception
-
sendRemoteMessageNotification
@Deprecated void sendRemoteMessageNotification(InternalSession sender, CDORemoteSessionMessage message) throws Exception Deprecated.- Throws:
Exception
-
sendLockOwnerRemappedNotification
@Deprecated void sendLockOwnerRemappedNotification(CDOBranch branch, CDOLockOwner oldOwner, CDOLockOwner newOwner) throws Exception Deprecated.- Throws:
Exception- Since:
- 4.19
-
sendBranchNotification(InternalCDOBranch, ChangeKind).