Class HttpCommonComponent

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultComponent
org.apache.camel.support.HeaderFilterStrategyComponent
org.apache.camel.http.common.HttpCommonComponent
All Implemented Interfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Component, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasCamelContext, org.apache.camel.spi.HeaderFilterStrategyAware, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

public abstract class HttpCommonComponent extends org.apache.camel.support.HeaderFilterStrategyComponent
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected HttpBinding
     
     
    protected boolean
     

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

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

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    boolean
    Checks whether the consumer is possible to connect to the endoint.
    void
    Connects the URL specified on the endpoint to the specified processor.
    void
    Disconnects the URL specified on the endpoint from the specified processor.
     
     
    <T> T
    getParameter(Map<String,Object> parameters, String key, Class<T> type)
    Gets the parameter.
    <T> T
    getParameter(Map<String,Object> parameters, String key, Class<T> type, T defaultValue)
    Gets the parameter.
    boolean
     
    boolean
     
    void
    setAllowJavaSerializedObject(boolean allowJavaSerializedObject)
    Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object.
    void
    To use a custom HttpBinding to control the mapping between Camel message and HttpClient.
    void
    To use the shared HttpConfiguration as base configuration.
    void
    setMuteException(boolean muteException)
    If enabled and an Exchange failed processing on the consumer side the response's body won't contain the exception's stack trace.
    protected boolean
     

    Methods inherited from class org.apache.camel.support.HeaderFilterStrategyComponent Link icon

    getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategy

    Methods inherited from class org.apache.camel.support.DefaultComponent Link icon

    afterConfiguration, createEndpoint, createEndpoint, createEndpoint, doBuild, doInit, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getDefaultName, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, setProperties, useRawUri, validateParameters, validateURI

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

    build, doFail, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, 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 Link icon

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

    Methods inherited from interface org.apache.camel.Service Link icon

    build, close, init, start, stop

    Methods inherited from interface org.apache.camel.ShutdownableService Link icon

    shutdown

    Methods inherited from interface org.apache.camel.StatefulService Link icon

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

    Methods inherited from interface org.apache.camel.SuspendableService Link icon

    isSuspended, resume, suspend
  • Field Details Link icon

    • httpBinding Link icon

      @Metadata(label="advanced", description="To use a custom HttpBinding to control the mapping between Camel message and HttpClient.") protected HttpBinding httpBinding
    • httpConfiguration Link icon

      @Metadata(label="advanced", description="To use the shared HttpConfiguration as base configuration.") protected HttpConfiguration httpConfiguration
    • muteException Link icon

      @Metadata(label="consumer", defaultValue="true", description="If enabled and an Exchange failed processing on the consumer side the response\'s body won\'t contain the exception\'s stack trace.") protected boolean muteException
    • allowJavaSerializedObject Link icon

      @Metadata(label="advanced", description="Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk.") protected boolean allowJavaSerializedObject
  • Constructor Details Link icon

    • HttpCommonComponent Link icon

      protected HttpCommonComponent()
  • Method Details Link icon

    • getParameter Link icon

      public <T> T getParameter(Map<String,Object> parameters, String key, Class<T> type)
      Gets the parameter. This method doesn't resolve reference parameters in the registry.
      Parameters:
      parameters - the parameters
      key - the key
      type - the requested type to convert the value from the parameter
      Returns:
      the converted value parameter
    • getParameter Link icon

      public <T> T getParameter(Map<String,Object> parameters, String key, Class<T> type, T defaultValue)
      Gets the parameter. This method doesn't resolve reference parameters in the registry.
      Parameters:
      parameters - the parameters
      key - the key
      type - the requested type to convert the value from the parameter
      defaultValue - use this default value if the parameter does not contain the key
      Returns:
      the converted value parameter
    • connect Link icon

      public void connect(HttpConsumer consumer) throws Exception
      Connects the URL specified on the endpoint to the specified processor.
      Parameters:
      consumer - the consumer
      Throws:
      Exception - can be thrown
    • disconnect Link icon

      public void disconnect(HttpConsumer consumer) throws Exception
      Disconnects the URL specified on the endpoint from the specified processor.
      Parameters:
      consumer - the consumer
      Throws:
      Exception - can be thrown
    • canConnect Link icon

      public boolean canConnect(HttpConsumer consumer) throws Exception
      Checks whether the consumer is possible to connect to the endoint.
      Parameters:
      consumer - the consumer
      Throws:
      Exception - can be thrown
    • useIntrospectionOnEndpoint Link icon

      protected boolean useIntrospectionOnEndpoint()
      Overrides:
      useIntrospectionOnEndpoint in class org.apache.camel.support.DefaultComponent
    • getHttpBinding Link icon

      public HttpBinding getHttpBinding()
    • setHttpBinding Link icon

      public void setHttpBinding(HttpBinding httpBinding)
      To use a custom HttpBinding to control the mapping between Camel message and HttpClient.
    • getHttpConfiguration Link icon

      public HttpConfiguration getHttpConfiguration()
    • setHttpConfiguration Link icon

      public void setHttpConfiguration(HttpConfiguration httpConfiguration)
      To use the shared HttpConfiguration as base configuration.
    • isMuteException Link icon

      public boolean isMuteException()
    • setMuteException Link icon

      public void setMuteException(boolean muteException)
      If enabled and an Exchange failed processing on the consumer side the response's body won't contain the exception's stack trace.
    • isAllowJavaSerializedObject Link icon

      public boolean isAllowJavaSerializedObject()
    • setAllowJavaSerializedObject Link icon

      public void setAllowJavaSerializedObject(boolean allowJavaSerializedObject)
      Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object.

      This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk.