public class HTTPTransport
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
localId |
(package private) static org.slf4j.Logger |
logger |
private AServProtocolManager |
manager |
private java.lang.String |
myId |
private java.lang.String |
returnType |
private org.eclipse.jetty.server.Server |
server |
private java.lang.String |
serverId |
private java.util.Vector<AlignmentServiceProfile> |
services |
private java.lang.String |
tcpHost |
private int |
tcpPort |
Constructor and Description |
---|
HTTPTransport() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private void |
decodeParams(java.lang.String params,
java.util.Properties p) |
void |
init(java.util.Properties params,
AServProtocolManager manager,
java.util.Vector<AlignmentServiceProfile> serv)
Starts a HTTP server to given port.
|
private int |
newId() |
protected HTTPResponse |
noManager(java.lang.String type) |
HTTPResponse |
returnAlignment(java.lang.String uri,
java.lang.String mimeType)
Returns the alignment in negociated format
|
HTTPResponse |
returnNetwork(java.lang.String uri,
java.lang.String mimeType)
Returns the network in HTML or RDF
|
HTTPResponse |
serve(java.lang.String uri,
java.lang.String method,
java.util.Properties header,
java.util.Properties parms)
Override this to customize the server.
|
static final org.slf4j.Logger logger
private int tcpPort
private java.lang.String tcpHost
private org.eclipse.jetty.server.Server server
private AServProtocolManager manager
private java.util.Vector<AlignmentServiceProfile> services
private java.lang.String myId
private java.lang.String serverId
private int localId
private java.lang.String returnType
public void init(java.util.Properties params, AServProtocolManager manager, java.util.Vector<AlignmentServiceProfile> serv) throws AServException
params:
- the parameters of the connection, including HTTP port and hostmanager:
- the manager which will deal with connectionsserv:
- the set of services to be listening on this connectionAServException
- when something goes wrong (e.g., socket already in use)public void close()
public HTTPResponse serve(java.lang.String uri, java.lang.String method, java.util.Properties header, java.util.Properties parms)
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 decodedprotected HTTPResponse noManager(java.lang.String type)
public HTTPResponse returnAlignment(java.lang.String uri, java.lang.String mimeType)
uri:
- the URI of an alignmentmimeType:
- the MIME type in which the alignment is requestedpublic HTTPResponse returnNetwork(java.lang.String uri, java.lang.String mimeType)
uri:
- the URI of a network of ontologiesmimeType:
- the MIME type in which the network of ontologies is requestedprivate int newId()
private void decodeParams(java.lang.String params, java.util.Properties p) throws java.lang.InterruptedException
java.lang.InterruptedException
(C) INRIA & friends, 2003-2020