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
FieldsFields inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
mappingsLoggerFields 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_ATTRIBUTEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOperationToCustomeService(String id, com.fasterxml.jackson.databind.node.ObjectNode operationDefinition) protected StringcomputeAuthorizationString(Operation operationDefinition, boolean isWrite) protected net.bytebuddy.description.type.TypeDefinitiongenerateTypeDefinitionFromSchema(Type typeDescription) getHandler(String serviceName) protected ObjectgetHandlerInternal(jakarta.servlet.http.HttpServletRequest request) getServiceId(String serviceName) voidinit()voidbooleanvoidvoidregisterCustomService(String customServiceCfgID) voidregisterCustomService(String customServiceCfgID, com.fasterxml.jackson.databind.node.ObjectNode customServiceDefinitiondefinition, boolean overwrite) voidregisterCustomService(String customServiceCfgID, CustomService customServiceCfg, boolean overwrite) voidremoveOperationFromCustomeService(String id, String operationName) protected voidvoidudpateOperationInCustomeService(String id, com.fasterxml.jackson.databind.node.ObjectNode operationDefinition, String oldOperationName) voidunregisterCustomService(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, usesPathPatternsMethods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getHandlerInternalin classorg.springframework.web.servlet.handler.AbstractHandlerMapping- Throws:
Exception
-
isMapped
-
getHandler
-
getServiceId
-