Package org.eclipse.net4j.db

# Interface IDBAdapter.Registry

All Superinterfaces:
  `org.eclipse.net4j.util.container.IContainer<Map.Entry<String,IDBAdapter>>`, `org.eclipse.net4j.util.event.INotifier`, `org.eclipse.net4j.util.registry.IRegistry<String,IDBAdapter>`, `Map<String,IDBAdapter>`

Enclosing interface:
  `IDBAdapter`

public static interface IDBAdapter.Registry extends org.eclipse.net4j.util.registry.IRegistry<String,IDBAdapter>
The registry of all registered `adapters`.

The registry accepts eagerly created adapters and lazy extension descriptors. Metadata methods such as `getAdapterIDs()` do not instantiate descriptors. Methods returning adapters materialize the requested descriptor on demand and cache the resulting adapter for subsequent lookups.

Registration is keyed by the logical pair of name and version. Names are case-insensitive. Versions are dot-separated numeric values; trailing zero components are insignificant. Thus registering `MySQL/8` prevents a second registration of `mysql/8.0.0`. A lookup by name alone returns the highest registered version. A lookup by an `IDBAdapterID` or by separate name and version performs an exact logical lookup. The arrays returned by this interface are snapshots and are ordered by name and numeric version.

Since:
  4.14
Author:
  Eike Stepper

## Nested Class Summary

## Nested 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`

## Nested classes/interfaces inherited from interface java.util.Map

`Map.Entry<K,V>`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final IDBAdapter.Registry`
`INSTANCE`

## Method Summary

Modifier and Type
Method
Description
`IDBAdapter`
`getAdapter(String adapterName)`
Returns the highest registered version for a name.
`IDBAdapter`
`getAdapter(String adapterName, String version)`
Returns the adapter for an exact logical name/version pair.
`IDBAdapter`
`getAdapter(IDBAdapterID id)`
Returns the adapter for an exact logical identity.
`IDBAdapterID[]`
`getAdapterIDs()`
Returns metadata for all registered adapters without instantiating lazy extension descriptors.
`IDBAdapterID[]`
`getAdapterIDs(String adapterName)`
Returns metadata for all registered versions of a name without instantiating lazy extension descriptors.
`IDBAdapter[]`
`getAdapters()`
Returns all registered adapters, materializing lazy descriptors as necessary.
`IDBAdapter[]`
`getAdapters(String adapterName)`
Returns all registered variants for a name, materializing matching lazy descriptors as necessary.

### 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`

### Methods inherited from interface org.eclipse.net4j.util.registry.IRegistry

`commit, commit, isAutoCommit, setAutoCommit`

### Methods inherited from interface java.util.Map

`clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values`

## Field Details

### INSTANCE

static final IDBAdapter.Registry INSTANCE

## Method Details

### getAdapterIDs

IDBAdapterID[] getAdapterIDs()
Returns metadata for all registered adapters without instantiating lazy extension descriptors.

Returns:
  a sorted snapshot of registered adapter identities

### getAdapterIDs

IDBAdapterID[] getAdapterIDs(String adapterName)
Returns metadata for all registered versions of a name without instantiating lazy extension descriptors.

Parameters:
  `adapterName` - the adapter name to match, case-insensitively
Returns:
  a sorted snapshot of matching adapter identities

### getAdapters

IDBAdapter[] getAdapters()
Returns all registered adapters, materializing lazy descriptors as necessary.

Returns:
  a sorted snapshot of the available adapters

### getAdapters

IDBAdapter[] getAdapters(String adapterName)
Returns all registered variants for a name, materializing matching lazy descriptors as necessary.

Parameters:
  `adapterName` - the adapter name to match, case-insensitively
Returns:
  a sorted snapshot of the matching adapters

### getAdapter

IDBAdapter getAdapter(IDBAdapterID id)
Returns the adapter for an exact logical identity. A lazy descriptor is materialized only if this lookup finds it.

Parameters:
  `id` - the identity to match
Returns:
  the matching adapter, or `null` if none is registered

### getAdapter

IDBAdapter getAdapter(String adapterName, String version)
Returns the adapter for an exact logical name/version pair. Name matching is case-insensitive and version matching is numeric by dot-separated components. A lazy descriptor is materialized only if this lookup finds it.

Parameters:
  `adapterName` - the adapter name to match
  `version` - the adapter version to match
Returns:
  the matching adapter, or `null` if none is registered

### getAdapter

IDBAdapter getAdapter(String adapterName)
Returns the highest registered version for a name. If the matching entry is a lazy descriptor, it is materialized and cached before the adapter is returned.

Parameters:
  `adapterName` - the adapter name to match, case-insensitively
Returns:
  the highest-version adapter, or `null` if no version is registered