public abstract class AuthenticatingHttpServlet
extends javax.servlet.http.HttpServlet
Modifier and Type | Field and Description |
---|---|
static String |
CLIPBOARD_ATTRIBUTE
The session attribute holding the session-scoped clipboard storage.
|
static String |
CONTEXT_ATTRIBUTE
The session attribute holding the current UserContext.
|
static String |
CREDENTIALS_ATTRIBUTE
The session attribute holding the credentials authorizing this session.
|
Constructor and Description |
---|
AuthenticatingHttpServlet() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
authenticatedService(UserContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Function called after the credentials given in the request (if any)
are authenticated.
|
static ClipboardState |
getClipboardState(javax.servlet.http.HttpSession session)
Returns the ClipboardState associated with the given session.
|
static Credentials |
getCredentials(javax.servlet.http.HttpSession session)
Returns the credentials associated with the given session.
|
static UserContext |
getUserContext(javax.servlet.http.HttpSession session)
Returns the UserContext associated with the given session.
|
protected boolean |
hasNewCredentials(javax.servlet.http.HttpServletRequest request)
Returns whether the request given has updated credentials.
|
void |
init() |
static void |
sendError(javax.servlet.http.HttpServletResponse response,
GuacamoleStatus guac_status,
String message)
Sends an error on the given HTTP response using the information within
the given GuacamoleStatus.
|
protected void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
public static final String CONTEXT_ATTRIBUTE
public static final String CREDENTIALS_ATTRIBUTE
public static final String CLIPBOARD_ATTRIBUTE
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public static void sendError(javax.servlet.http.HttpServletResponse response, GuacamoleStatus guac_status, String message) throws javax.servlet.ServletException
response
- The HTTP response to use to send the error.guac_status
- The status to sendmessage
- A human-readable message that can be presented to the
user.javax.servlet.ServletException
- If an error prevents sending of the error
code.public static Credentials getCredentials(javax.servlet.http.HttpSession session)
session
- The session to retrieve credentials from.public static UserContext getUserContext(javax.servlet.http.HttpSession session)
session
- The session to retrieve UserContext from.public static ClipboardState getClipboardState(javax.servlet.http.HttpSession session)
session
- The session to retrieve the ClipboardState from.protected boolean hasNewCredentials(javax.servlet.http.HttpServletRequest request)
request
- The request to check for credentials.protected void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
service
in class javax.servlet.http.HttpServlet
IOException
javax.servlet.ServletException
protected abstract void authenticatedService(UserContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws GuacamoleException
context
- The current UserContext.request
- The HttpServletRequest being serviced.response
- An HttpServletResponse which controls the HTTP response
of this servlet.GuacamoleException
- If an error occurs that interferes with the
normal operation of this servlet.Copyright © 2014. All rights reserved.