Interface CosIdStoreProvider
- All Known Implementing Classes:
BuiltInStoreProvider
The starter picks the provider whose type is the configured store type,
cosid.machine.distributor.type (or cosid.segment.distributor.type), compared as StoreTypes do:
for example jdbc, stateful_set or etcd. Every built-in backend registers its own provider. A
provider bean of the application with the same type as a built-in one takes precedence over it; one with a new type is
selected by setting the type to it.
A provider supports either side by returning a value from its method, and null for the side it does not
support.
The built-in backends check for application providers when they register their beans, by bean type. Define the
provider as a bean of its concrete type, in the application's configuration or in an auto-configuration ordered
before CosId's backend auto-configurations (@AutoConfiguration(before = ...)); a provider registered later, or
through a raw-typed FactoryBean, is ignored and a warning is logged at startup.
- Since:
- 3.4.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable IdSegmentDistributorFactoryCreate the id segment distributor factory.default @Nullable MachineIdDistributorCreate the machine id distributor.getType()The store type this provider serves, compared ignoring case.
-
Method Details
-
getType
String getType()The store type this provider serves, compared ignoring case. -
createMachineIdDistributor
Create the machine id distributor.- Returns:
- the distributor, or
nullif this provider has none
-
createIdSegmentDistributorFactory
default @Nullable IdSegmentDistributorFactory createIdSegmentDistributorFactory(SegmentStoreContext context) Create the id segment distributor factory.- Returns:
- the factory, or
nullif this provider has none
-