Class PlatformHttpComponent
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.component.platform.http.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.HasCamelContext,org.apache.camel.spi.HeaderFilterStrategyAware,org.apache.camel.spi.RestApiConsumerFactory,org.apache.camel.spi.RestConsumerFactory,org.apache.camel.spi.RestOpenApiConsumerFactory,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
@Component("platform-http")
public class PlatformHttpComponent
extends org.apache.camel.support.HeaderFilterStrategyComponent
implements org.apache.camel.spi.RestConsumerFactory, org.apache.camel.spi.RestApiConsumerFactory, org.apache.camel.spi.RestOpenApiConsumerFactory
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, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHttpEndpoint(String uri, String verbs, String consumes, String produces, org.apache.camel.Consumer consumer) Adds a known http endpoint managed by this component.voidaddHttpManagementEndpoint(String uri, String verbs, String consumes, String produces, org.apache.camel.Consumer consumer) Adds a known http management endpoint managed by this component.voidaddPlatformHttpListener(PlatformHttpListener listener) Adds aPlatformHttpListenerlistener.org.apache.camel.ConsumercreateApiConsumer(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.ConsumercreateConsumer(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) org.apache.camel.ConsumercreateConsumer(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor, String contextPath, org.apache.camel.spi.RestConfiguration configuration, Map<String, Object> parameters) protected org.apache.camel.Endpointprotected voiddoInit()protected voiddoStart()protected voiddoStop()Lists the known http endpoints managed by this component.Lists the known http management endpoints managed by this component.longbooleanvoidremoveHttpEndpoint(String uri) Removes a known http endpoint managed by this component.voidRemoves a known http endpoint managed by this component.voidRemoves an existingPlatformHttpListenerlistener.voidsetEngine(PlatformHttpEngine engine) Sets thePlatformHttpEngineto use.voidsetHandleWriteResponseError(boolean handleWriteResponseError) voidsetRequestTimeout(long requestTimeout) Methods inherited from class org.apache.camel.support.HeaderFilterStrategyComponent
getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategyMethods 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, validateURIMethods inherited from class org.apache.camel.support.service.BaseService
build, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
PlatformHttpComponent
public PlatformHttpComponent() -
PlatformHttpComponent
public PlatformHttpComponent(org.apache.camel.CamelContext context)
-
-
Method Details
-
createEndpoint
protected org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception- Specified by:
createEndpointin classorg.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:
createApiConsumerin interfaceorg.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:
createConsumerin interfaceorg.apache.camel.spi.RestConsumerFactory- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(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:
createConsumerin interfaceorg.apache.camel.spi.RestOpenApiConsumerFactory- Throws:
Exception
-
addHttpEndpoint
public void addHttpEndpoint(String uri, String verbs, String consumes, String produces, org.apache.camel.Consumer consumer) Adds a known http endpoint managed by this component. -
addHttpManagementEndpoint
public void addHttpManagementEndpoint(String uri, String verbs, String consumes, String produces, org.apache.camel.Consumer consumer) Adds a known http management endpoint managed by this component. -
removeHttpEndpoint
Removes a known http endpoint managed by this component. -
removeHttpManagementEndpoint
Removes a known http endpoint managed by this component. -
addPlatformHttpListener
Adds aPlatformHttpListenerlistener. -
removePlatformHttpListener
Removes an existingPlatformHttpListenerlistener. -
getHttpEndpoints
Lists the known http endpoints managed by this component. The endpoints are without host:port/[context-path] -
getHttpManagementEndpoints
Lists the known http management endpoints managed by this component. The endpoints are without host:port/[context-path] -
doStart
- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
getEngine
-
setEngine
Sets thePlatformHttpEngineto use. -
isHandleWriteResponseError
public boolean isHandleWriteResponseError() -
setHandleWriteResponseError
public void setHandleWriteResponseError(boolean handleWriteResponseError) -
getRequestTimeout
public long getRequestTimeout() -
setRequestTimeout
public void setRequestTimeout(long requestTimeout) -
doInit
- Overrides:
doInitin classorg.apache.camel.support.DefaultComponent- Throws:
Exception
-