java.lang.Object
org.apache.jena.fuseki.server.Dispatcher

public class Dispatcher extends Object
Dispatch on registered datasets. This is the entry point into Fuseki for dataset operations.

Administration operations, and directly registered servlets and static content, are called through the usual web server process.

HTTP Request URLs, after servlet context removed, take the form /dataset or /dataset/service. The most general URL is /context/dataset/service. The DataAccessPointRegistry maps /dataset to a DataAccessPoint which is a name and a DataService.

The dispatch process is:

1. dispatch(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse) calls locateDataAccessPoint(jakarta.servlet.http.HttpServletRequest, org.apache.jena.fuseki.server.DataAccessPointRegistry) to get the DataAccessPoint and calls process(org.apache.jena.fuseki.server.DataAccessPoint, jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse).

2. process(org.apache.jena.fuseki.server.DataAccessPoint, jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse) create the HttpAction then calls dispatchAction(org.apache.jena.fuseki.servlets.HttpAction) which calls through to chooseProcessor(org.apache.jena.fuseki.servlets.HttpAction).

3. chooseProcessor(org.apache.jena.fuseki.servlets.HttpAction) does some checking and calls chooseEndpoint(org.apache.jena.fuseki.servlets.HttpAction, org.apache.jena.fuseki.server.DataService, java.lang.String).

4. chooseEndpoint(org.apache.jena.fuseki.servlets.HttpAction, org.apache.jena.fuseki.server.DataService, java.lang.String) looks at request, and determines the EndpointSet.

5. If there isn't an EndpointSet, the dispatch process returns.

6. If there is exactly one entry, this is the outcome.

7. If there are multiple choices , chooseOperation(org.apache.jena.fuseki.servlets.HttpAction, org.apache.jena.fuseki.server.EndpointSet) looks at request and decides which Operation is being requested based on SPARQL operations signatures and Content-Type.

8.There is a default for dispatches with multiple choices that can't be separated by SPARQL signature. These have no registered Content-type and no query string.

A choice by dispatch does not necessarily mean an operation is valid and will be executed. It may fail authentication or not have a registered handler.

  • Constructor Details

    • Dispatcher

      public Dispatcher()
  • Method Details

    • dispatch

      public static boolean dispatch(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Handle an HTTP request if it is sent to a registered dataset.

      Fuseki uses dynamic dispatch, the set of registered datasets can change while the server is running, so dispatch is driven off Fuseki system registries.

      If the request URL matches a registered dataset, process the request, and send the response.

      This function is called by FusekiFilter.doFilter(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse, jakarta.servlet.FilterChain).

      Returns true if the request has been handled, including an error response sent, and returns false (no error or response sent) if the request has not been handled.

      This function does not throw exceptions.

      The dispatch process is:

      • Decide the data, based on the request URI (locateDataAccessPoint(HttpServletRequest, DataAccessPointRegistry)
      • Allocate HttpAction (process(org.apache.jena.fuseki.server.DataAccessPoint, jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse), dispatchAction(org.apache.jena.fuseki.servlets.HttpAction)).
      • Decide service endpoint name (chooseProcessor(org.apache.jena.fuseki.servlets.HttpAction))
      • Decide operation chooseEndpoint(org.apache.jena.fuseki.servlets.HttpAction, org.apache.jena.fuseki.server.DataService, java.lang.String)
        • Request parameters - query string (fixed for SPARQL query and SPARQL update) (chooseOperation(org.apache.jena.fuseki.servlets.HttpAction, org.apache.jena.fuseki.server.EndpointSet))
        • Content type (chooseOperation(org.apache.jena.fuseki.servlets.HttpAction, org.apache.jena.fuseki.server.EndpointSet))
        • Default - quads operation
      • Allow authentication for the dispatch choice.
    • selectPlainOperation

      public static Operation selectPlainOperation(HttpAction action, EndpointSet epSet)
      This is a system default DispatchFunction.