com.sap.cds.feature.dashboard.connectivity.CommandControllerConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cds-feature-dev-dashboard Show documentation
Show all versions of cds-feature-dev-dashboard Show documentation
Development Dashboard for CDS Services Java
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();
}
}