Interface WebServerConfig
- All Superinterfaces:
Config
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 Summary
Modifier and TypeMethodDescriptionaddHTTPService
(String name, String className, String urlPattern) Add an HTTP Service.Get Client Service configuration.Get file service configuration.getHTTPService
(String name) Get named HTTP Service configuration.Get list of HTTP Service configurations.getName()
Gets the Web Server name.GetRestServiceConfig
defined for this web server config.Remove Client Service.Remove File Service.removeHTTPService
(String name) Remove a named HTTP Service.void
Removes instance ofRestServiceConfig
.setClientService
(String name) Add a client service.setFileService
(String name) Add a file service.AddsRestServiceConfig
for this web server config.
-
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
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
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
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 nameclassName
- 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
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
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
Remove File Service.- Returns:
- service config or null if no such service existed
- Throws:
ConfigException
- if unable to remove
-
getRestServiceConfig
RestServiceConfig getRestServiceConfig()GetRestServiceConfig
defined for this web server config.- Returns:
- the REST service configuration or null if not defined
-
setRestServiceConfig
AddsRestServiceConfig
for this web server config.- Returns:
- REST service config instance
- Throws:
ConfigException
- if unable to add
-
removeRestServiceConfig
Removes instance ofRestServiceConfig
.- Throws:
ConfigException
- if fails to remove
-