Package dev.hilla
Class EndpointControllerConfiguration
- java.lang.Object
-
- dev.hilla.EndpointControllerConfiguration
-
@Configuration public class EndpointControllerConfiguration extends Object
A configuration class for customizing theEndpointControllerclass.
-
-
Constructor Summary
Constructors Constructor Description EndpointControllerConfiguration(EndpointProperties endpointProperties)Initializes the endpoint configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.vaadin.flow.server.auth.AccessAnnotationCheckeraccessAnnotationChecker()Registers a defaultAccessAnnotationCheckerbean instance.EndpointAccessCheckeraccessChecker(com.vaadin.flow.server.auth.AccessAnnotationChecker accessAnnotationChecker)Registers a defaultEndpointAccessCheckerbean instance.CsrfCheckercsrfChecker(javax.servlet.ServletContext servletContext)Registers a defaultCsrfCheckerbean instance.EndpointInvokerendpointInvoker(org.springframework.context.ApplicationContext applicationContext, com.fasterxml.jackson.databind.ObjectMapper vaadinEndpointMapper, ExplicitNullableTypeChecker explicitNullableTypeChecker, javax.servlet.ServletContext servletContext, EndpointRegistry endpointRegistry)Registers the endpoint invoker.EndpointNameCheckerendpointNameChecker()Registers an endpoint name checker responsible for validating the endpoint names.EndpointRegistryendpointRegistry(EndpointNameChecker endpointNameChecker)Registers the endpoint registry.EndpointUtilendpointUtil()Registers endpoint utility methods.ExplicitNullableTypeCheckertypeChecker()Registers aExplicitNullableTypeCheckerbean instance.org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrationswebMvcRegistrationsHandlerMapping()RegistersEndpointControllerto useEndpointProperties.getEndpointPrefix()as a prefix for all Vaadin endpoints.
-
-
-
Constructor Detail
-
EndpointControllerConfiguration
public EndpointControllerConfiguration(EndpointProperties endpointProperties)
Initializes the endpoint configuration.- Parameters:
endpointProperties- Vaadin ednpoint properties
-
-
Method Detail
-
webMvcRegistrationsHandlerMapping
@Bean public org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations webMvcRegistrationsHandlerMapping()
RegistersEndpointControllerto useEndpointProperties.getEndpointPrefix()as a prefix for all Vaadin endpoints.- Returns:
- updated configuration for
EndpointController
-
endpointNameChecker
@Bean public EndpointNameChecker endpointNameChecker()
Registers an endpoint name checker responsible for validating the endpoint names.- Returns:
- the endpoint name checker
-
accessChecker
@Bean public EndpointAccessChecker accessChecker(com.vaadin.flow.server.auth.AccessAnnotationChecker accessAnnotationChecker)
Registers a defaultEndpointAccessCheckerbean instance.- Parameters:
accessAnnotationChecker- the access controlks checker to use- Returns:
- the default Vaadin endpoint access checker bean
-
accessAnnotationChecker
@Bean @ConditionalOnMissingBean public com.vaadin.flow.server.auth.AccessAnnotationChecker accessAnnotationChecker()
Registers a defaultAccessAnnotationCheckerbean instance.- Returns:
- the default bean
-
csrfChecker
@Bean public CsrfChecker csrfChecker(javax.servlet.ServletContext servletContext)
Registers a defaultCsrfCheckerbean instance.- Parameters:
servletContext- the servlet context- Returns:
- the default bean
-
typeChecker
@Bean public ExplicitNullableTypeChecker typeChecker()
Registers aExplicitNullableTypeCheckerbean instance.- Returns:
- the explicit nullable type checker
-
endpointUtil
@Bean public EndpointUtil endpointUtil()
Registers endpoint utility methods.- Returns:
- the endpoint util class
-
endpointRegistry
@Bean public EndpointRegistry endpointRegistry(EndpointNameChecker endpointNameChecker)
Registers the endpoint registry.- Parameters:
endpointNameChecker- the name checker to use- Returns:
- the endpoint registry
-
endpointInvoker
@Bean public EndpointInvoker endpointInvoker(org.springframework.context.ApplicationContext applicationContext, @Autowired(required=false) @Qualifier("vaadinEndpointMapper") com.fasterxml.jackson.databind.ObjectMapper vaadinEndpointMapper, ExplicitNullableTypeChecker explicitNullableTypeChecker, javax.servlet.ServletContext servletContext, EndpointRegistry endpointRegistry)
Registers the endpoint invoker.- Parameters:
applicationContext- Spring context to extract beans annotated withEndpointfromvaadinEndpointMapper- optional bean to override the defaultObjectMapperthat is used for serializing and deserializing request and response bodies UseEndpointController.VAADIN_ENDPOINT_MAPPER_BEAN_QUALIFIERqualifier to override the mapper.explicitNullableTypeChecker- the method parameter and return value type checker to verify that null values are explicitservletContext- the servlet contextendpointRegistry- the registry used to store endpoint information- Returns:
- the endpoint invoker
-
-