Class RestApiEndpoint

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @UriEndpoint(firstVersion="2.16.0",
                 scheme="rest-api",
                 title="REST API",
                 syntax="rest-api:path/contextIdPattern",
                 consumerOnly=true,
                 label="core,rest",
                 lenientProperties=true)
    public class RestApiEndpoint
    extends org.apache.camel.support.DefaultEndpoint
    Expose OpenAPI Specification of the REST services defined using Camel REST DSL.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String DEFAULT_API_COMPONENT_NAME  
      static String RESOURCE_PATH  
      • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.camel.Consumer createConsumer​(org.apache.camel.Processor processor)  
      org.apache.camel.Producer createProducer()  
      String getApiComponentName()  
      RestApiComponent getComponent()  
      String getConsumerComponentName()  
      String getContextIdPattern()  
      Map<String,​Object> getParameters()  
      String getPath()  
      boolean isLenientProperties()  
      void setApiComponentName​(String apiComponentName)
      The Camel Rest API component to use for generating the API of the REST services, such as openapi.
      void setConsumerComponentName​(String consumerComponentName)
      The Camel Rest component to use for (consumer) the REST transport, such as jetty, servlet, undertow.
      void setContextIdPattern​(String contextIdPattern)
      Optional CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern.
      void setParameters​(Map<String,​Object> parameters)
      Additional parameters to configure the consumer of the REST transport for this REST service
      void setPath​(String path)
      The base path
      • Methods inherited from class org.apache.camel.support.DefaultEndpoint

        configureConsumer, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, doStart, doStop, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doBuild, 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.Endpoint

        getEndpointBaseUri, isSingletonProducer
      • 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
    • Method Detail

      • getComponent

        public RestApiComponent getComponent()
        Overrides:
        getComponent in class org.apache.camel.support.DefaultEndpoint
      • getPath

        public String getPath()
      • setPath

        public void setPath​(String path)
        The base path
      • getContextIdPattern

        public String getContextIdPattern()
      • setContextIdPattern

        public void setContextIdPattern​(String contextIdPattern)
        Optional CamelContext id pattern to only allow Rest APIs from rest services within CamelContext's which name matches the pattern.
      • getConsumerComponentName

        public String getConsumerComponentName()
      • setConsumerComponentName

        public void setConsumerComponentName​(String consumerComponentName)
        The Camel Rest component to use for (consumer) the REST transport, such as jetty, servlet, undertow. If no component has been explicit configured, then Camel will lookup if there is a Camel component that integrates with the Rest DSL, or if a org.apache.camel.spi.RestConsumerFactory is registered in the registry. If either one is found, then that is being used.
      • getApiComponentName

        public String getApiComponentName()
      • setApiComponentName

        public void setApiComponentName​(String apiComponentName)
        The Camel Rest API component to use for generating the API of the REST services, such as openapi.
      • setParameters

        public void setParameters​(Map<String,​Object> parameters)
        Additional parameters to configure the consumer of the REST transport for this REST service
      • createProducer

        public org.apache.camel.Producer createProducer()
                                                 throws Exception
        Throws:
        Exception
      • createConsumer

        public org.apache.camel.Consumer createConsumer​(org.apache.camel.Processor processor)
                                                 throws Exception
        Throws:
        Exception
      • isLenientProperties

        public boolean isLenientProperties()
        Specified by:
        isLenientProperties in interface org.apache.camel.Endpoint
        Overrides:
        isLenientProperties in class org.apache.camel.support.DefaultEndpoint