Class WebService

java.lang.Object
org.openremote.container.web.WebService
All Implemented Interfaces:
org.openremote.model.ContainerService

public abstract class WebService extends Object implements org.openremote.model.ContainerService
  • Field Details

  • Constructor Details

    • WebService

      public WebService()
  • Method Details

    • getLocalIpAddress

      protected static String getLocalIpAddress() throws Exception
      Throws:
      Exception
    • pathStartsWithHandler

      public static WebService.RequestHandler pathStartsWithHandler(String name, String path, io.undertow.server.HttpHandler handler)
    • getPriority

      public int getPriority()
      Description copied from interface: org.openremote.model.ContainerService
      Gets the priority of this service which is used to determine initialization order when services are auto discovered; services with a lower priority are initialized and started first.
      Specified by:
      getPriority in interface org.openremote.model.ContainerService
    • init

      public void init(org.openremote.model.Container container) throws Exception
      Description copied from interface: org.openremote.model.ContainerService
      All services are initialized in the order they have been added to the container (if container started with explicit list of services) otherwise they are initialized in order of ContainerService.getPriority().
      Specified by:
      init in interface org.openremote.model.ContainerService
      Throws:
      Exception
    • start

      public void start(org.openremote.model.Container container) throws Exception
      Description copied from interface: org.openremote.model.ContainerService
      After initialization, services are started in the order they have been added to the container (if container started with explicit list of services) otherwise they are started in order of ContainerService.getPriority().
      Specified by:
      start in interface org.openremote.model.ContainerService
      Throws:
      Exception
    • stop

      public void stop(org.openremote.model.Container container) throws Exception
      Description copied from interface: org.openremote.model.ContainerService
      When the container is shutting down, it stops all services in the reverse order they were started.
      Specified by:
      stop in interface org.openremote.model.ContainerService
      Throws:
      Exception
    • addServletDeployment

      public static io.undertow.server.HttpHandler addServletDeployment(org.openremote.model.Container container, io.undertow.servlet.api.DeploymentInfo deploymentInfo, boolean secure)
      Adds a deployment to the default servlet container and returns the started handler.
    • removeServletDeployment

      public void removeServletDeployment(io.undertow.servlet.api.DeploymentInfo deploymentInfo)
    • configureDeploymentInfo

      public static void configureDeploymentInfo(io.undertow.servlet.api.DeploymentInfo deploymentInfo)
    • getStandardProviders

      public static List<Object> getStandardProviders(boolean devMode)
      Get standard JAX-RS providers that are used in the deployment.
    • getRequestHandlers

      public List<WebService.RequestHandler> getRequestHandlers()
      When a request comes in the handlers are called in order until a handler returns a non null value; when this happens the returned WebService.RequestHandler is invoked.
    • getHostUri

      public URI getHostUri()
      Provides the LAN IPv4 address the container is bound to so it can be used in the context provider callbacks; if CB is on the other side of some sort of NAT then this won't work also assumes HTTP
    • build

      protected io.undertow.Undertow.Builder build(org.openremote.model.Container container, io.undertow.Undertow.Builder builder)
    • createResteasyDeployment

      protected org.jboss.resteasy.spi.ResteasyDeployment createResteasyDeployment(org.openremote.model.Container container, Collection<Class<?>> apiClasses, Collection<Object> apiSingletons, boolean secure)
    • getUndertow

      public io.undertow.Undertow getUndertow()
    • getCorsFilterInfo

      public static io.undertow.servlet.api.FilterInfo getCorsFilterInfo(org.openremote.model.Container container)
    • getExternalHostnames

      public static List<String> getExternalHostnames(org.openremote.model.Container container)
    • getAllowedOrigins

      public static Set<String> getAllowedOrigins(org.openremote.model.Container container)