public class AgentServlet
extends javax.servlet.http.HttpServlet
It uses a REST based approach which translates a GET Url into a request. See the reference documentation for a detailed description of this servlet's features.
Constructor and Description |
---|
AgentServlet()
No argument constructor, used e.g.
|
AgentServlet(Restrictor pRestrictor)
Constructor taking a restrictor to use
|
Modifier and Type | Method and Description |
---|---|
protected LogHandler |
createLogHandler(javax.servlet.ServletConfig pServletConfig,
boolean pDebug)
Create a log handler using this servlet's logging facility for logging.
|
protected Restrictor |
createRestrictor(Configuration config)
Hook for creating an own restrictor
|
void |
destroy() |
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected void |
doOptions(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
OPTION requests are treated as CORS preflight requests
|
protected void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected LogHandler |
getLogHandler()
Get the installed log handler
|
void |
init(javax.servlet.ServletConfig pServletConfig)
Initialize the backend systems, the log handler and the restrictor.
|
doDelete, doHead, doPut, doTrace, getLastModified, service, service
public AgentServlet()
public AgentServlet(Restrictor pRestrictor)
pRestrictor
- restrictor to use or null
if the restrictor
should be created in the default way (RestrictorFactory.createRestrictor(Configuration,LogHandler)
)protected LogHandler getLogHandler()
public void init(javax.servlet.ServletConfig pServletConfig) throws javax.servlet.ServletException
createRestrictor(Configuration)
} and createLogHandler(ServletConfig, boolean)
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
pServletConfig
- servlet configurationjavax.servlet.ServletException
protected Restrictor createRestrictor(Configuration config)
config
- configuration as given to the servletprotected LogHandler createLogHandler(javax.servlet.ServletConfig pServletConfig, boolean pDebug)
RestrictorFactory.createRestrictor(Configuration,LogHandler)
so the log handler
can already be used when building up the restrictor.pServletConfig
- servlet config from where to get information to build up the log handlerpDebug
- whether to print out debug information.public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
doPost
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
protected void doOptions(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
doOptions
in class javax.servlet.http.HttpServlet
req
- the original requestresp
- the response the answer are written tojavax.servlet.ServletException
IOException
Copyright © 2021. All rights reserved.