use of org.guvnor.ala.ui.backend.service.handler.BackendProviderHandler in project kie-wb-common by kiegroup.
the class ProviderConverterImpl method toModel.
/**
* @param provider A provider representation in the guvnor-ala core domain.
* @return the converted version of the provider in the format managed by the UI related modules.
*/
@Override
public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) {
Provider result = null;
if (provider != null) {
ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion());
ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId());
final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey);
@SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig());
result = new Provider(providerKey, providerConfiguration);
}
return result;
}
Aggregations