Class DefaultWebApplicationRequestMapper

java.lang.Object
cloud.piranha.webapp.impl.DefaultWebApplicationRequestMapper
All Implemented Interfaces:
WebApplicationRequestMapper

public class DefaultWebApplicationRequestMapper
extends java.lang.Object
implements WebApplicationRequestMapper
The default WebApplicationRequestMapper.
Author:
Manfred Riem ([email protected])
  • Field Details

    • filterMappings

      protected final java.util.List<FilterMapping> filterMappings
      Stores the filter mappings.
    • servletMappings

      protected final java.util.concurrent.ConcurrentHashMap<java.lang.String,​java.lang.String> servletMappings
      Stores the servlet mappings.
  • Constructor Details

  • Method Details

    • addFilterMapping

      public java.util.Set<java.lang.String> addFilterMapping​(java.util.Set<DispatcherType> dispatcherTypes, java.lang.String filterName, java.lang.String... urlPatterns)
      Description copied from interface: WebApplicationRequestMapper
      Add a filter mapping.

      This adds the filter mappings at the end of list of existing mappings (if any).

      Specified by:
      addFilterMapping in interface WebApplicationRequestMapper
      Parameters:
      dispatcherTypes - the dispatcher types.
      filterName - the filter name.
      urlPatterns - the URL patterns to map (aka mappings).
      Returns:
      the URL patterns that were added.
    • addFilterMappingBeforeExisting

      public java.util.Set<java.lang.String> addFilterMappingBeforeExisting​(java.util.Set<DispatcherType> dispatcherTypes, java.lang.String filterName, java.lang.String... urlPatterns)
      Description copied from interface: WebApplicationRequestMapper
      Add a filter mapping.

      This adds the filter mappings at the start of list of existing mappings (if any). If there are existing mappings these are shifted to the right.

      Specified by:
      addFilterMappingBeforeExisting in interface WebApplicationRequestMapper
      Parameters:
      dispatcherTypes - the dispatcher types.
      filterName - the filter name.
      urlPatterns - the URL patterns to map (aka mappings).
      Returns:
      the URL patterns that were added.
    • addServletMapping

      public java.util.Set<java.lang.String> addServletMapping​(java.lang.String servletName, java.lang.String... urlPatterns)
      Add a servlet mapping.
      Specified by:
      addServletMapping in interface WebApplicationRequestMapper
      Parameters:
      servletName - the servlet name.
      urlPatterns - the URL patterns to map (aka mappings).
      Returns:
      the URL patterns that were already added.
    • findFilterMappings

      public java.util.Collection<java.lang.String> findFilterMappings​(DispatcherType dispatcherType, java.lang.String path)
      Find the filter mappings.
      Specified by:
      findFilterMappings in interface WebApplicationRequestMapper
      Parameters:
      path - the path.
      dispatcherType - the dispatcher type.
      Returns:
      the filter mappings.
    • findServletMapping

      public DefaultWebApplicationRequestMapping findServletMapping​(java.lang.String path)
      Find a servlet mapping for the given path.
      Specified by:
      findServletMapping in interface WebApplicationRequestMapper
      Parameters:
      path - the path.
      Returns:
      the mapping, or null if not found.
    • getServletMappings

      public java.util.Collection<java.lang.String> getServletMappings​(java.lang.String servletName)
      Get the mappings for the specified servlet.
      Specified by:
      getServletMappings in interface WebApplicationRequestMapper
      Parameters:
      servletName - the servlet name.
      Returns:
      the mappings, or an empty collection if none.
    • getServletName

      public java.lang.String getServletName​(java.lang.String mapping)
      Get the servlet name for the specified mapping..
      Specified by:
      getServletName in interface WebApplicationRequestMapper
      Parameters:
      mapping - the mapping.
      Returns:
      the servlet name, or null if not found.