Lagoon Advanced User Guide

User requirements

This manual describes how to extend Lagoon, and how to embed it into other application. You need to know the Java programming language to make use of this.

API documentation

The API documentation (javadoc).

Producers

To be done...

FileStorages

To implement a plugin for uploading vith some protocol, you need to implement the interface nu.staldal.lagoon.core.FileStorage. This implementation must have a public no-arg constructor to enable instantiation by Class.newInstance(). See the API docs for description of the methods you need to implement.

If feasible, make the implementation reentrant, i.e. able to start a new file before the last one is commited. If the FileStorage is not reentrant, Lagoon will have to use temporary files.

If it's not feasible to check the last update date of a file, extend nu.staldal.lagoon.core.RemoteFileStorage to store that information locally in the Lagoon working directory. See the API docs about when you need to invoke the methods of the superclass.

Choose an URL scheme for your implementation, and plug it in to Lagoon by making a file nu/staldal/lagoon/filestorage/FileStorage-URLscheme visible in the CLASSPATH. That file should contain the fully qualified class name of your implementation.

Embeeding Lagoon in other applications

Construct an instance of the nu.staldal.lagoon.core.LagoonProcessor class, the parameters to the constructor are much the same as what you put in the property file to the Lagoon CLI. Then invoke the build() method, possible multiple times. When finished, invoke the destroy() method.

See the source code of nu.staldal.lagoon.LagoonCLI.