public abstract class GuacamoleHTTPTunnelServlet
extends javax.servlet.http.HttpServlet
Constructor and Description |
---|
GuacamoleHTTPTunnelServlet() |
Modifier and Type | Method and Description |
---|---|
protected void |
deregisterTunnel(GuacamoleTunnel tunnel)
Deregisters the given tunnel such that future read/write requests to
that tunnel will be rejected.
|
void |
destroy() |
protected abstract GuacamoleTunnel |
doConnect(javax.servlet.http.HttpServletRequest request)
Called whenever the JavaScript Guacamole client makes a connection
request via HTTP.
|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
doRead(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String tunnelUUID)
Called whenever the JavaScript Guacamole client makes a read request.
|
protected void |
doWrite(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String tunnelUUID)
Called whenever the JavaScript Guacamole client makes a write request.
|
protected GuacamoleTunnel |
getTunnel(String tunnelUUID)
Returns the tunnel with the given UUID, if it has been registered with
registerTunnel() and not yet deregistered with deregisterTunnel().
|
protected void |
handleTunnelRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Dispatches every HTTP GET and POST request to the appropriate handler
function based on the query string.
|
protected void |
registerTunnel(GuacamoleTunnel tunnel)
Registers the given tunnel such that future read/write requests to that
tunnel will be properly directed.
|
protected void |
sendError(javax.servlet.http.HttpServletResponse response,
int guacamoleStatusCode,
int guacamoleHttpCode,
String message)
Sends an error on the given HTTP response using the information within
the given GuacamoleStatus.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
protected void registerTunnel(GuacamoleTunnel tunnel)
tunnel
- The tunnel to register.protected void deregisterTunnel(GuacamoleTunnel tunnel)
tunnel
- The tunnel to deregister.protected GuacamoleTunnel getTunnel(String tunnelUUID) throws GuacamoleException
tunnelUUID
- The UUID of registered tunnel.GuacamoleException
- If the requested tunnel does not exist because it has not yet been
registered or it has been deregistered.protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
doPost
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
protected void sendError(javax.servlet.http.HttpServletResponse response, int guacamoleStatusCode, int guacamoleHttpCode, String message) throws javax.servlet.ServletException
response
- The HTTP response to use to send the error.guacamoleStatusCode
- The GuacamoleStatus code to send.guacamoleHttpCode
- The numeric HTTP code to send.message
- The human-readable error message to send.javax.servlet.ServletException
- If an error prevents sending of the error code.protected void handleTunnelRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
request
- The HttpServletRequest associated with the GET or POST request
received.response
- The HttpServletResponse associated with the GET or POST request
received.javax.servlet.ServletException
- If an error occurs while servicing the request.protected abstract GuacamoleTunnel doConnect(javax.servlet.http.HttpServletRequest request) throws GuacamoleException
request
- The HttpServletRequest associated with the connection request
received. Any parameters specified along with the connection request
can be read from this object.GuacamoleException
- If an error occurs while constructing the GuacamoleTunnel, or if the
conditions required for connection are not met.protected void doRead(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String tunnelUUID) throws GuacamoleException
request
- The HttpServletRequest associated with the read request received.response
- The HttpServletResponse associated with the write request received.
Any data to be sent to the client in response to the write request
should be written to the response body of this HttpServletResponse.tunnelUUID
- The UUID of the tunnel to read from, as specified in the write
request. This tunnel must have been created by a previous call to
doConnect().GuacamoleException
- If an error occurs while handling the read request.protected void doWrite(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String tunnelUUID) throws GuacamoleException
request
- The HttpServletRequest associated with the write request received.
Any data to be written will be specified within the body of this
request.response
- The HttpServletResponse associated with the write request received.tunnelUUID
- The UUID of the tunnel to write to, as specified in the write
request. This tunnel must have been created by a previous call to
doConnect().GuacamoleException
- If an error occurs while handling the write request.public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
Copyright © 2018. All rights reserved.