| Configure the Server from the Command Line |
84
a) Open
web.xml
and edit the
<servlet>
and
<servlet_mapping>
sections to provide the necessary
information for validation.
The
<servlet-name>
(URL handler) value is also configured in
aspera.conf
(in the next step) and any
custom code (such as file filtering, see
Inline File Validation with URI
on page 85).
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://
xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<servlet>
<servlet-name>SimpleValidator</servlet-name>
<servlet-class>aspera.validation.SimpleValidator</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SimpleValidator</servlet-name>
<url-pattern>/SimpleValidator/validation/files</url-pattern>
</servlet-mapping>
</web-app>
b) Set the URL in
aspera.conf
.
# asconfigurator -x
"set_user_data;user_name,
username
;validation_uri,
url
"
Where
url
is the server's IP address and port, and the servlet name (URL handler) found in
web.xml
. This
adds the path to the
<transfer>
section of
aspera.conf
. For example:
<transfer>
<validation_uri>http://127.0.0.1:8080/SimpleValidator</validation_uri>
</transfer>
3.
Schedule the validation.
You can schedule validation to occur at the following events:
• run at file start
• run at file stop
• run at session start (URL validation is not supported)
• run at session stop (URL validation is not supported)
• run when crossing file threshold
You can set a Lua script validation to run at one event and a URI validation to run at another, but you can define
only one Lua script or URL. The default setting for all events is
none
.
To set them from the command line, run the applicable command:
# asconfigurator -x
"set_user_data;user_name,
username
;validation_file_start,{lua_script|uri}"
# asconfigurator -x
"set_user_data;user_name,
username
;validation_file_stop,{lua_script|uri}"
# asconfigurator -x
"set_user_data;user_name,
username
;validation_session_start,lua_script"
# asconfigurator -x
"set_user_data;user_name,
username
;validation_session_stop,lua_script"
# asconfigurator -x
"set_user_data;user_name,
username
;validation_threshold,{lua_script|uri}"