Package com.evolveum.midpoint.rest.impl
Class RestConfig
java.lang.Object
com.evolveum.midpoint.rest.impl.RestConfig
- All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Configuration
@ComponentScan
public class RestConfig
extends Object
implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Spring configuration for MVC-based REST service.
This prepares needed XML/JSON/YAML message converters.
It also drives the package scan for REST controllers under this package.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configureContentNegotiation
(@NotNull org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer configurer) Registers content-types for path extension and request parameter usage.void
extendMessageConverters
(List<org.springframework.http.converter.HttpMessageConverter<?>> converters) All beans above will be first in the converter list and other Spring converters will be available as well.jsonConverter
(PrismContext prismContext, LocalizationService localizationService) xmlConverter
(PrismContext prismContext, LocalizationService localizationService) yamlConverter
(PrismContext prismContext, LocalizationService localizationService) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
addArgumentResolvers, addCorsMappings, addFormatters, addInterceptors, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, getMessageCodesResolver, getValidator
-
Constructor Details
-
RestConfig
public RestConfig()
-
-
Method Details
-
configureContentNegotiation
public void configureContentNegotiation(@NotNull @NotNull org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer configurer) Registers content-types for path extension and request parameter usage. Not needed for header-based content negotiation and midPoint typically doesn't use this, but it doesn't hurt and may be handy for download URLs.- Specified by:
configureContentNegotiation
in interfaceorg.springframework.web.servlet.config.annotation.WebMvcConfigurer
-
yamlConverter
@Bean public MidpointYamlHttpMessageConverter yamlConverter(PrismContext prismContext, LocalizationService localizationService) -
xmlConverter
@Bean public MidpointXmlHttpMessageConverter xmlConverter(PrismContext prismContext, LocalizationService localizationService) -
jsonConverter
@Bean public MidpointJsonHttpMessageConverter jsonConverter(PrismContext prismContext, LocalizationService localizationService) -
extendMessageConverters
public void extendMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters) All beans above will be first in the converter list and other Spring converters will be available as well. We want to add "catch-all" converter for cases like error output for any (even unsupported) content type.- Specified by:
extendMessageConverters
in interfaceorg.springframework.web.servlet.config.annotation.WebMvcConfigurer
-