Class LoggingHttpActivityListener

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.component.http.LoggingHttpActivityListener
All Implemented Interfaces:
AutoCloseable, org.apache.camel.CamelContextAware, HttpActivityListener, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasCamelContext, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

@Metadata(label="bean", description="Logs HTTP requests and responses for the camel-http component.", annotations="interfaceName=org.apache.camel.component.http.HttpActivityListener") @Configurer(metadataOnly=true) public class LoggingHttpActivityListener extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.CamelContextAware, HttpActivityListener
  • Field Summary

    Fields inherited from class org.apache.camel.support.service.BaseService

    BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    org.apache.camel.CamelContext
     
     
     
    int
     
    protected boolean
    isBinaryData(org.apache.hc.core5.http.ContentType ct)
    Determine whether the content type is binary or not
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    protected void
    onActivity(org.apache.camel.spi.CamelLogger logger, org.apache.camel.Exchange exchange, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.HttpEntity entity, long elapsed)
     
    void
    onRequestSubmitted(Object source, org.apache.camel.Exchange exchange, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpEntity entity)
    HTTP request is about to be sent
    void
    onResponseReceived(Object source, org.apache.camel.Exchange exchange, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.HttpEntity entity, long elapsed)
    HTTP response received
    void
    setCamelContext(org.apache.camel.CamelContext camelContext)
     
    void
    setLoggingLevel(String loggingLevel)
     
    void
     
    void
    setMaxChars(int maxChars)
     
    void
    setMultiline(boolean multiline)
     
    void
    setShowBinary(boolean showBinary)
     
    void
    setShowBody(boolean showBody)
     
    void
    setShowExchangeId(boolean showExchangeId)
     
    void
    setShowHeaders(boolean showHeaders)
     
    void
    setShowRouteGroup(boolean showRouteGroup)
     
    void
    setShowRouteId(boolean showRouteId)
     
    void
    setShowStreams(boolean showStreams)
     
    void
    setSourceLocationLoggerName(boolean sourceLocationLoggerName)
     

    Methods inherited from class org.apache.camel.support.service.BaseService

    build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop

    Methods inherited from interface org.apache.camel.ShutdownableService

    shutdown

    Methods inherited from interface org.apache.camel.StatefulService

    getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending

    Methods inherited from interface org.apache.camel.SuspendableService

    isSuspended, resume, suspend
  • Constructor Details

    • LoggingHttpActivityListener

      public LoggingHttpActivityListener()
  • Method Details

    • doInit

      protected void doInit() throws Exception
      Overrides:
      doInit in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • onRequestSubmitted

      public void onRequestSubmitted(Object source, org.apache.camel.Exchange exchange, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpEntity entity)
      Description copied from interface: HttpActivityListener
      HTTP request is about to be sent
      Specified by:
      onRequestSubmitted in interface HttpActivityListener
      Parameters:
      source - the http producer that are used
      exchange - the current exchange
      host - the host where the request is sent to
      request - the http request
      entity - the http data
    • onResponseReceived

      public void onResponseReceived(Object source, org.apache.camel.Exchange exchange, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.HttpEntity entity, long elapsed)
      Description copied from interface: HttpActivityListener
      HTTP response received
      Specified by:
      onResponseReceived in interface HttpActivityListener
      Parameters:
      source - the http producer that are used
      exchange - the current exchange
      host - the host where the response was received from
      response - the http response
      entity - the http data
      elapsed - time in millis before the response was received after sending
    • onActivity

      protected void onActivity(org.apache.camel.spi.CamelLogger logger, org.apache.camel.Exchange exchange, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.HttpEntity entity, long elapsed)
    • isBinaryData

      protected boolean isBinaryData(org.apache.hc.core5.http.ContentType ct)
      Determine whether the content type is binary or not
    • getCamelContext

      public org.apache.camel.CamelContext getCamelContext()
      Specified by:
      getCamelContext in interface org.apache.camel.spi.HasCamelContext
    • setCamelContext

      public void setCamelContext(org.apache.camel.CamelContext camelContext)
      Specified by:
      setCamelContext in interface org.apache.camel.CamelContextAware
    • getLoggingLevel

      public String getLoggingLevel()
    • setLoggingLevel

      public void setLoggingLevel(String loggingLevel)
    • isShowRouteId

      public boolean isShowRouteId()
    • setShowRouteId

      public void setShowRouteId(boolean showRouteId)
    • isShowRouteGroup

      public boolean isShowRouteGroup()
    • setShowRouteGroup

      public void setShowRouteGroup(boolean showRouteGroup)
    • isShowExchangeId

      public boolean isShowExchangeId()
    • setShowExchangeId

      public void setShowExchangeId(boolean showExchangeId)
    • isShowBody

      public boolean isShowBody()
    • setShowBody

      public void setShowBody(boolean showBody)
    • isShowStreams

      public boolean isShowStreams()
    • setShowStreams

      public void setShowStreams(boolean showStreams)
    • isShowBinary

      public boolean isShowBinary()
    • setShowBinary

      public void setShowBinary(boolean showBinary)
    • isShowHeaders

      public boolean isShowHeaders()
    • setShowHeaders

      public void setShowHeaders(boolean showHeaders)
    • getLogMask

      public Boolean getLogMask()
    • setLogMask

      public void setLogMask(Boolean logMask)
    • getMaxChars

      public int getMaxChars()
    • setMaxChars

      public void setMaxChars(int maxChars)
    • isMultiline

      public boolean isMultiline()
    • setMultiline

      public void setMultiline(boolean multiline)
    • isSourceLocationLoggerName

      public boolean isSourceLocationLoggerName()
    • setSourceLocationLoggerName

      public void setSourceLocationLoggerName(boolean sourceLocationLoggerName)