Class ServletEndpoint

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

    @UriEndpoint(firstVersion="2.0.0",
                 scheme="servlet",
                 extendsScheme="http",
                 title="Servlet",
                 syntax="servlet:contextPath",
                 consumerOnly=true,
                 category=HTTP)
    @Metadata(excludeProperties="httpUri")
    public class ServletEndpoint
    extends org.apache.camel.http.common.HttpCommonEndpoint
    Serve HTTP requests by a Servlet.
    • 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
    • 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()  
      ServletComponent getComponent()  
      String getContextPath()  
      String getFileNameExtWhitelist()  
      org.apache.camel.http.common.HttpBinding getHttpBinding()  
      String getServletName()  
      boolean isAttachmentMultipartBinding()  
      boolean isLenientProperties()  
      void setAttachmentMultipartBinding​(boolean attachmentMultipartBinding)
      Whether to automatic bind multipart/form-data as attachments on the Camel Exchange.
      void setContextPath​(String contextPath)
      The context-path to use
      void setFileNameExtWhitelist​(String fileNameExtWhitelist)
      Whitelist of accepted filename extensions for accepting uploaded files.
      void setHttpBinding​(org.apache.camel.http.common.HttpBinding binding)  
      void setServletName​(String name)
      Name of the servlet to use
      • Methods inherited from class org.apache.camel.http.common.HttpCommonEndpoint

        canConnect, connect, disconnect, getAuthDomain, getAuthHost, getAuthMethod, getAuthMethodPriority, getAuthPassword, getAuthUsername, getBinding, getCookieHandler, getHeaderFilterStrategy, getHttpMethod, getHttpMethodRestrict, getHttpUri, getOkStatusCodeRange, getPath, getPort, getProtocol, getProxyAuthDomain, getProxyAuthHost, getProxyAuthMethod, getProxyAuthNtHost, getProxyAuthPassword, getProxyAuthPort, getProxyAuthScheme, getProxyAuthUsername, getProxyHost, getProxyPort, getResponseBufferSize, getServiceProperties, isAsync, isBridgeEndpoint, isChunked, isConnectionClose, isCopyHeaders, isDisableStreamCache, isEagerCheckContentAvailable, isIgnoreResponseBody, isMapHttpMessageBody, isMapHttpMessageFormUrlEncodedBody, isMapHttpMessageHeaders, isMatchOnUriPrefix, isMuteException, isOptionsEnabled, isPreserveHostHeader, isThrowExceptionOnFailure, isTraceEnabled, isTransferException, setAsync, setAuthDomain, setAuthHost, setAuthMethod, setAuthMethodPriority, setAuthPassword, setAuthUsername, setBinding, setBridgeEndpoint, setChunked, setConnectionClose, setCookieHandler, setCopyHeaders, setDisableStreamCache, setEagerCheckContentAvailable, setHeaderFilterStrategy, setHttpMethod, setHttpMethodRestrict, setHttpUri, setIgnoreResponseBody, setMapHttpMessageBody, setMapHttpMessageFormUrlEncodedBody, setMapHttpMessageHeaders, setMatchOnUriPrefix, setMuteException, setOkStatusCodeRange, setOptionsEnabled, setPreserveHostHeader, setProxyAuthDomain, setProxyAuthHost, setProxyAuthMethod, setProxyAuthNtHost, setProxyAuthPassword, setProxyAuthPort, setProxyAuthScheme, setProxyAuthUsername, setProxyHost, setProxyPort, setResponseBufferSize, setThrowExceptionOnFailure, setTraceEnabled, setTransferException
      • 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 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 ServletComponent getComponent()
        Overrides:
        getComponent in class org.apache.camel.http.common.HttpCommonEndpoint
      • getHttpBinding

        public org.apache.camel.http.common.HttpBinding getHttpBinding()
        Overrides:
        getHttpBinding in class org.apache.camel.http.common.HttpCommonEndpoint
      • setHttpBinding

        public void setHttpBinding​(org.apache.camel.http.common.HttpBinding binding)
        Overrides:
        setHttpBinding in class org.apache.camel.http.common.HttpCommonEndpoint
      • getContextPath

        public String getContextPath()
      • setContextPath

        public void setContextPath​(String contextPath)
        The context-path to use
      • setServletName

        public void setServletName​(String name)
        Name of the servlet to use
      • getServletName

        public String getServletName()
      • isAttachmentMultipartBinding

        public boolean isAttachmentMultipartBinding()
      • setAttachmentMultipartBinding

        public void setAttachmentMultipartBinding​(boolean attachmentMultipartBinding)
        Whether to automatic bind multipart/form-data as attachments on the Camel Exchange.

        The options attachmentMultipartBinding=true and disableStreamCache=false cannot work together. Remove disableStreamCache to use AttachmentMultipartBinding.

        This is turn off by default as this may require servlet specific configuration to enable this when using Servlet's.

      • getFileNameExtWhitelist

        public String getFileNameExtWhitelist()
      • setFileNameExtWhitelist

        public void setFileNameExtWhitelist​(String fileNameExtWhitelist)
        Whitelist of accepted filename extensions for accepting uploaded files.

        Multiple extensions can be separated by comma, such as txt,xml.

      • 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.http.common.HttpCommonEndpoint