Interface WebServerConfig

All Superinterfaces:
Config

public interface WebServerConfig extends Config
Web Server Configuration.

A Diffusion server can have any number of Web Server configurations that can be used by Connectors. A Connector that specifies a Web Server configuration itself effectively becomes a Web Server.

A Web Server and any associated file service will only be visible when associated with a connector.

A Web Server configuration can define:
1) An optional Client Service to serve Diffusion Client connections over HTTP.
2) An optional File Service to serve static file requests.
3) Any number of user defined HTTP Services. 4) Any number of user defined REST Services.

Since:
4.4
  • Method Details

    • getName

      String getName()
      Gets the Web Server name.
      Returns:
      web server name
    • getClientService

      ClientServiceConfig getClientService()
      Get Client Service configuration.

      There can only be a maximum of one Client Service.

      Returns:
      client service configuration or null if one has not been defined.
    • setClientService

      ClientServiceConfig setClientService(String name) throws ConfigException
      Add a client service.

      This may be used to add the one and only Client Service.

      Parameters:
      name - a name for the client service
      Returns:
      client service configuration
      Throws:
      ConfigException - if unable to add a client service, possibly because one already exists.
    • removeClientService

      ClientServiceConfig removeClientService() throws ConfigException
      Remove Client Service.
      Returns:
      service config or null if no such service existed
      Throws:
      ConfigException - if unable to remove
    • getHTTPServices

      List<HTTPServiceConfig> getHTTPServices()
      Get list of HTTP Service configurations.
      Returns:
      list of HTTP service configurations which may be empty if none have been defined.
    • getHTTPService

      HTTPServiceConfig getHTTPService(String name)
      Get named HTTP Service configuration.
      Parameters:
      name - the service name
      Returns:
      the service configuration or null if not defined
    • addHTTPService

      HTTPServiceConfig addHTTPService(String name, String className, String urlPattern) throws ConfigException
      Add an HTTP Service.

      Any number of HTTP services may be added.

      Parameters:
      name - HTTP service name
      className - the service class name. This must represent a class that implements the HTTPServiceHandler interface.
      urlPattern - The pattern that the URL must match for this service to be invoked.
      Returns:
      HTTP Service configuration.
      Throws:
      ConfigException - if unable to add HTTP service
    • removeHTTPService

      HTTPServiceConfig removeHTTPService(String name) throws ConfigException
      Remove a named HTTP Service.
      Parameters:
      name - service name
      Returns:
      service config or null if no such service existed
      Throws:
      ConfigException - if unable to remove
    • getFileService

      FileServiceConfig getFileService()
      Get file service configuration.

      There can only be a maximum of one file service.

      Returns:
      file service configuration or null if not defined.
    • setFileService

      FileServiceConfig setFileService(String name) throws ConfigException
      Add a file service.

      There may only be one file service so this will fail if one is already defined.

      Parameters:
      name - a name for the service
      Returns:
      file service configuration
      Throws:
      ConfigException - if unable to add file service
    • removeFileService

      FileServiceConfig removeFileService() throws ConfigException
      Remove File Service.
      Returns:
      service config or null if no such service existed
      Throws:
      ConfigException - if unable to remove
    • getRestServiceConfig

      RestServiceConfig getRestServiceConfig()
      Get RestServiceConfig defined for this web server config.
      Returns:
      the REST service configuration or null if not defined
    • setRestServiceConfig

      RestServiceConfig setRestServiceConfig() throws ConfigException
      Adds RestServiceConfig for this web server config.
      Returns:
      REST service config instance
      Throws:
      ConfigException - if unable to add
    • removeRestServiceConfig

      void removeRestServiceConfig() throws ConfigException
      Removes instance of RestServiceConfig.
      Throws:
      ConfigException - if fails to remove