public abstract class GeneralServlet
extends javax.servlet.http.HttpServlet
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
GeneralServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected nl.b3p.ogc.utils.OGCRequest |
calcOGCRequest(javax.servlet.http.HttpServletRequest request) |
static User |
checkLogin(javax.servlet.http.HttpServletRequest request,
String pcode) |
static User |
checkLogin(javax.servlet.http.HttpServletRequest request,
String pcode,
javax.persistence.EntityManager em) |
protected static User |
checkLoginAlreadyLoggedIn(javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em,
String pcode) |
protected static User |
checkLoginLDAP(javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
protected static User |
checkLoginPersonalCode(javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em,
String pcode) |
protected static User |
checkLoginPreemptiveAuthentication(javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
protected StringBuffer |
completeUrl(StringBuffer baseUrl,
javax.servlet.http.HttpServletRequest request) |
static StringBuffer |
createBaseUrl(javax.servlet.http.HttpServletRequest request) |
static StringBuffer |
createBaseUrl(javax.servlet.http.HttpServletRequest request,
boolean useInternal) |
protected static String |
decodeBasicAuthorizationString(String authorization)
Decode the BASIC authorization string.
|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP
GET method. |
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP
POST method. |
abstract String |
getServletInfo()
Returns a short description of the
|
void |
init(javax.servlet.ServletConfig config) |
protected static boolean |
isRemoteAddressWithinIpRange(String ip,
String remote) |
protected static String |
parsePassword(String decoded)
Parse the password out of the decoded BASIC authorization header string.
|
abstract void |
parseRequestAndData(DataWrapper data,
User user)
Parses any incoming request and redirects this request to the right
handler.
|
protected static String |
parseUsername(String decoded)
Parse the username out of the BASIC authorization header string.
|
protected abstract void |
processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Processes the incoming request and calls the various methods to create
the right output stream.
|
protected StringBuffer |
requestUrl(StringBuffer baseUrl,
javax.servlet.http.HttpServletRequest request) |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, serviceprotected abstract void processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
request - servlet requestresponse - servlet responsejavax.servlet.ServletExceptionIOExceptionpublic static StringBuffer createBaseUrl(javax.servlet.http.HttpServletRequest request)
public static StringBuffer createBaseUrl(javax.servlet.http.HttpServletRequest request, boolean useInternal)
public static User checkLogin(javax.servlet.http.HttpServletRequest request, String pcode) throws Exception
Exceptionpublic static User checkLogin(javax.servlet.http.HttpServletRequest request, String pcode, javax.persistence.EntityManager em) throws AccessDeniedException
AccessDeniedExceptionprotected static User checkLoginAlreadyLoggedIn(javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em, String pcode)
protected static User checkLoginPersonalCode(javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em, String pcode)
protected static User checkLoginPreemptiveAuthentication(javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em)
protected static User checkLoginLDAP(javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em)
protected static boolean isRemoteAddressWithinIpRange(String ip, String remote)
public abstract void parseRequestAndData(DataWrapper data, User user) throws IllegalArgumentException, UnsupportedOperationException, IOException, Exception
data - map with the given parametersuser - database userIllegalArgumentExceptionUnsupportedOperationExceptionIOExceptionExceptionprotected void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
GET method.doGet in class javax.servlet.http.HttpServletrequest - servlet requestresponse - servlet responsejavax.servlet.ServletExceptionIOExceptionprotected void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
POST method.doPost in class javax.servlet.http.HttpServletrequest - servlet requestresponse - servlet responsejavax.servlet.ServletExceptionIOExceptionprotected nl.b3p.ogc.utils.OGCRequest calcOGCRequest(javax.servlet.http.HttpServletRequest request)
throws UnsupportedEncodingException,
ParserConfigurationException,
SAXException,
IOException,
ValidationException,
Exception
request - UnsupportedEncodingExceptionParserConfigurationExceptionSAXExceptionIOExceptionValidationExceptionExceptionprotected StringBuffer requestUrl(StringBuffer baseUrl, javax.servlet.http.HttpServletRequest request)
protected StringBuffer completeUrl(StringBuffer baseUrl, javax.servlet.http.HttpServletRequest request)
protected static String parseUsername(String decoded)
decoded - protected static String parsePassword(String decoded)
decoded - protected static String decodeBasicAuthorizationString(String authorization)
authorization - public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic abstract String getServletInfo()
getServletInfo in interface javax.servlet.ServletgetServletInfo in class javax.servlet.GenericServletCopyright © 2015. All rights reserved.