// Path: src/main/java/com/scheible/risingempire/web/config/web/JsonConfig.java
// @Component
// public class JsonConfig {
// 	
// 	@Autowired
// 	ObjectMapper objectMapper;
// 	
// 	public MessageConverter configure() {
// 		DefaultContentTypeResolver resolver = new DefaultContentTypeResolver();
//         resolver.setDefaultMimeType(MimeTypeUtils.APPLICATION_JSON);
//         MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
// 		
// 		// NOTE Includes Java type informations (only for the deserialization process, objectMapper.enableDefaultTyping() would do it for both ways).
// 		// https://github.com/FasterXML/jackson-databind/issues/352
//         TypeResolverBuilder<?> typer = new ObjectMapper.DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE);
//         // we'll always use full class name, when using defaulting
//         typer = typer.init(JsonTypeInfo.Id.CLASS, null);
//         typer = typer.inclusion(JsonTypeInfo.As.WRAPPER_ARRAY);		
// 		objectMapper.setConfig(objectMapper.getDeserializationConfig().with(typer));
// 		
// 		// NOTE Operate on a field basis.
// 		objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
// 		objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
// 		
//         converter.setObjectMapper(objectMapper);
//         converter.setContentTypeResolver(resolver);
// 		
// 		return converter;
// 	}
// }


import com.scheible.risingempire.web.config.web.JsonConfig;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.converter.MessageConverter;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.session.ExpiringSession;
import org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
package com.scheible.risingempire.web.config.websocket;


/**
 *
 * @author sj
 */
@Configuration
@EnableScheduling
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractSessionWebSocketMessageBrokerConfigurer<ExpiringSession> {
	
	@Autowired
// Path: src/main/java/com/scheible/risingempire/web/config/web/JsonConfig.java
// @Component
// public class JsonConfig {
// 	
// 	@Autowired
// 	ObjectMapper objectMapper;
// 	
// 	public MessageConverter configure() {
// 		DefaultContentTypeResolver resolver = new DefaultContentTypeResolver();
//         resolver.setDefaultMimeType(MimeTypeUtils.APPLICATION_JSON);
//         MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
// 		
// 		// NOTE Includes Java type informations (only for the deserialization process, objectMapper.enableDefaultTyping() would do it for both ways).
// 		// https://github.com/FasterXML/jackson-databind/issues/352
//         TypeResolverBuilder<?> typer = new ObjectMapper.DefaultTypeResolverBuilder(ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE);
//         // we'll always use full class name, when using defaulting
//         typer = typer.init(JsonTypeInfo.Id.CLASS, null);
//         typer = typer.inclusion(JsonTypeInfo.As.WRAPPER_ARRAY);		
// 		objectMapper.setConfig(objectMapper.getDeserializationConfig().with(typer));
// 		
// 		// NOTE Operate on a field basis.
// 		objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
// 		objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
// 		
//         converter.setObjectMapper(objectMapper);
//         converter.setContentTypeResolver(resolver);
// 		
// 		return converter;
// 	}
// }


// Path: src/main/java/com/scheible/risingempire/web/config/websocket/WebSocketConfig.java
import com.scheible.risingempire.web.config.web.JsonConfig;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.converter.MessageConverter;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.session.ExpiringSession;
import org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;

package com.scheible.risingempire.web.config.websocket;


/**
 *
 * @author sj
 */
@Configuration
@EnableScheduling
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractSessionWebSocketMessageBrokerConfigurer<ExpiringSession> {
	
	@Autowired
	JsonConfig jsonConfig;