|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.sip.SipServlet org.echarts.servlet.sip.EChartsProxyServlet
public class EChartsProxyServlet
SipServlet that adds monitor capability. Override handleInitialRequest, specifyRequestURI, modifyRequest, and modifyResponse to specialize this SipServlet as desired. Session (in)validation is the responsibility of the subclass. Two boolean init-param values, "isRecordRoute" and "isSupervised", can be defined in the servlet deployment descriptor to specify how requests are to be proxied. Their default values are both true.
Field Summary | |
---|---|
protected boolean |
isRecordRoute
|
protected boolean |
isSupervised
|
protected Monitor |
monitor
|
Fields inherited from class javax.servlet.sip.SipServlet |
---|
OUTBOUND_INTERFACES, PRACK_SUPPORTED, SIP_FACTORY, SIP_SESSIONS_UTIL, SUPPORTED, SUPPORTED_RFCs, TIMER_SERVICE |
Constructor Summary | |
---|---|
EChartsProxyServlet()
|
Method Summary | |
---|---|
void |
destroy()
Removes logger. |
void |
doRequest(SipServletRequest req)
Handles request processing by calling handleInitialRequest, specifyRequestURI and modifyRequest. |
void |
doResponse(SipServletResponse resp)
Handles response processing by calling modifyResponse and logging to monitor. |
protected boolean |
getBooleanInitParameter(java.lang.String paramName,
boolean defaultValue)
Get the value of an init-param (from sip.xml) representing a boolean |
Monitor |
getMonitor()
Returns this servlet's ECharts monitor. |
java.util.Properties |
getServletProperties()
Gets initialization parameters from sip.xml. |
protected boolean |
handleInitialRequest(SipServletRequest req)
Override handleInitialRequest to customize handling of initial requests. |
void |
init(javax.servlet.ServletConfig sc)
Initialize the servlet and monitor. |
protected void |
modifyRequest(SipServletRequest req)
Override this method to perform arbitrary modifications to a SipServletRequest. |
protected void |
modifyResponse(SipServletResponse resp)
Override this method to perform arbitrary modifications to a SipServletResponse |
void |
sendResponse(SipServletResponse resp)
Sends a response and logs to monitor |
protected URI |
specifyRequestURI(SipServletRequest req)
Override this method to specify the desired Request-URI for initial request |
Methods inherited from class javax.servlet.sip.SipServlet |
---|
doAck, doBranchResponse, doBye, doCancel, doErrorResponse, doInfo, doInvite, doMessage, doNotify, doOptions, doPrack, doProvisionalResponse, doPublish, doRedirectResponse, doRefer, doRegister, doSubscribe, doSuccessResponse, doUpdate, log, log, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean isRecordRoute
protected boolean isSupervised
protected Monitor monitor
Constructor Detail |
---|
public EChartsProxyServlet()
Method Detail |
---|
public void init(javax.servlet.ServletConfig sc) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
public void doRequest(SipServletRequest req) throws javax.servlet.ServletException, java.io.IOException
doRequest
in class SipServlet
javax.servlet.ServletException
java.io.IOException
public void doResponse(SipServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
doResponse
in class SipServlet
javax.servlet.ServletException
java.io.IOException
public void sendResponse(SipServletResponse resp) throws java.io.IOException
java.io.IOException
public java.util.Properties getServletProperties()
sip.xml
deployment
descriptor.public Monitor getMonitor()
protected boolean handleInitialRequest(SipServletRequest req) throws javax.servlet.ServletException, java.io.IOException
This allows the subclass to perform alternative action in handleInitialRequest, for example to act as UAS and send a final response, or set a timer to handle the request later.
req
- initial request
javax.servlet.ServletException
java.io.IOException
protected void modifyRequest(SipServletRequest req)
req
- protected void modifyResponse(SipServletResponse resp)
resp
- protected URI specifyRequestURI(SipServletRequest req)
req
- initial request
protected boolean getBooleanInitParameter(java.lang.String paramName, boolean defaultValue)
paramName
- name of init-paramdefaultValue
- default value if init-param is not specified
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |