- Enclosing class:
- FusekiServer
-
Method Summary
Modifier and TypeMethodDescriptionAdd a data service that includes dataset and service names.Add the dataset with given name and a default set of services including update.Add the dataset with given name and a default set of services and enabling update if allowUpdate=true.Add the dataset with given name and a default set of services including updateAdd the dataset with given name and a default set of services and enabling update if allowUpdate=true.addDataset
(String name, org.apache.jena.sparql.core.DatasetGraph dataset) Add a dataset, do not configure it in this call.addEndpoint
(String datasetName, String endpointName, org.apache.jena.fuseki.server.Operation operation) Create an endpoint on the dataset.addEndpoint
(String datasetName, String endpointName, org.apache.jena.fuseki.server.Operation operation, org.apache.jena.fuseki.auth.AuthPolicy authPolicy) Create an endpoint as a service of the dataset (i.e.Add a filter with the pathSpec.addOperation
(String datasetName, org.apache.jena.fuseki.server.Operation operation) Create an endpoint on the dataset i.e.addOperation
(String datasetName, org.apache.jena.fuseki.server.Operation operation, org.apache.jena.fuseki.auth.AuthPolicy authPolicy) Create an endpoint on the dataset i.e.addProcessor
(String pathSpec, org.apache.jena.fuseki.servlets.ActionProcessor processor) Add anActionProcessor
as a servlet.addProcessor
(String pathSpec, org.apache.jena.fuseki.servlets.ActionProcessor processor, org.slf4j.Logger log) Add anActionProcessor
as a servlet.addServlet
(String pathSpec, jakarta.servlet.http.HttpServlet servlet) Add the given servlet with thepathSpec
.addServletAttribute
(String attrName, Object value) Add a servlet attribute.auth
(org.apache.jena.atlas.web.AuthScheme authScheme) Choose the HTTP authentication scheme.build()
Build a server according to the current description.contextPath
(String path) Context path to Fuseki.enableCompact
(boolean withCompact) Add the "/$/compact/*" servlet that triggers compaction for specified dataset.enableCors
(boolean withCORS) Enable or disable a Cross Origin (CORS) filter with default settings.enableCors
(boolean withCORS, String corsConfigFile) Enable a Cross Origin (CORS) filter with a specific configuration, or disable CORS processing.enableMetrics
(boolean withMetrics) Add the "/$/metrics" servlet that responds with Prometheus metrics about the server.enablePing
(boolean withPing) Add the "/$/ping" servlet that responds to HTTP very efficiently.enableStats
(boolean withStats) Add the "/$/stats" servlet that responds with stats about the server, including counts of all calls made.enableTasks
(boolean withTasks) Add the "/$/tasks" servlet that responds with info about tasks run on the serverReturn the current list of Fuseki modules in the builder.fusekiModules
(FusekiModules modules) Set theFuseki Module
for a server.org.apache.jena.fuseki.server.DataService.Builder
getDataServiceBuilder
(String name) Get the DataService.Builder, if any, in this builder for the given service name.org.apache.jena.sparql.core.DatasetGraph
getDataset
(String name) Get the DatasetGraph, if any, being built for a service in this builder.getServletAttribute
(String attrName) Read a servlet attribute that has been set during building this server.Set the HTTPs port and read the certificate store location and password from a file.Set the HTTPs port and provide the certificate store and password.jettyServerConfig
(String filename) Build the server using a Jetty configuration file.loopback
(boolean loopback) Restrict the server to only responding to the localhost interface.maxServerThreads
(int maxThreads) Set the maximum number threads used by Jetty.numServerThreads
(int minThreads, int maxThreads) Set the number threads used by Jetty.parseConfig
(org.apache.jena.graph.Graph graph) Configure using a Fuseki services/datasets assembler in aGraph
.parseConfig
(org.apache.jena.rdf.model.Model model) Configure using a Fuseki services/datasets assembler model.parseConfigFile
(String filename) Configure using a Fuseki services/datasets assembler file.passwordFile
(String passwordFile) Set the password file.port
(int port) Set the HTTP port to run on.Set the realm used for HTTP digest authentication.registerOperation
(org.apache.jena.fuseki.server.Operation operation, String contentType, org.apache.jena.fuseki.servlets.ActionService handler) Add an operation to the server, together with its triggering Content-Type (which may be null) and servlet handler.registerOperation
(org.apache.jena.fuseki.server.Operation operation, org.apache.jena.fuseki.servlets.ActionService handler) Add an operation and handler to the server.org.apache.jena.sparql.core.DatasetGraph
Remove the dataset from being built.securityHandler
(org.eclipse.jetty.security.SecurityHandler securityHandler) Set a Jetty SecurityHandler.serverAuthPolicy
(org.apache.jena.fuseki.auth.AuthPolicy authPolicy) Set the server-wide server authorizationAuthPolicy
.start()
Shortcut: build, then start the server.Get the location (if any has been set) to serve static files from.staticFileBase
(String directory) Set the location (filing system directory) to serve static files from.verbose
(boolean verbose) Set verbose logging
-
Method Details
-
port
Set the HTTP port to run on.If set to 0, a random free port will be used.
-
contextPath
Context path to Fuseki. If it's "/" then Fuseki URL look like "http://host:port/dataset/query" else "http://host:port/path/dataset/query" The default is "/". -
loopback
Restrict the server to only responding to the localhost interface. -
staticFileBase
Set the location (filing system directory) to serve static files from. -
staticFileBase
Get the location (if any has been set) to serve static files from. Return null if unset. -
securityHandler
public FusekiServer.Builder securityHandler(org.eclipse.jetty.security.SecurityHandler securityHandler) Set a Jetty SecurityHandler.This is an alternative to using the Fuseki Main built-in security configuration.
-
verbose
Set verbose logging -
enableCors
Enable or disable a Cross Origin (CORS) filter with default settings.- See Also:
-
CrossOriginFilter
-
enableCors
Enable a Cross Origin (CORS) filter with a specific configuration, or disable CORS processing.- See Also:
-
CrossOriginFilter
-
enablePing
Add the "/$/ping" servlet that responds to HTTP very efficiently. This is useful for testing whether a server is alive, for example, from a load balancer. -
enableStats
Add the "/$/stats" servlet that responds with stats about the server, including counts of all calls made. -
enableMetrics
Add the "/$/metrics" servlet that responds with Prometheus metrics about the server. -
enableCompact
Add the "/$/compact/*" servlet that triggers compaction for specified dataset. Also adds the "/$/tasks/*" servlet if compact is enabled (but if compact is disabled, then tasks is not automatically disabled). -
enableTasks
Add the "/$/tasks" servlet that responds with info about tasks run on the server -
getDataServiceBuilder
Get the DataService.Builder, if any, in this builder for the given service name.Returns the
DataService.Builder
or null.This operation does not return the FusekiServer builder.
-
getDataset
Get the DatasetGraph, if any, being built for a service in this builder.Returns the DatasetGraph or null.
This operation does not return the FusekiServer builder.
-
remove
Remove the dataset from being built.Returns the DatasetGraph or null.
This operation does not return the builder.
-
add
Add the dataset with given name and a default set of services including update. This is equivalent toadd(name, dataset, true)
. -
add
Add the dataset with given name and a default set of services including update -
add
public FusekiServer.Builder add(String name, org.apache.jena.query.Dataset dataset, boolean allowUpdate) Add the dataset with given name and a default set of services and enabling update if allowUpdate=true. -
add
public FusekiServer.Builder add(String name, org.apache.jena.sparql.core.DatasetGraph dataset, boolean allowUpdate) Add the dataset with given name and a default set of services and enabling update if allowUpdate=true. -
addDataset
public FusekiServer.Builder addDataset(String name, org.apache.jena.sparql.core.DatasetGraph dataset) Add a dataset, do not configure it in this call. Subsequent calls ofaddEndpoint
andaddOperation
will be needed to give this dataset some functionality.This operation replaces any previous dataset and configuration with the same canonical name.
DataService.Builder
. for building the DataService separately. -
add
public FusekiServer.Builder add(String name, org.apache.jena.fuseki.server.DataService.Builder dataServiceBuilder) -
add
Add a data service that includes dataset and service names. ADataService
allows for choices of the various endpoint names. A DataService added with this operation cannot be modified further with other builder calls. -
parseConfigFile
Configure using a Fuseki services/datasets assembler file.The application is responsible for ensuring a correct classpath. For example, including a dependency on
jena-text
if the configuration file includes a text index. -
parseConfig
Configure using a Fuseki services/datasets assembler model.The application is responsible for ensuring a correct classpath. For example, including a dependency on
jena-text
if the configuration file includes a text index. -
parseConfig
Configure using a Fuseki services/datasets assembler in aGraph
.The application is responsible for ensuring a correct classpath. For example, including a dependency on
jena-text
if the configuration file includes a text index. -
jettyServerConfig
Build the server using a Jetty configuration file. See Jetty/Reference/jetty.xml_syntax This is instead of any other HTTP server settings such as port and HTTPs. -
auth
Choose the HTTP authentication scheme. -
serverAuthPolicy
Set the server-wide server authorizationAuthPolicy
. Defaults to "logged in users" if a password file provided but no other policy. To allow any one to access the server, useAuth.ANY_ANON
. -
realm
Set the realm used for HTTP digest authentication. -
passwordFile
Set the password file. This will be used to build asecurity handler
if one is not supplied. Setting null clears any previous entry. The file should be in the format of Eclipse jetty password file. -
https
Set the HTTPs port and provide the certificate store and password.
Pass -1 for the httpsPort to clear the settings.
Pass port 0 to get an allocated free port on startup. -
https
Set the HTTPs port and read the certificate store location and password from a file. The file can be secured by the host OS. This means the password for the certificate is not in the application code.The file format is a JSON object:
{ "keystore" : "mykey.jks" , "passwd" : "certificate password" }
Pass -1 for the httpsPort to clear the settings.
Pass port 0 to get an allocated free port on startup. -
addProcessor
public FusekiServer.Builder addProcessor(String pathSpec, org.apache.jena.fuseki.servlets.ActionProcessor processor) Add anActionProcessor
as a servlet.ActionProcessor
are the implementation of servlet handling that operate within the Fuseki logging and execution framework. -
addProcessor
public FusekiServer.Builder addProcessor(String pathSpec, org.apache.jena.fuseki.servlets.ActionProcessor processor, org.slf4j.Logger log) Add anActionProcessor
as a servlet.ActionProcessor
are the implementation of servlet handling that operate within the Fuseki logging and execution framework. -
addServlet
Add the given servlet with thepathSpec
. These servlets are added so that they are checked after the Fuseki filter for datasets and before the static content handler (which is the last servlet) used forstaticFileBase(String)
. -
addServletAttribute
Add a servlet attribute. Pass a value of null to remove any existing binding. -
getServletAttribute
Read a servlet attribute that has been set during building this server. -
addFilter
Add a filter with the pathSpec. Note that Fuseki dispatch uses a servlet filter which is the last in the filter chain. -
fusekiModules
Set theFuseki Module
for a server. If no modules are added to a builder, then the system-wide default set (found by loading FusekiModule via Java'sServiceLoader
mechanism) is used.Pass
null
to switch back the system-wide default set.- See Also:
-
fusekiModules
Return the current list of Fuseki modules in the builder. -
registerOperation
public FusekiServer.Builder registerOperation(org.apache.jena.fuseki.server.Operation operation, org.apache.jena.fuseki.servlets.ActionService handler) Add an operation and handler to the server. This does not enable it for any dataset.To associate an operation with a dataset, call
addEndpoint(java.lang.String, java.lang.String, org.apache.jena.fuseki.server.Operation)
after adding the dataset. -
registerOperation
public FusekiServer.Builder registerOperation(org.apache.jena.fuseki.server.Operation operation, String contentType, org.apache.jena.fuseki.servlets.ActionService handler) Add an operation to the server, together with its triggering Content-Type (which may be null) and servlet handler.To associate an operation with a dataset, call
addEndpoint(java.lang.String, java.lang.String, org.apache.jena.fuseki.server.Operation)
after adding the dataset. -
addEndpoint
public FusekiServer.Builder addEndpoint(String datasetName, String endpointName, org.apache.jena.fuseki.server.Operation operation) Create an endpoint on the dataset. The operation must already be registered with the builder. -
addEndpoint
public FusekiServer.Builder addEndpoint(String datasetName, String endpointName, org.apache.jena.fuseki.server.Operation operation, org.apache.jena.fuseki.auth.AuthPolicy authPolicy) Create an endpoint as a service of the dataset (i.e./dataset/endpointName
). The operation must already be registered with the builder. -
addOperation
public FusekiServer.Builder addOperation(String datasetName, org.apache.jena.fuseki.server.Operation operation) Create an endpoint on the dataset i.e./dataset/
for an operation that has other query parameters or a Content-Type that distinguishes it. The operation must already be registered with the builder. -
addOperation
public FusekiServer.Builder addOperation(String datasetName, org.apache.jena.fuseki.server.Operation operation, org.apache.jena.fuseki.auth.AuthPolicy authPolicy) Create an endpoint on the dataset i.e./dataset/
for an operation that has other query parameters or a Content-Type that distinguishes it. UseaddEndpoint(String, String, Operation)
when the functionality is invoked by presence of a name in the URL after the dataset name. The operation must already be registered with the builder. -
numServerThreads
Set the number threads used by Jetty. This uses aQueuedThreadPool
provided by Jetty.Argument order is (minThreads, maxThreads).
- Use (-1,-1) for Jetty "default". The Jetty 9.4 defaults are (min=8,max=200).
- If (min != -1, max is -1) then the default max is 20.
- If (min is -1, max != -1) then the default min is 2.
-
maxServerThreads
Set the maximum number threads used by Jetty. This is equivalent tonumServerThreads(-1, maxThreads)
and overrides any previous setting of the maximum number of threads. In development or in embedded use, limiting the maximum threads can be useful. -
start
Shortcut: build, then start the server. -
build
Build a server according to the current description.
-