Package org.guvnor.ala.registry.inmemory
Class InMemoryRuntimeRegistry
- java.lang.Object
-
- org.guvnor.ala.registry.inmemory.InMemoryRuntimeRegistry
-
- All Implemented Interfaces:
RuntimeRegistry
@ApplicationScoped public class InMemoryRuntimeRegistry extends Object implements RuntimeRegistry
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Provider>providersprotected Map<ProviderType,ProviderType>providerTypesprotected Map<String,Runtime>runtimes-
Fields inherited from interface org.guvnor.ala.registry.RuntimeRegistry
PROVIDER_ID_SORT, PROVIDER_TYPE_NAME_SORT, PROVIDER_TYPE_VERSION_SORT, RUNTIME_ID_SORT, RUNTIME_STATE_SORT
-
-
Constructor Summary
Constructors Constructor Description InMemoryRuntimeRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidderegisterProvider(String providerId)Deregisters a provider by provider identifier.voidderegisterProvider(Provider provider)Deregisters a provider.voidderegisterProviderType(ProviderType providerType)Deregisters a provider type.voidderegisterRuntime(RuntimeId runtimeId)Deregisters a runtime.ProvidergetProvider(String providerId)Gets a provider by identifier.<T extends Provider>
Optional<T>getProvider(ProviderId providerId, Class<T> clazz)Gets a provider based on ProviderId and Class type.List<Provider>getProviders(Integer page, Integer pageSize, String sort, boolean sortOrder)Gets the list of registered providers.List<Provider>getProvidersByType(ProviderType providerType)Gets the list of registered providers associated to a given provider type.List<ProviderType>getProviderTypes(Integer page, Integer pageSize, String sort, boolean sortOrder)Gets the list of registered provider types.RuntimegetRuntimeById(String runtimeId)Gets a runtime by identifier.List<Runtime>getRuntimes(Integer page, Integer pageSize, String sort, boolean sortOrder)Gets the list of registered runtimes.voidregisterProvider(Provider provider)Registers a ProvidervoidregisterProviderType(ProviderType providerType)Registers a provider type.voidregisterRuntime(Runtime runtime)Registers a runtime.
-
-
-
Field Detail
-
providerTypes
protected Map<ProviderType,ProviderType> providerTypes
-
-
Method Detail
-
registerProviderType
public void registerProviderType(ProviderType providerType)
Description copied from interface:RuntimeRegistryRegisters a provider type.- Specified by:
registerProviderTypein interfaceRuntimeRegistry- Parameters:
providerType- a provider type to register.- See Also:
ProviderType
-
getProviderTypes
public List<ProviderType> getProviderTypes(Integer page, Integer pageSize, String sort, boolean sortOrder)
Description copied from interface:RuntimeRegistryGets the list of registered provider types.- Specified by:
getProviderTypesin interfaceRuntimeRegistry- Returns:
- a list with all the registered provider types.
- See Also:
ProviderType
-
deregisterProviderType
public void deregisterProviderType(ProviderType providerType)
Description copied from interface:RuntimeRegistryDeregisters a provider type.- Specified by:
deregisterProviderTypein interfaceRuntimeRegistry- Parameters:
providerType- a provider to deregister.- See Also:
ProviderType
-
registerProvider
public void registerProvider(Provider provider)
Description copied from interface:RuntimeRegistryRegisters a Provider- Specified by:
registerProviderin interfaceRuntimeRegistry- Parameters:
provider- a provider to be registered.- See Also:
Provider
-
getProviders
public List<Provider> getProviders(Integer page, Integer pageSize, String sort, boolean sortOrder)
Description copied from interface:RuntimeRegistryGets the list of registered providers.- Specified by:
getProvidersin interfaceRuntimeRegistry- Returns:
- a list with all the registered providers.
- See Also:
Provider
-
getProvidersByType
public List<Provider> getProvidersByType(ProviderType providerType)
Description copied from interface:RuntimeRegistryGets the list of registered providers associated to a given provider type.- Specified by:
getProvidersByTypein interfaceRuntimeRegistry- Parameters:
providerType- a given provider type.- Returns:
- a list with all the providers associated to the provider type.
- See Also:
Provider,ProviderType
-
getProvider
public Provider getProvider(String providerId)
Description copied from interface:RuntimeRegistryGets a provider by identifier.- Specified by:
getProviderin interfaceRuntimeRegistry- Parameters:
providerId- the identifier of the provider to look for.- Returns:
- the provider with the given identifier, if registered, null y any other case.
- See Also:
Provider
-
deregisterProvider
public void deregisterProvider(Provider provider)
Description copied from interface:RuntimeRegistryDeregisters a provider.- Specified by:
deregisterProviderin interfaceRuntimeRegistry- Parameters:
provider- a provider to deregister.- See Also:
Provider
-
deregisterProvider
public void deregisterProvider(String providerId)
Description copied from interface:RuntimeRegistryDeregisters a provider by provider identifier.- Specified by:
deregisterProviderin interfaceRuntimeRegistry- Parameters:
providerId- the identifier of the provider to deregister.- See Also:
Provider
-
registerRuntime
public void registerRuntime(Runtime runtime)
Description copied from interface:RuntimeRegistryRegisters a runtime.- Specified by:
registerRuntimein interfaceRuntimeRegistry- Parameters:
runtime- a runtime to register.- See Also:
Runtime
-
getRuntimes
public List<Runtime> getRuntimes(Integer page, Integer pageSize, String sort, boolean sortOrder)
Description copied from interface:RuntimeRegistryGets the list of registered runtimes.- Specified by:
getRuntimesin interfaceRuntimeRegistry- Returns:
- a list with all the registered runtimes.
- See Also:
Runtime
-
getRuntimeById
public Runtime getRuntimeById(String runtimeId)
Description copied from interface:RuntimeRegistryGets a runtime by identifier.- Specified by:
getRuntimeByIdin interfaceRuntimeRegistry- Parameters:
runtimeId- the identifier of the runtime to look for.- Returns:
- the runtime with the given identifier, if registered, null y any other case.
- See Also:
Runtime
-
deregisterRuntime
public void deregisterRuntime(RuntimeId runtimeId)
Description copied from interface:RuntimeRegistryDeregisters a runtime.- Specified by:
deregisterRuntimein interfaceRuntimeRegistry- Parameters:
runtimeId- the runtime id to deregister.- See Also:
RuntimeId
-
getProvider
public <T extends Provider> Optional<T> getProvider(ProviderId providerId, Class<T> clazz)
Description copied from interface:RuntimeRegistryGets a provider based on ProviderId and Class type.- Specified by:
getProviderin interfaceRuntimeRegistry- Parameters:
providerId- the provider id to look for.clazz- the provider class.- Returns:
- the provider with the given provider id and of type clazz, if registered, null in any other case.
- See Also:
ProviderId
-
-