/**
 * Copyright 2010-2016 Ralph Schaer <ralphschaer@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ch.rasc.extdirectspring.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.io.ClassPathResource;
import org.springframework.scheduling.annotation.EnableScheduling;

import ch.ralscha.extdirectspring.ExtDirectSpring;

@Configuration
@ComponentScan(basePackageClasses = { ExtDirectSpring.class, Main.class })
@EnableAutoConfiguration(exclude = SpringDataWebAutoConfiguration.class)
@EnableScheduling
public class Main extends SpringBootServletInitializer {

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(Main.class);
	}

	public static void main(String[] args) throws Exception {
		SpringApplication.run(Main.class, args);
	}

//	@Bean
//	public ch.ralscha.extdirectspring.controller.Configuration edsConfig() {
//		ch.ralscha.extdirectspring.controller.Configuration config = new ch.ralscha.extdirectspring.controller.Configuration();
//		//config.setStreamResponse(true);
//		config.setTimeout(12000);
//		config.setMaxRetries(10);
//		//config.setEnableBuffer(false);
//		config.setBufferLimit(3);
//		return config;
//	}

	@Bean
	@Lazy
	public ClassPathResource randomdata() {
		return new ClassPathResource("/randomdata.csv");
	}

	@Bean
	@Lazy
	public ClassPathResource pivotdata() {
		return new ClassPathResource("/pivodata.csv");
	}

	@Bean
	@Lazy
	public ClassPathResource userdata() {
		return new ClassPathResource("/users.csv");
	}

	@Bean
	@Lazy
	public ClassPathResource countries() {
		return new ClassPathResource("/countries.csv");
	}

	@Bean
	@Lazy
	public ClassPathResource employees() {
		return new ClassPathResource("/employees.json");
	}

	@Bean
	@Lazy
	public ClassPathResource contacts() {
		return new ClassPathResource("/contacts.json");
	}

	@Bean
	@Lazy
	public ClassPathResource friends() {
		return new ClassPathResource("/friends.json");
	}

}

@@ -967,19 +967,19 @@
 oot.
-context.web
+web.support
 .Spr
@@ -1897,20 +1897,22 @@
 %09%7D%0A%0A
+%09
 //
-%09
+ 
 @Bean%0A
+%09
 //
-%09
+ 
 publ
@@ -1980,20 +1980,20 @@
 fig() %7B%0A
+%09
 //
-%09%09
+ 
 ch.ralsc
@@ -2048,16 +2048,20 @@
 ig = new
+%0A%09//
  ch.rals
@@ -2108,20 +2108,20 @@
 tion();%0A
+%09
 //
-%09%09
+ 
 //config
@@ -2142,28 +2142,28 @@
 onse(true);%0A
+%09
 //
-%09%09
+ 
 config.setTi
@@ -2176,20 +2176,20 @@
 12000);%0A
+%09
 //
-%09%09
+ 
 config.s
@@ -2206,20 +2206,20 @@
 es(10);%0A
+%09
 //
-%09%09
+ 
 //config
@@ -2243,20 +2243,20 @@
 false);%0A
+%09
 //
-%09%09
+ 
 config.s
@@ -2277,12 +2277,12 @@
 3);%0A
+%09
 //
-%09%09
+ 
 retu
@@ -2296,11 +2296,12 @@
 ig;%0A
+%09
 //
-%09
+ 
 %7D%0A%0A%09

Fix deprecated warning