Package net.ionite.docval.server
Class DocValHttpServer
java.lang.Object
java.lang.Thread
net.ionite.docval.server.DocValHttpServer
- All Implemented Interfaces:
Runnable
HTTP Server for bulk- or continuous validation.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorDescriptionDocValHttpServer
(String configFile) Initialize a server with the configuration in the given configuration file.DocValHttpServer
(ConfigData configData) Initialize a server with the configuration in the given configuration data.DocValHttpServer
(ValidatorManager validatorManager) Initialize a server with a validator manager initialized by the caller. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(String host, int port) Add the given IP address/hostname and port number to the listeners.void
halt
(int delay) Stop the servervoid
(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.void
setValidatorManager
(ValidatorManager validatorManager) Replace the validator manager with the given onevoid
start()
Start the server on all the configured listenersMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
-
Constructor Details
-
DocValHttpServer
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 startedConfigurationError
- if there is an error in the configuration
-
DocValHttpServer
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 startedConfigurationError
- if there is an error in the configuration
-
DocValHttpServer
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 Details
-
loadConfigFile
(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
Replace the validator manager with the given one -
addListener
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 -
halt
public void halt(int delay) Stop the server
-