Class PlatformHttpComponent

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Component, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.RestApiConsumerFactory, org.apache.camel.spi.RestConsumerFactory, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @Component("platform-http")
    public class PlatformHttpComponent
    extends org.apache.camel.support.DefaultComponent
    implements org.apache.camel.spi.RestConsumerFactory, org.apache.camel.spi.RestApiConsumerFactory
    Exposes HTTP endpoints leveraging the given platform's (SpringBoot, WildFly, Quarkus, ...) HTTP server.
    • Field Summary

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHttpEndpoint​(String uri, String verbs)
      Adds a known http endpoint managed by this component.
      org.apache.camel.Consumer createApiConsumer​(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor, String contextPath, org.apache.camel.spi.RestConfiguration configuration, Map<String,​Object> parameters)  
      org.apache.camel.Consumer createConsumer​(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor, String verb, String basePath, String uriTemplate, String consumes, String produces, org.apache.camel.spi.RestConfiguration configuration, Map<String,​Object> parameters)  
      protected org.apache.camel.Endpoint createEndpoint​(String uri, String remaining, Map<String,​Object> parameters)  
      protected void doInit()  
      protected void doStart()  
      protected void doStop()  
      PlatformHttpEngine getEngine()  
      Set<HttpEndpointModel> getHttpEndpoints()
      Lists the known http endpoints managed by this component.
      void removeHttpEndpoint​(String uri)
      Removes a known http endpoint managed by this component.
      void setEngine​(PlatformHttpEngine engine)
      Sets the PlatformHttpEngine to use.
      • Methods inherited from class org.apache.camel.support.DefaultComponent

        afterConfiguration, createEndpoint, createEndpoint, doBuild, 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, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doFail, doLifecycleChange, doResume, doShutdown, 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 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 Detail

      • PlatformHttpComponent

        public PlatformHttpComponent()
      • PlatformHttpComponent

        public PlatformHttpComponent​(org.apache.camel.CamelContext context)
    • Method Detail

      • createEndpoint

        protected org.apache.camel.Endpoint createEndpoint​(String uri,
                                                           String remaining,
                                                           Map<String,​Object> parameters)
                                                    throws Exception
        Specified by:
        createEndpoint in class org.apache.camel.support.DefaultComponent
        Throws:
        Exception
      • createApiConsumer

        public org.apache.camel.Consumer createApiConsumer​(org.apache.camel.CamelContext camelContext,
                                                           org.apache.camel.Processor processor,
                                                           String contextPath,
                                                           org.apache.camel.spi.RestConfiguration configuration,
                                                           Map<String,​Object> parameters)
                                                    throws Exception
        Specified by:
        createApiConsumer in interface org.apache.camel.spi.RestApiConsumerFactory
        Throws:
        Exception
      • createConsumer

        public org.apache.camel.Consumer createConsumer​(org.apache.camel.CamelContext camelContext,
                                                        org.apache.camel.Processor processor,
                                                        String verb,
                                                        String basePath,
                                                        String uriTemplate,
                                                        String consumes,
                                                        String produces,
                                                        org.apache.camel.spi.RestConfiguration configuration,
                                                        Map<String,​Object> parameters)
                                                 throws Exception
        Specified by:
        createConsumer in interface org.apache.camel.spi.RestConsumerFactory
        Throws:
        Exception
      • addHttpEndpoint

        public void addHttpEndpoint​(String uri,
                                    String verbs)
        Adds a known http endpoint managed by this component.
      • removeHttpEndpoint

        public void removeHttpEndpoint​(String uri)
        Removes a known http endpoint managed by this component.
      • getHttpEndpoints

        public Set<HttpEndpointModel> getHttpEndpoints()
        Lists the known http endpoints managed by this component. The endpoints are without host:port/[context-path]
      • doStart

        protected void doStart()
                        throws Exception
        Overrides:
        doStart in class org.apache.camel.support.DefaultComponent
        Throws:
        Exception
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.apache.camel.support.DefaultComponent
        Throws:
        Exception
      • doInit

        protected void doInit()
                       throws Exception
        Overrides:
        doInit in class org.apache.camel.support.DefaultComponent
        Throws:
        Exception