Alignment API and Server 4.2.${version.update}

fr.inrialpes.exmo.align.service
Class HTMLAServProfile

java.lang.Object
  extended by fr.inrialpes.exmo.align.service.HTMLAServProfile
All Implemented Interfaces:
AlignmentServiceProfile

public class HTMLAServProfile
extends Object
implements AlignmentServiceProfile

HTMLAServProfile: an HTML provile for the Alignment server It embeds an HTTP server.


Nested Class Summary
private  class HTMLAServProfile.Chain
           
private  class HTMLAServProfile.ParameterServletResponseWrapper
          Two private cclasses for retrieving parameters
 class HTMLAServProfile.Response
          HTTP response.
 
Field Summary
private  int debug
           
static String HEADER
           
static String HTTP_BADREQUEST
          Some HTTP response status codes
static String HTTP_FORBIDDEN
          Some HTTP response status codes
static String HTTP_INTERNALERROR
          Some HTTP response status codes
static String HTTP_NOTFOUND
          Some HTTP response status codes
static String HTTP_NOTIMPLEMENTED
          Some HTTP response status codes
static String HTTP_OK
          Some HTTP response status codes
static String HTTP_REDIRECT
          Some HTTP response status codes
private  int localId
           
private  AServProtocolManager manager
           
static int MAX_FILE_SIZE
           
static String MIME_DEFAULT_BINARY
          Common mime types for dynamic content
static String MIME_HTML
          Common mime types for dynamic content
static String MIME_PLAINTEXT
          Common mime types for dynamic content
static String MIME_XML
          Common mime types for dynamic content
private  String myId
           
private  org.mortbay.jetty.Server server
           
private  String serverId
           
private  String tcpHost
           
private  int tcpPort
           
private  WSAServProfile wsmanager
           
 
Constructor Summary
HTMLAServProfile()
           
 
Method Summary
protected  String about()
           
 HTMLAServProfile.Response adminAnswer(String uri, String perf, Properties header, BasicParameters params)
          HTTP administration interface Allows some limited administration of the server through HTTP
 void close()
          Je//: should certainly do more than that!
private  void decodeParams(String params, Properties p)
           
private  String displayAnswer(Message answer, BasicParameters param)
           
 HTMLAServProfile.Response htmlAnswer(String uri, String perf, Properties header, BasicParameters params)
          User friendly HTTP interface uses the protocol but offers user-targeted interaction
 void init(Properties params, AServProtocolManager manager)
          Starts a HTTP server to given port.
private  int newId()
           
 HTMLAServProfile.Response returnAlignment(String uri)
          Returns the alignment in RDF/XML
 HTMLAServProfile.Response serve(String uri, String method, Properties header, Properties parms)
          Override this to customize the server.
private  String testErrorMessages(Message answer, BasicParameters param)
           
 HTMLAServProfile.Response wsdlAnswer(String uri, String perf, Properties header, BasicParameters params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tcpPort

private int tcpPort

tcpHost

private String tcpHost

debug

private int debug

server

private org.mortbay.jetty.Server server

manager

private AServProtocolManager manager

wsmanager

private WSAServProfile wsmanager

myId

private String myId

serverId

private String serverId

localId

private int localId

HTTP_OK

public static final String HTTP_OK
Some HTTP response status codes

See Also:
Constant Field Values

HTTP_REDIRECT

public static final String HTTP_REDIRECT
Some HTTP response status codes

See Also:
Constant Field Values

HTTP_FORBIDDEN

public static final String HTTP_FORBIDDEN
Some HTTP response status codes

See Also:
Constant Field Values

HTTP_NOTFOUND

public static final String HTTP_NOTFOUND
Some HTTP response status codes

See Also:
Constant Field Values

HTTP_BADREQUEST

public static final String HTTP_BADREQUEST
Some HTTP response status codes

See Also:
Constant Field Values

HTTP_INTERNALERROR

public static final String HTTP_INTERNALERROR
Some HTTP response status codes

See Also:
Constant Field Values

HTTP_NOTIMPLEMENTED

public static final String HTTP_NOTIMPLEMENTED
Some HTTP response status codes

See Also:
Constant Field Values

MIME_PLAINTEXT

public static final String MIME_PLAINTEXT
Common mime types for dynamic content

See Also:
Constant Field Values

MIME_HTML

public static final String MIME_HTML
Common mime types for dynamic content

See Also:
Constant Field Values

MIME_XML

public static final String MIME_XML
Common mime types for dynamic content

See Also:
Constant Field Values

MIME_DEFAULT_BINARY

public static final String MIME_DEFAULT_BINARY
Common mime types for dynamic content

See Also:
Constant Field Values

MAX_FILE_SIZE

public static final int MAX_FILE_SIZE
See Also:
Constant Field Values

HEADER

public static final String HEADER
See Also:
Constant Field Values
Constructor Detail

HTMLAServProfile

public HTMLAServProfile()
Method Detail

init

public void init(Properties params,
                 AServProtocolManager manager)
          throws AServException
Starts a HTTP server to given port.

Throws an IOException if the socket is already in use

Specified by:
init in interface AlignmentServiceProfile
Throws:
AServException

close

public void close()
Je//: should certainly do more than that!

Specified by:
close in interface AlignmentServiceProfile

serve

public HTMLAServProfile.Response serve(String uri,
                                       String method,
                                       Properties header,
                                       Properties parms)
Override this to customize the server.

(By default, this delegates to serveFile() and allows directory listing.)

Parameters:
uri - Percent-decoded URI without parameters, for example "/index.cgi"
method - "GET", "POST" etc.
parms - Parsed, percent decoded parameters from URI and, in case of POST, data.
header - Header entries, percent decoded
Returns:
HTTP response, see class Response for details

about

protected String about()

adminAnswer

public HTMLAServProfile.Response adminAnswer(String uri,
                                             String perf,
                                             Properties header,
                                             BasicParameters params)
HTTP administration interface Allows some limited administration of the server through HTTP


returnAlignment

public HTMLAServProfile.Response returnAlignment(String uri)
Returns the alignment in RDF/XML


htmlAnswer

public HTMLAServProfile.Response htmlAnswer(String uri,
                                            String perf,
                                            Properties header,
                                            BasicParameters params)
User friendly HTTP interface uses the protocol but offers user-targeted interaction


wsdlAnswer

public HTMLAServProfile.Response wsdlAnswer(String uri,
                                            String perf,
                                            Properties header,
                                            BasicParameters params)

testErrorMessages

private String testErrorMessages(Message answer,
                                 BasicParameters param)

displayAnswer

private String displayAnswer(Message answer,
                             BasicParameters param)

newId

private int newId()

decodeParams

private void decodeParams(String params,
                          Properties p)
                   throws InterruptedException
Throws:
InterruptedException

Alignment API and Server 4.2.${version.update}

(C) INRIA & friends, 2003-${curryear}