Class JettyLib

java.lang.Object
org.apache.jena.fuseki.jetty.JettyLib

public class JettyLib extends Object
Helpers for working with Jetty.

SecurityHandler

     UserStore userStore = JettyLib.makeUserStore(...);
     SecurityHandler securityHandler = JettyLib.makeSecurityHandler(String pathSpec, String realm, UserStore userStore);
  
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static AuthScheme
    Current auth mode
    static final AuthScheme
    Default setting.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addHandler(org.eclipse.jetty.server.Server server, org.eclipse.jetty.server.Handler handler)
    Add or append a Handler to a Jetty Server.
    static void
    addPathConstraint(org.eclipse.jetty.security.ConstraintSecurityHandler securityHandler, String pathSpec)
     
    static void
    addPathConstraint(org.eclipse.jetty.security.ConstraintSecurityHandler securityHandler, String pathSpec, String role)
     
    static org.eclipse.jetty.security.UserStore
    addUser(org.eclipse.jetty.security.UserStore userStore, String user, String password)
     
    static org.eclipse.jetty.security.UserStore
    addUser(org.eclipse.jetty.security.UserStore userStore, String user, String password, String role)
    Make a UserStore for a single user,password,role
    static org.eclipse.jetty.server.HttpConfiguration
    HTTP configuration with setting for Fuseki workload.
    static org.eclipse.jetty.security.ConstraintSecurityHandler
    makeSecurityHandler(String realm, org.eclipse.jetty.security.UserStore userStore)
    Create a Jetty SecurityHandler for basic authentication.
    static org.eclipse.jetty.security.ConstraintSecurityHandler
    makeSecurityHandler(String realm, org.eclipse.jetty.security.UserStore userStore, String role, AuthScheme authMode)
    Create a Jetty SecurityHandler for basic authentication.
    static org.eclipse.jetty.security.ConstraintSecurityHandler
    makeSecurityHandler(String realm, org.eclipse.jetty.security.UserStore userStore, AuthScheme authMode)
    Create a Jetty SecurityHandler for basic authentication.
    static org.eclipse.jetty.security.SecurityHandler
    makeSecurityHandlerForPathspec(String pathSpec, String realm, org.eclipse.jetty.security.UserStore userStore)
    Create a Jetty SecurityHandler for a specific pathSpace, e.g /database.
    static org.eclipse.jetty.security.UserStore
    makeUserStore(String passwordFile)
    Make a UserStore from a password file.
    static org.eclipse.jetty.security.UserStore
    makeUserStore(String user, String password)
    Make a UserStore for a single user,password in any role.
    static org.eclipse.jetty.security.UserStore
    makeUserStore(String user, String password, String role)
    Make a UserStore for a single user,password,role
    static void
    setMimeTypes(org.eclipse.jetty.servlet.ServletContextHandler context)
    Add the RDF MIME Type mappins

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • dftAuthMode

      public static final AuthScheme dftAuthMode
      Default setting.
    • authMode

      public static AuthScheme authMode
      Current auth mode
  • Constructor Details

    • JettyLib

      public JettyLib()
  • Method Details

    • makeSecurityHandlerForPathspec

      public static org.eclipse.jetty.security.SecurityHandler makeSecurityHandlerForPathspec(String pathSpec, String realm, org.eclipse.jetty.security.UserStore userStore)
      Create a Jetty SecurityHandler for a specific pathSpace, e.g /database.
    • makeSecurityHandler

      public static org.eclipse.jetty.security.ConstraintSecurityHandler makeSecurityHandler(String realm, org.eclipse.jetty.security.UserStore userStore)
      Create a Jetty SecurityHandler for basic authentication. See addPathConstraint(ConstraintSecurityHandler, String) for adding the pathspec to apply it to.
    • makeSecurityHandler

      public static org.eclipse.jetty.security.ConstraintSecurityHandler makeSecurityHandler(String realm, org.eclipse.jetty.security.UserStore userStore, AuthScheme authMode)
      Create a Jetty SecurityHandler for basic authentication. See addPathConstraint(ConstraintSecurityHandler, String) for adding the pathspec to apply it to.
    • makeSecurityHandler

      public static org.eclipse.jetty.security.ConstraintSecurityHandler makeSecurityHandler(String realm, org.eclipse.jetty.security.UserStore userStore, String role, AuthScheme authMode)
      Create a Jetty SecurityHandler for basic authentication. See addPathConstraint(ConstraintSecurityHandler, String) for adding the pathspec to apply it to.
    • addPathConstraint

      public static void addPathConstraint(org.eclipse.jetty.security.ConstraintSecurityHandler securityHandler, String pathSpec)
    • addPathConstraint

      public static void addPathConstraint(org.eclipse.jetty.security.ConstraintSecurityHandler securityHandler, String pathSpec, String role)
    • makeUserStore

      public static org.eclipse.jetty.security.UserStore makeUserStore(String passwordFile)
      Make a UserStore from a password file. PropertyUserStore for details.
    • makeUserStore

      public static org.eclipse.jetty.security.UserStore makeUserStore(String user, String password)
      Make a UserStore for a single user,password in any role.
    • makeUserStore

      public static org.eclipse.jetty.security.UserStore makeUserStore(String user, String password, String role)
      Make a UserStore for a single user,password,role
    • addUser

      public static org.eclipse.jetty.security.UserStore addUser(org.eclipse.jetty.security.UserStore userStore, String user, String password)
    • addUser

      public static org.eclipse.jetty.security.UserStore addUser(org.eclipse.jetty.security.UserStore userStore, String user, String password, String role)
      Make a UserStore for a single user,password,role
    • addHandler

      public static void addHandler(org.eclipse.jetty.server.Server server, org.eclipse.jetty.server.Handler handler)
      Add or append a Handler to a Jetty Server.
    • setMimeTypes

      public static void setMimeTypes(org.eclipse.jetty.servlet.ServletContextHandler context)
      Add the RDF MIME Type mappins
    • httpConfiguration

      public static org.eclipse.jetty.server.HttpConfiguration httpConfiguration()
      HTTP configuration with setting for Fuseki workload. No "secure" settings.