Alignment API: Server

# Setting up an Alignment Server

An extensive presentation of the alignment API can be found at http://gforge.inria.fr/docman/?group_id=117. We also have an on-line tutorial on using it.

## Requirements

Using the alignment server requires an SQL database server. We see here, how to use mysql (http://dev.mysql.com/doc/refman).

## Creating the MySQL database

    $ sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &
    $ /usr/local/mysql/bin/mysqladmin -u root password <mysqlpassword>
    $ /usr/local/mysql/bin/mysql -u root -p<mysqlpassword>
    sql> CREATE DATABASE AServDB;
    sql> GRANT ALL PRIVILEGES ON AServDB.* TO adminAServ@localhost IDENTIFIED BY 'aaa345';
    sql> quit

Of course, you are advised to use different user, password and database name. This can be achieved either:

- by changing values of DBMSBASE, DBMSUSER and DBMSPASS in AlignmentServer and recompiling;
- by passing parameters dbmsbase, dbmsuser and dbmspass to AlignmentServer.

Sample backup of the server content:

    $ /usr/local/mysql/bin/mysqldump -u adminAServ -paaa345 AServDB > toto.sql

And restoring:

    $ /usr/local/mysql/bin/mysql -u adminAServ -paaa345 AServDB
    sql> source toto.sql;

It is also possible to use Postgres instead of MySQL, but then you should know how to do it.

## Launching the Alignment server

The next time it is sufficient that mysql is running... (with the database loaded)

    $ sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &

    $ java -jar lib/alignsvc.jar -H

The alignment server is then available through HTTP with: http://localhost:8089/html/

## Embedding more methods in the Alignment Server

Adding new matcher, renderer, evaluators, or services in the Alignment Server, is really easy. This requires that your class be an implementation of respectively AlignmentProcess, AlignmentRenderer, Evaluator or AlignmentServiceProfile. It suffices to add all the necessary jarfiles in the MANIFEST file of the Alignment Server jarfile used to launch the server (typically alignsvc.jar) and to put these jarfiles in the same location as this last one.

For instance:

    Manifest-Version: 1.0
    Created-By: your.MailAddress@example.org
    Class-Path: alignsvc.jar olgraph.jar procola.jar
    Main-Class: fr.inrialpes.exmo.align.service.AlignmentService

is the required MANIFEST file for embedding our OLA algorithm which requires two jarfiles: procola.jar and olgraph.jar.

## Ports used by the Alignment Server (by default)

The alignment server is a communicating system that communicates through TCP sockets which are bound to ports on your machines. We provide here the list of default ports and options to change them as well as the necessity for the firewalls to open these ports:

| default | option | open?
HTTP | 8089 | -H | Y
Jade | 8888 | -A
// | 1099 |  | ? (RMI)
| 7778 |  | Y (MTP HTTP)
WSDL | 7777 | -W
JXTA | 6666 | -P
MySQL | 3306 | --dbmsport | N (if on the same machine)