Class BasicJettyConsumer

All Implemented Interfaces:
AdaptrisComponent, AdaptrisMessageConsumer, AdaptrisMessageWorker, ComponentLifecycle, ComponentLifecycleExtension, MessageEventGenerator, StateManagedComponent
Direct Known Subclasses:
JettyMessageConsumer

public abstract class BasicJettyConsumer extends AdaptrisMessageConsumerImp
This is the abstract class for all implementations that make use of Jetty to receive messages.
  • Constructor Details

    • BasicJettyConsumer

      public BasicJettyConsumer()
  • Method Details

    • servletPath

      protected String servletPath()
    • validMethods

      protected String validMethods()
    • prepare

      public void prepare() throws CoreException
      Description copied from interface: ComponentLifecycleExtension
      Prepare for initialisation.
      Throws:
      CoreException
    • createMessage

      public abstract AdaptrisMessage createMessage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
      Create an AdaptrisMessage from the incoming servlet request and response.
      Parameters:
      request - the HttpServletRequest
      response - the HttpServletResponse
      Returns:
      an AdaptrisMessage instance.
      Throws:
      IOException
      javax.servlet.ServletException
      See Also:
      • HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
    • logHeaders

      protected void logHeaders(javax.servlet.http.HttpServletRequest req)
    • asServletWrapper

      protected ServletWrapper asServletWrapper() throws CoreException
      Throws:
      CoreException
    • ensureIsPath

      protected String ensureIsPath(String s) throws CoreException
      Throws:
      CoreException
    • init

      public void init() throws CoreException
      Description copied from interface: ComponentLifecycle
      Initialises the component.

      Component initialisation includes config verification, creation of connections etc.

      Throws:
      CoreException - wrapping any underlying Exceptions
      See Also:
    • start

      public void start() throws CoreException
      Description copied from interface: ComponentLifecycle
      Starts the component.

      Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer, calling start will begin message delivery.

      Throws:
      CoreException - wrapping any underlying Exceptions
      See Also:
    • stop

      public void stop()
      Description copied from interface: ComponentLifecycle
      Stop the component

      A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer, calling stop will pause message delivery. Throwing a RuntimeException may cause unintended consequences

      See Also:
    • close

      public void close()
      Description copied from interface: ComponentLifecycle
      Closes the component.

      A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException may cause unintended consequences

      See Also:
    • getTimeoutAction

      public TimeoutAction getTimeoutAction()
    • setTimeoutAction

      public void setTimeoutAction(TimeoutAction action)
      Set the behaviour that should occur when the workflow takes too long to finish.

      This setting only has an impact if the consumer is the entry point for a PoolingWorkflow instance. In the event that the wait time is exceeded, then the behaviour specified here is done.

      Parameters:
      action - the action; default is a 202 after 10 minutes.
    • getAdditionalDebug

      public Boolean getAdditionalDebug()
    • setAdditionalDebug

      public void setAdditionalDebug(Boolean additionalDebug)
    • getWarnAfter

      public TimeInterval getWarnAfter()
      Returns:
      the warnAfter
    • setWarnAfter

      public void setWarnAfter(TimeInterval t)
      Log a warning after this interval.
      Parameters:
      t - the warnAfter to set, default is to never warn.
    • getSendProcessingInterval

      public TimeInterval getSendProcessingInterval()
      Returns:
      the sendExpectEvery
    • setSendProcessingInterval

      public void setSendProcessingInterval(TimeInterval t)
      If required send a 102 upon this interval.
      Parameters:
      t - the sendExpectEvery to set, default is 20 seconds.
    • consumeLocationKey

      public String consumeLocationKey()
      Provides the metadata key '"jettyURI"' that contains the URI which triggered the consumer.
      Returns:
      the metadata key;
      Since:
      3.9.0
    • withPath

      public <T extends BasicJettyConsumer> T withPath(String path)
    • getPath

      public String getPath()
      The path we register against jetty for this consumer
    • setPath

      public void setPath(String path)
      The path we register against jetty for this consumer
    • getMethods

      public String getMethods()
      Comma separated string of valid methods.
    • setMethods

      public void setMethods(String methods)
      Comma separated string of valid methods.