public class AlertServlet
extends javax.servlet.http.HttpServlet
Modifier and Type | Field and Description |
---|---|
private static DbHelper |
_dbHelper
The _db helper.
|
private static java.lang.String |
_dbName
The _db name.
|
private static java.lang.String |
_driverName
The _driver name.
|
private static java.lang.String |
_hostName
The _host name.
|
protected static org.apache.log4j.Logger |
_logger
The _logger.
|
private static java.lang.String |
_passwordString
The _password string.
|
private static java.util.Properties |
_props
The _props.
|
private static java.lang.String |
_userName
The _user name.
|
private static long |
serialVersionUID
The Constant serialVersionUID.
|
Constructor and Description |
---|
AlertServlet()
Instantiates a new alert servlet.
|
Modifier and Type | Method and Description |
---|---|
private void |
addAlert(java.lang.String arg,
java.io.Writer out)
Adds the alert.
|
private void |
createAlertXmlList(java.io.Writer out)
Creates the alert xml list.
|
private void |
deleteAlert(java.lang.String arg,
java.io.Writer out)
Delete alert.
|
private void |
determineResult(java.lang.String arg,
java.io.Writer out)
Determine result.
|
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse rsp)
Generate the REST interface for alerts.
|
static void |
main(java.lang.String[] args)
The main method.
|
private void |
outputPrettyXml(org.dom4j.Document doc,
java.io.Writer out)
Output pretty xml.
|
private void |
setup()
Setup database access
|
private void |
showAlert(java.lang.String arg,
java.io.Writer out)
Show alert.
|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
private static final long serialVersionUID
private static DbHelper _dbHelper
private static java.util.Properties _props
private static java.lang.String _hostName
private static java.lang.String _dbName
private static java.lang.String _driverName
private static java.lang.String _userName
private static java.lang.String _passwordString
protected static org.apache.log4j.Logger _logger
private void setup()
private void outputPrettyXml(org.dom4j.Document doc, java.io.Writer out)
doc
- the dom4j Document that contains the DOMout
- the Writer that displays the xml/htmlprivate void createAlertXmlList(java.io.Writer out)
out
- the Writer that displays the xml/htmlprivate void addAlert(java.lang.String arg, java.io.Writer out)
arg
- the String containing the parameters of the alert (/AddAlert/uid=abc123&source=Foo&target=Bar&description=one, two, three...")out
- the Writer that displays the xml/htmlprivate void showAlert(java.lang.String arg, java.io.Writer out)
arg
- the parameters (/AddAlert/uid=abc123&source=Foo&target=Bar&description=one, two, three...")out
- the Writer that displays the xml/htmlprivate void deleteAlert(java.lang.String arg, java.io.Writer out)
arg
- the parameters (/AddAlert/uid=abc123&source=Foo&target=Bar&description=one, two, three...")out
- the Writer that displays the xml/htmlprivate void determineResult(java.lang.String arg, java.io.Writer out)
arg
- the parameters (/AddAlert/uid=abc123&source=Foo&target=Bar&description=one, two, three...")out
- the Writer that displays the xml/htmlpublic void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp)
doGet
in class javax.servlet.http.HttpServlet
req
- the HttpServletRequestrsp
- the HttpServletResponsepublic static void main(java.lang.String[] args)
args
- the arguments