class FailoverStrategyFactoryLoader {

	public static FailoverStrategy.Factory loadFailoverStrategyFactory(final Configuration config) {
		checkNotNull(config);

		final String strategyParam = config.getString(JobManagerOptions.EXECUTION_FAILOVER_STRATEGY);

		switch (strategyParam.toLowerCase()) {
			case FULL_RESTART_STRATEGY_NAME:
				return new RestartAllFailoverStrategy.Factory();

			case PIPELINED_REGION_RESTART_STRATEGY_NAME:
				return new RestartPipelinedRegionFailoverStrategy.Factory();

			default:
				throw new IllegalConfigurationException("Unknown failover strategy: " + strategyParam);
		}
	}

	private  FailoverStrategyFactoryLoader();

}