# HttpMonitor

## User Manual

### V3.0

### June 2007

### Copyright, Creare Inc.

#### Introduction

HttpMonitor is an application which copies files from any URL to any WebDAV server. It monitors the remote site for changes, and updates the destination whenever a change occurs.

#### Usage

HttpMonitor may be started from the command line using the following syntax:

java -jar HttpMonitor.jar config-file

It can also be started from the WebTurbine interface.

#### Configuration File

The configuration file is an XML file which specifies where the source files are located, and where to place them. As an example:

    <monitor destURLPath="http://whf/RBNB/Video/" minimumInterval="250"
    		deltaFraction="0.5"
    		mkcolQuery="?archive=25000&amp;cache=100" debug="true">
    	<resource>
    		<url>http://wrbv1.creare.com/cgi-bin/camera.jpg</url>
    		<destFile>farmhouse.jpg</destFile>
    	</resource>
    </monitor>

The configuration file has the following elements:

- monitor. Root element. Children: resource, configMonitor, gate, auth. Attributes:
  - destURLPath - the URL folder where the files will be copied.
  - destPrefix - if specified, filenames will be automatically generated at the destination using this prefix and an integer.
  - mkcolQuery - the query string used with the MKCOL WebDAV command to create the destination folder.
  - deltaFraction - the fraction of the calculated delay interval to use until the next update. Values smaller than 1.0 cause more requests than necessary but guarantee that resource updates are not missed.
  - minimumInterval - the smallest allowed interval between updates.
  - maximumInterval - the largest allowed interval between updates.
  - successCountToMin - the number of consecutive successes which set the delay interval to the minimum value.
  - failCountToMax - the number of consecutive failures which set the delay interval to the maximum value.
  - tcpListenPort - TCP port to listen to, to stream data to connected sockets.
  - udpDestAddr - Internet address to send data packets to when files are downloaded. Must be used with
  - udpDestPort - UDP port to send packets to.
  - readTimeout - Time to wait for a resource read, in ms.
  - staggerStartup - Time between the start of consecutive downloads of resources for the first time during process startup, in ms.
  - debug - if set to "true", text is spewed to the console as files are downloaded.
- resource. Parent: monitor. Children: url, destFile, user, password, minimumInterval, maximumInterval. Attributes: none.
- url. Parent: resource. Children: none. Attributes: none. Contains the url to use to find this resource.
- destFile. Parent: resource. Children: none. Attributes: none. Contains the filename to use at the destination. Overrides the destPrefix feature.
- initialSleep. Parent: resource. Children: none. Attributes: none. Specifies a time to wait in millseconds after HttpMonitor startup, before copying the resource for the first time.
- user. Parent: resource, auth. Children: none. Attributes: none. Contains the authorization username.
- password. Parent: resource, auth. Children: none. Attributes: none. Contains the authorization password.
- minimumInterval. Parent: resource. Children: none. Attributes: none. The smallest allowed interval between updates for this resource.
- maximumInterval. Parent: resource. Children: none. Attributes: none. The largest allowed interval between updates for this resource.
- configMonitor. Parent: monitor. Children: as resource. When this URL is updated, a new configuration is loaded for the monitor, and the old resource list is discarded.
- gate. Parent: monitor. Children: as resource. This URL must be continuously updated, or else downloading will stop.
- auth. Parent: monitor. Children: user, password. This provides global authorization for all resources.
- putAuth. Parent: monitor. Children: user, password. This provides authorization for all PUTs. If not used and <auth> appears it will be used instead.

If neither destPrefix is set globally, nor destFile used on a particular resource, the resource will be copied using its source filename.