Class CustomServiceHandlerMapping
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.handler.AbstractHandlerMapping
it.uniroma2.art.semanticturkey.customservice.CustomServiceHandlerMapping
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.context.ApplicationContextAware
,org.springframework.core.Ordered
,org.springframework.web.context.ServletContextAware
,org.springframework.web.servlet.HandlerMapping
public class CustomServiceHandlerMapping
extends org.springframework.web.servlet.handler.AbstractHandlerMapping
implements org.springframework.core.Ordered
A
HandlerMapping
that dispatches incoming requests to custom services (see
CustomServiceDefinitionStore
.- Author:
- Manuel Fiorelli
-
Field Summary
Fields inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
mappingsLogger
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, LOOKUP_PATH, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOperationToCustomeService
(String id, com.fasterxml.jackson.databind.node.ObjectNode operationDefinition) protected String
computeAuthorizationString
(Operation operationDefinition, boolean isWrite) protected net.bytebuddy.description.type.TypeDefinition
generateTypeDefinitionFromSchema
(Type typeDescription) getHandler
(String serviceName) protected Object
getHandlerInternal
(jakarta.servlet.http.HttpServletRequest request) getServiceId
(String serviceName) void
init()
void
boolean
void
void
registerCustomService
(String customServiceCfgID) void
registerCustomService
(String customServiceCfgID, com.fasterxml.jackson.databind.node.ObjectNode customServiceDefinitiondefinition, boolean overwrite) void
registerCustomService
(String customServiceCfgID, CustomService customServiceCfg, boolean overwrite) void
removeOperationFromCustomeService
(String id, String operationName) protected void
void
udpateOperationInCustomeService
(String id, com.fasterxml.jackson.databind.node.ObjectNode operationDefinition, String oldOperationName) void
unregisterCustomService
(String customServiceCfgID) Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getCorsConfiguration, getCorsConfigurationSource, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getPatternParser, getUrlPathHelper, hasCorsConfigurationSource, initApplicationContext, initInterceptors, initLookupPath, setAlwaysUseFullPath, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setPatternParser, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper, usesPathPatterns
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.Ordered
getOrder
-
Field Details
-
CUSTOM_SERVICES_EXTENSION_PATH
- See Also:
-
CUSTOM_SERVICES_URL_PREFIX
- See Also:
-
-
Constructor Details
-
CustomServiceHandlerMapping
public CustomServiceHandlerMapping()
-
-
Method Details
-
init
- Throws:
NoSuchConfigurationManager
-
onAllPluginsInitialized
-
initializeFromStoredCustomServices
- Throws:
NoSuchConfigurationManager
-
getCustomServiceIdentifiers
-
getCustomService
- Throws:
STPropertyAccessException
-
registerCustomService
public void registerCustomService(String customServiceCfgID) throws STPropertyAccessException, WrongPropertiesException, InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, InvalidConfigurationException, DuplicateName -
registerCustomService
public void registerCustomService(String customServiceCfgID, com.fasterxml.jackson.databind.node.ObjectNode customServiceDefinitiondefinition, boolean overwrite) throws STPropertyAccessException, IOException, WrongPropertiesException, STPropertyUpdateException, InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, InvalidConfigurationException, CustomServiceException -
registerCustomService
public void registerCustomService(String customServiceCfgID, CustomService customServiceCfg, boolean overwrite) throws STPropertyAccessException, IOException, WrongPropertiesException, STPropertyUpdateException, InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, InvalidConfigurationException, CustomServiceException -
unregisterCustomService
public void unregisterCustomService(String customServiceCfgID) throws ConfigurationNotFoundException - Throws:
ConfigurationNotFoundException
-
addOperationToCustomeService
public void addOperationToCustomeService(String id, com.fasterxml.jackson.databind.node.ObjectNode operationDefinition) throws STPropertyAccessException, IOException, WrongPropertiesException, InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, STPropertyUpdateException, InvalidConfigurationException, CustomServiceException -
udpateOperationInCustomeService
public void udpateOperationInCustomeService(String id, com.fasterxml.jackson.databind.node.ObjectNode operationDefinition, String oldOperationName) throws STPropertyAccessException, IOException, WrongPropertiesException, InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, STPropertyUpdateException, InvalidConfigurationException, CustomServiceException -
removeOperationFromCustomeService
public void removeOperationFromCustomeService(String id, String operationName) throws STPropertyAccessException, IOException, WrongPropertiesException, InstantiationException, IllegalAccessException, SchemaException, IllegalArgumentException, NoSuchExtensionException, STPropertyUpdateException, InvalidConfigurationException, CustomServiceException -
setDelegateMappingInternal
protected void setDelegateMappingInternal() -
computeAuthorizationString
protected String computeAuthorizationString(Operation operationDefinition, boolean isWrite) throws RuntimeException - Throws:
RuntimeException
-
generateTypeDefinitionFromSchema
protected net.bytebuddy.description.type.TypeDefinition generateTypeDefinitionFromSchema(Type typeDescription) throws SchemaException - Throws:
SchemaException
-
getHandlerInternal
protected Object getHandlerInternal(jakarta.servlet.http.HttpServletRequest request) throws Exception - Specified by:
getHandlerInternal
in classorg.springframework.web.servlet.handler.AbstractHandlerMapping
- Throws:
Exception
-
isMapped
-
getHandler
-
getServiceId
-