Class SlackEventsApiServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.slack.api.app_backend.events.servlet.SlackEventsApiServlet
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public abstract class SlackEventsApiServlet
extends javax.servlet.http.HttpServlet
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description SlackEventsApiServlet() -
Method Summary
Modifier and Type Method Description voiddestroy()protected voiddoPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)protected StringdoReadRequestBodyAsString(javax.servlet.http.HttpServletRequest req)Reads the request body and returns the value as a string.protected StringgetSlackSigningSecret()Returns the signing secret supposed to be used for verifying requests from Slack.voidinit()protected booleanisSignatureVerifierEnabled()If you'd like to do the same in a servlet filter, return false instead.protected abstract voidsetupDispatcher(EventsDispatcher dispatcher)Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
Constructor Details
-
SlackEventsApiServlet
public SlackEventsApiServlet()
-
-
Method Details
-
setupDispatcher
-
init
public void init() throws javax.servlet.ServletException- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroyin interfacejavax.servlet.Servlet- Overrides:
destroyin classjavax.servlet.GenericServlet
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws IOException- Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
IOException
-
getSlackSigningSecret
Returns the signing secret supposed to be used for verifying requests from Slack. -
isSignatureVerifierEnabled
protected boolean isSignatureVerifierEnabled()If you'd like to do the same in a servlet filter, return false instead. -
doReadRequestBodyAsString
protected String doReadRequestBodyAsString(javax.servlet.http.HttpServletRequest req) throws IOExceptionReads the request body and returns the value as a string.- Throws:
IOException
-