All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cds.feature.dashboard.connectivity.CommandControllerConfig Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
package com.sap.cds.feature.dashboard.connectivity;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;

@AutoConfiguration
@EnableWebSocketMessageBroker
@Conditional(DashboardConfiguredCondition.class)
public class CommandControllerConfig implements WebSocketMessageBrokerConfigurer {

	@Override
	public void configureMessageBroker(MessageBrokerRegistry config) {
		config.enableSimpleBroker("/v1.0");
		config.setApplicationDestinationPrefixes("/v1.0");
	}

	@Override
	public void registerStompEndpoints(StompEndpointRegistry registry) {
		registry.addEndpoint("/dashboard_api").setAllowedOriginPatterns("*").withSockJS();
	}

	@Bean
	CommandController getCommandController() {
		return new CommandController();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy