Class DocValHttpServer

  • All Implemented Interfaces:
    Runnable

    public class DocValHttpServer
    extends Thread
    HTTP Server for bulk- or continuous validation.
    • Constructor Detail

      • DocValHttpServer

        public DocValHttpServer​(String configFile)
                         throws IOException,
                                ConfigurationError
        Initialize a server with the configuration in the given configuration file.
        Parameters:
        configFile - The configuration file to read
        Throws:
        IOException - if the server could not be started
        ConfigurationError - if there is an error in the configuration
      • DocValHttpServer

        public DocValHttpServer​(ConfigData configData)
                         throws IOException,
                                ConfigurationError
        Initialize a server with the configuration in the given configuration data.
        Parameters:
        configData - The configuration data to use
        Throws:
        IOException - if the server could not be started
        ConfigurationError - if there is an error in the configuration
      • DocValHttpServer

        public DocValHttpServer​(ValidatorManager validatorManager)
        Initialize a server with a validator manager initialized by the caller. This server does not start listening automatically, the caller must call addListener() as well.
        Parameters:
        validatorManager - the validator manager to use for validation
    • Method Detail

      • loadConfigFile

        public void loadConfigFile()
                            throws IOException,
                                   ConfigurationError
        (Re)load the validation part of the configuration file used in the initializer (if any).

        Note that this does *not* reconfigure or re-initialize the listeners specified in the configuration.
        Throws:
        IOException
        ConfigurationError
      • setValidatorManager

        public void setValidatorManager​(ValidatorManager validatorManager)
        Replace the validator manager with the given one
      • addListener

        public void addListener​(String host,
                                int port)
                         throws IOException
        Add the given IP address/hostname and port number to the listeners.
        Throws:
        IOException - if the port could not be opened for listening.
      • start

        public void start()
        Start the server on all the configured listeners
        Overrides:
        start in class Thread
      • halt

        public void halt​(int delay)
        Stop the server