Search in sources :

Example 1 with IDataLoaderFactory

use of org.jumpmind.symmetric.load.IDataLoaderFactory in project symmetric-ds by JumpMind.

the class DataLoaderService method getFactory.

protected IDataLoaderFactory getFactory(String channelId) {
    Channel channel = configurationService.getChannel(channelId);
    String dataLoaderType = "default";
    IDataLoaderFactory factory = null;
    if (channel != null) {
        dataLoaderType = filterDataLoaderType(channel.getDataLoaderType());
    }
    Map<String, IDataLoaderFactory> dataLoaderFactories = getDataLoaderFactories();
    factory = dataLoaderFactories.get(dataLoaderType);
    if (factory == null) {
        log.warn("Could not find a data loader factory of type '{}'.  Using the 'default' data loader.", dataLoaderType);
        factory = dataLoaderFactories.get("default");
    }
    if (!factory.isPlatformSupported(platform)) {
        log.warn("The current platform does not support a data loader type of '{}'.  Using the 'default' data loader.", dataLoaderType);
        factory = dataLoaderFactories.get("default");
    }
    return factory;
}
Also used : IDataLoaderFactory(org.jumpmind.symmetric.load.IDataLoaderFactory) Channel(org.jumpmind.symmetric.model.Channel)

Aggregations

IDataLoaderFactory (org.jumpmind.symmetric.load.IDataLoaderFactory)1 Channel (org.jumpmind.symmetric.model.Channel)1