Package org.eclipse.emf.cdo.session

# Interface CDOSessionRegistry

All Superinterfaces:
  `org.eclipse.net4j.util.container.IContainer<CDOSessionRegistry.Registration>`, `org.eclipse.net4j.util.event.INotifier`

public interface CDOSessionRegistry extends org.eclipse.net4j.util.container.IContainer<CDOSessionRegistry.Registration>
A global registry of all open `sessions`.

Since:
  4.17
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 Classes
Modifier and Type
Interface
Description
`static interface`
`CDOSessionRegistry.Registration`
A bidirectional mapping between a registered `session` and its assigned `ID`.

## Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer

`org.eclipse.net4j.util.container.IContainer.Modifiable<E extends Object>, org.eclipse.net4j.util.container.IContainer.Persistable<E extends Object>, org.eclipse.net4j.util.container.IContainer.Persistence<E extends Object>`

## Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier

`org.eclipse.net4j.util.event.INotifier.INotifier2`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final CDOSessionRegistry`
`INSTANCE`
The singleton instance of the `session registry`.
`static final int`
`NOT_REGISTERED`
A symbolic constant returned from `getID(CDOSession)` if the session is not registered.

## Method Summary

Modifier and Type
Method
Description
`int`
`getID(CDOSession session)`
Returns the `ID` of the given `session` if it is registered, 0 otherwise.
`int[]`
`getIDs()`
Returns the `IDs` of all registered `sessions`.
`CDOSession`
`getSession(int id)`
Returns the `session` with the given `ID` if it is registered, `null` otherwise.
`CDOSession[]`
`getSessions()`
Returns all registered `sessions`.

### Methods inherited from interface org.eclipse.net4j.util.container.IContainer

`getElements, isEmpty`

### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

`addListener, getListeners, hasListeners, removeListener`

## Field Details

### INSTANCE

static final CDOSessionRegistry INSTANCE
The singleton instance of the `session registry`.

### NOT_REGISTERED

static final int NOT_REGISTERED
A symbolic constant returned from `getID(CDOSession)` if the session is not registered.

See Also:
  - Constant Field Values

## Method Details

### getIDs

int[] getIDs()
Returns the `IDs` of all registered `sessions`.

### getSessions

CDOSession[] getSessions()
Returns all registered `sessions`.

### getID

int getID(CDOSession session)
Returns the `ID` of the given `session` if it is registered, 0 otherwise.

### getSession

CDOSession getSession(int id)
Returns the `session` with the given `ID` if it is registered, `null` otherwise.