protected IEsClientFactory createEsClientFactory() {
        String factoryClass = config.getOrDefault("client.type", "es");
        // In order to maintain backwards compatibility, we still accept 'jest' for the factory name, even
        // though jest has now been replaced with an official HTTP client from Elastic.
        if (EsUtils.isEsOrJest(factoryClass)) { //$NON-NLS-1$
            factoryClass = DefaultEsClientFactory.class.getName();
        } else if ("local".equalsIgnoreCase(factoryClass)) { //$NON-NLS-1$
            factoryClass = LocalClientFactory.class.getName();
        } else {
            throw new RuntimeException("Invalid elasticsearch client type: " + factoryClass); //$NON-NLS-1$
        }

        try {
            return (IEsClientFactory) Class.forName(factoryClass).newInstance();
        } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
            throw new RuntimeException("Error creating elasticsearch client type: " + factoryClass, e); //$NON-NLS-1$
        }
    }
@return the client factory to use to create the ES client
common/es/src/main/java/io/apiman/common/es/util/AbstractEsComponent.java