Package org.apache.camel.component.rest
Class RestApiEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.component.rest.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
-
Constructor Summary
Constructors Constructor Description RestApiEndpoint(String endpointUri, RestApiComponent component)
-
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 servicevoid
setPath(String path)
The base path-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, doStart, doStop, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
DEFAULT_API_COMPONENT_NAME
public static final String DEFAULT_API_COMPONENT_NAME
- See Also:
- Constant Field Values
-
RESOURCE_PATH
public static final String RESOURCE_PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RestApiEndpoint
public RestApiEndpoint(String endpointUri, RestApiComponent component)
-
-
Method Detail
-
getComponent
public RestApiComponent getComponent()
- Overrides:
getComponent
in classorg.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
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
- Throws:
Exception
-
isLenientProperties
public boolean isLenientProperties()
- Specified by:
isLenientProperties
in interfaceorg.apache.camel.Endpoint
- Overrides:
isLenientProperties
in classorg.apache.camel.support.DefaultEndpoint
-
-