Class RemoteFileEndpoint<T>

  • 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.BrowsableEndpoint, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService
    Direct Known Subclasses:
    FtpEndpoint, SftpEndpoint

    public abstract class RemoteFileEndpoint<T>
    extends org.apache.camel.component.file.GenericFileEndpoint<T>
    Remote file endpoint.
    • Field Summary

      • Fields inherited from class org.apache.camel.component.file.GenericFileEndpoint

        allowNullBody, antExclude, antFilter, antFilterCaseSensitive, antInclude, appendChars, autoCreate, bufferSize, charset, configuration, DEFAULT_IDEMPOTENT_CACHE_SIZE, DEFAULT_IN_PROGRESS_CACHE_SIZE, delete, doneFileName, eagerDeleteTargetFile, eagerMaxMessagesPerPoll, exclude, excludeExt, exclusiveReadLockStrategy, fileExist, fileName, filter, filterDirectory, filterFile, flatten, idempotent, idempotentKey, idempotentRepository, include, includeExt, inProgressRepository, jailStartingDirectory, keepLastModified, localWorkDirectory, maxDepth, maxMessagesPerPoll, minDepth, move, moveExisting, moveExistingFileStrategy, moveFailed, noop, onCompletionExceptionHandler, preMove, preSort, processStrategy, readLock, readLockCheckInterval, readLockDeleteOrphanLockFiles, readLockIdempotentReleaseAsync, readLockIdempotentReleaseAsyncPoolSize, readLockIdempotentReleaseDelay, readLockIdempotentReleaseExecutorService, readLockLoggingLevel, readLockMarkerFile, readLockMinAge, readLockMinLength, readLockRemoveOnCommit, readLockRemoveOnRollback, readLockTimeout, recursive, shuffle, sortBy, sorter, tempFileName, tempPrefix
      • 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 Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void afterPropertiesSet()
      Validates this endpoint if its configured properly.
      protected abstract RemoteFileConsumer<T> buildConsumer​(org.apache.camel.Processor processor)
      Remote File Endpoints, impl this method to create a custom consumer specific to their "protocol" etc.
      protected abstract org.apache.camel.component.file.GenericFileProducer<T> buildProducer()
      Remote File Endpoints, impl this method to create a custom producer specific to their "protocol" etc.
      RemoteFileConsumer<T> createConsumer​(org.apache.camel.Processor processor)  
      org.apache.camel.Exchange createExchange​(org.apache.camel.component.file.GenericFile<T> file)  
      org.apache.camel.PollingConsumer createPollingConsumer()  
      org.apache.camel.component.file.GenericFileProducer<T> createProducer()  
      abstract RemoteFileOperations<T> createRemoteFileOperations()
      Creates the operations to be used by the consumer or producer.
      RemoteFileConfiguration getConfiguration()  
      char getFileSeparator()  
      int getMaximumReconnectAttempts()  
      protected Map<String,​Object> getParamsAsMap()  
      long getReconnectDelay()  
      boolean isAbsolute​(String name)  
      boolean isDisconnect()  
      boolean isDisconnectOnBatchComplete()  
      boolean isDownload()  
      boolean isFastExistsCheck()  
      boolean isSingletonProducer()  
      String remoteServerInformation()
      Returns human readable server information for logging purpose
      void setDisconnect​(boolean disconnect)
      Whether or not to disconnect from remote FTP server right after use.
      void setDisconnectOnBatchComplete​(boolean disconnectOnBatchComplete)
      Whether or not to disconnect from remote FTP server right after a Batch upload is complete.
      void setDownload​(boolean download)
      Whether the FTP consumer should download the file.
      void setFastExistsCheck​(boolean fastExistsCheck)
      If set this option to be true, camel-ftp will use the list file directly to check if the file exists.
      void setMaximumReconnectAttempts​(int maximumReconnectAttempts)
      Specifies the maximum reconnect attempts Camel performs when it tries to connect to the remote FTP server.
      void setReconnectDelay​(long reconnectDelay)
      Delay in millis Camel will wait before performing a reconnect attempt.
      • Methods inherited from class org.apache.camel.component.file.GenericFileEndpoint

        configureExchange, configureMessage, configureMoveOrPreMoveExpression, createDoneFileName, createGenericFileStrategy, doInit, doStart, doStop, getAntExclude, getAntFilter, getAntInclude, getAppendChars, getBufferSize, getCharset, getDoneFileName, getExchanges, getExclude, getExcludeExt, getExcludePattern, getExclusiveReadLockStrategy, getFileExist, getFileName, getFilter, getFilterDirectory, getFilterFile, getGeneratedFileName, getIdempotent, getIdempotentKey, getIdempotentRepository, getInclude, getIncludeExt, getIncludePattern, getInProgressRepository, getLocalWorkDirectory, getMaxDepth, getMaxMessagesPerPoll, getMinDepth, getMove, getMoveExisting, getMoveExistingFileStrategy, getMoveFailed, getOnCompletionExceptionHandler, getPreMove, getProcessStrategy, getReadLock, getReadLockCheckInterval, getReadLockIdempotentReleaseAsyncPoolSize, getReadLockIdempotentReleaseDelay, getReadLockIdempotentReleaseExecutorService, getReadLockLoggingLevel, getReadLockMinAge, getReadLockMinLength, getReadLockTimeout, getScheme, getSortBy, getSorter, getTempFileName, getTempPrefix, isAllowNullBody, isAntFilterCaseSensitive, isAutoCreate, isDelete, isDoneFile, isEagerDeleteTargetFile, isEagerMaxMessagesPerPoll, isFlatten, isIdempotent, isIdempotentSet, isJailStartingDirectory, isKeepLastModified, isNoop, isPreSort, isReadLockDeleteOrphanLockFiles, isReadLockIdempotentReleaseAsync, isReadLockMarkerFile, isReadLockRemoveOnCommit, isReadLockRemoveOnRollback, isRecursive, isShuffle, isSynchronous, setAllowNullBody, setAntExclude, setAntFilterCaseSensitive, setAntInclude, setAppendChars, setAutoCreate, setBufferSize, setCharset, setConfiguration, setDelete, setDoneFileName, setEagerDeleteTargetFile, setEagerMaxMessagesPerPoll, setExclude, setExcludeExt, setExclusiveReadLockStrategy, setFileExist, setFileName, setFileName, setFilter, setFilterDirectory, setFilterDirectory, setFilterFile, setFilterFile, setFlatten, setIdempotent, setIdempotentKey, setIdempotentKey, setIdempotentRepository, setInclude, setIncludeExt, setInProgressRepository, setJailStartingDirectory, setKeepLastModified, setLocalWorkDirectory, setMaxDepth, setMaxMessagesPerPoll, setMinDepth, setMove, setMove, setMoveExisting, setMoveExisting, setMoveExistingFileStrategy, setMoveFailed, setMoveFailed, setNoop, setOnCompletionExceptionHandler, setPreMove, setPreMove, setPreSort, setProcessStrategy, setReadLock, setReadLockCheckInterval, setReadLockDeleteOrphanLockFiles, setReadLockIdempotentReleaseAsync, setReadLockIdempotentReleaseAsyncPoolSize, setReadLockIdempotentReleaseDelay, setReadLockIdempotentReleaseExecutorService, setReadLockLoggingLevel, setReadLockMarkerFile, setReadLockMinAge, setReadLockMinLength, setReadLockRemoveOnCommit, setReadLockRemoveOnRollback, setReadLockTimeout, setRecursive, setShuffle, setSortBy, setSortBy, setSortBy, setSorter, setSynchronous, setTempFileName, setTempFileName, setTempPrefix
      • Methods inherited from class org.apache.camel.support.ScheduledPollEndpoint

        configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay
      • Methods inherited from class org.apache.camel.support.DefaultEndpoint

        configurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, 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

        configureProperties, createAsyncProducer, createExchange, createExchange, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, getExchangePattern, isLenientProperties, setCamelContext
      • Methods inherited from interface org.apache.camel.IsSingleton

        isSingleton
      • 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

      • isSingletonProducer

        public boolean isSingletonProducer()
      • getConfiguration

        public RemoteFileConfiguration getConfiguration()
        Overrides:
        getConfiguration in class org.apache.camel.component.file.GenericFileEndpoint<T>
      • createExchange

        public org.apache.camel.Exchange createExchange​(org.apache.camel.component.file.GenericFile<T> file)
        Specified by:
        createExchange in class org.apache.camel.component.file.GenericFileEndpoint<T>
      • createProducer

        public org.apache.camel.component.file.GenericFileProducer<T> createProducer()
                                                                              throws Exception
        Specified by:
        createProducer in interface org.apache.camel.Endpoint
        Specified by:
        createProducer in class org.apache.camel.component.file.GenericFileEndpoint<T>
        Throws:
        Exception
      • createConsumer

        public RemoteFileConsumer<T> createConsumer​(org.apache.camel.Processor processor)
                                             throws Exception
        Specified by:
        createConsumer in interface org.apache.camel.Endpoint
        Specified by:
        createConsumer in class org.apache.camel.component.file.GenericFileEndpoint<T>
        Throws:
        Exception
      • createPollingConsumer

        public org.apache.camel.PollingConsumer createPollingConsumer()
                                                               throws Exception
        Specified by:
        createPollingConsumer in interface org.apache.camel.Endpoint
        Overrides:
        createPollingConsumer in class org.apache.camel.support.DefaultEndpoint
        Throws:
        Exception
      • afterPropertiesSet

        protected void afterPropertiesSet()
        Validates this endpoint if its configured properly.
        Throws:
        IllegalArgumentException - is thrown if endpoint is invalid configured for its mandatory options
      • getParamsAsMap

        protected Map<String,​Object> getParamsAsMap()
        Overrides:
        getParamsAsMap in class org.apache.camel.component.file.GenericFileEndpoint<T>
      • buildConsumer

        protected abstract RemoteFileConsumer<T> buildConsumer​(org.apache.camel.Processor processor)
        Remote File Endpoints, impl this method to create a custom consumer specific to their "protocol" etc.
        Parameters:
        processor - the processor
        Returns:
        the created consumer
      • buildProducer

        protected abstract org.apache.camel.component.file.GenericFileProducer<T> buildProducer()
        Remote File Endpoints, impl this method to create a custom producer specific to their "protocol" etc.
        Returns:
        the created producer
      • createRemoteFileOperations

        public abstract RemoteFileOperations<T> createRemoteFileOperations()
                                                                    throws Exception
        Creates the operations to be used by the consumer or producer.
        Returns:
        a new created operations
        Throws:
        Exception - is thrown if error creating operations.
      • remoteServerInformation

        public String remoteServerInformation()
        Returns human readable server information for logging purpose
      • getFileSeparator

        public char getFileSeparator()
        Specified by:
        getFileSeparator in class org.apache.camel.component.file.GenericFileEndpoint<T>
      • isAbsolute

        public boolean isAbsolute​(String name)
        Specified by:
        isAbsolute in class org.apache.camel.component.file.GenericFileEndpoint<T>
      • getMaximumReconnectAttempts

        public int getMaximumReconnectAttempts()
      • setMaximumReconnectAttempts

        public void setMaximumReconnectAttempts​(int maximumReconnectAttempts)
        Specifies the maximum reconnect attempts Camel performs when it tries to connect to the remote FTP server. Use 0 to disable this behavior.
      • getReconnectDelay

        public long getReconnectDelay()
      • setReconnectDelay

        public void setReconnectDelay​(long reconnectDelay)
        Delay in millis Camel will wait before performing a reconnect attempt.
      • isDisconnect

        public boolean isDisconnect()
      • setDisconnect

        public void setDisconnect​(boolean disconnect)
        Whether or not to disconnect from remote FTP server right after use. Disconnect will only disconnect the current connection to the FTP server. If you have a consumer which you want to stop, then you need to stop the consumer/route instead.
      • isDisconnectOnBatchComplete

        public boolean isDisconnectOnBatchComplete()
      • setDisconnectOnBatchComplete

        public void setDisconnectOnBatchComplete​(boolean disconnectOnBatchComplete)
        Whether or not to disconnect from remote FTP server right after a Batch upload is complete. disconnectOnBatchComplete will only disconnect the current connection to the FTP server.
      • isFastExistsCheck

        public boolean isFastExistsCheck()
      • setFastExistsCheck

        public void setFastExistsCheck​(boolean fastExistsCheck)
        If set this option to be true, camel-ftp will use the list file directly to check if the file exists. Since some FTP server may not support to list the file directly, if the option is false, camel-ftp will use the old way to list the directory and check if the file exists. This option also influences readLock=changed to control whether it performs a fast check to update file information or not. This can be used to speed up the process if the FTP server has a lot of files.
      • isDownload

        public boolean isDownload()
      • setDownload

        public void setDownload​(boolean download)
        Whether the FTP consumer should download the file. If this option is set to false, then the message body will be null, but the consumer will still trigger a Camel Exchange that has details about the file such as file name, file size, etc. It's just that the file will not be downloaded.