Class SftpOutboundGateway
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<org.apache.sshd.sftp.client.SftpClient.DirEntry>
org.springframework.integration.sftp.outbound.SftpOutboundGateway
- All Implemented Interfaces:
- org.reactivestreams.Subscriber<Message<?>>,- Aware,- BeanClassLoaderAware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Ordered,- ComponentSourceAware,- ExpressionCapable,- Orderable,- MessageProducer,- HeaderPropagationAware,- IntegrationPattern,- NamedComponent,- IntegrationManagement,- TrackableComponent,- MessageHandler,- reactor.core.CoreSubscriber<Message<?>>
- Direct Known Subclasses:
- SftpOutboundGateway
public class SftpOutboundGateway
extends AbstractRemoteFileOutboundGateway<org.apache.sshd.sftp.client.SftpClient.DirEntry>
Outbound Gateway for performing remote file operations via SFTP.
- Since:
- 2.1
- Author:
- Gary Russell, Artem Bilan
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGatewayAbstractRemoteFileOutboundGateway.Command, AbstractRemoteFileOutboundGateway.OptionNested classes/interfaces inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandlerAbstractReplyProducingMessageHandler.RequestHandlerNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.handler.AbstractMessageProducingHandlermessagingTemplateFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionSftpOutboundGateway(RemoteFileTemplate<org.apache.sshd.sftp.client.SftpClient.DirEntry> remoteFileTemplate, String command, @Nullable String expression) Construct an instance with the supplied remote file template, a command ('ls', 'get' etc.), and an expression to determine the remote path.SftpOutboundGateway(RemoteFileTemplate<org.apache.sshd.sftp.client.SftpClient.DirEntry> remoteFileTemplate, MessageSessionCallback<org.apache.sshd.sftp.client.SftpClient.DirEntry, ?> messageSessionCallback) Construct an instance with the supplied remote file template and callback for performing operations on the session.SftpOutboundGateway(SessionFactory<org.apache.sshd.sftp.client.SftpClient.DirEntry> sessionFactory, String command, @Nullable String expression) Construct an instance with the supplied session factory, a command ('ls', 'get' etc.), and an expression to determine the remote path.SftpOutboundGateway(SessionFactory<org.apache.sshd.sftp.client.SftpClient.DirEntry> sessionFactory, MessageSessionCallback<org.apache.sshd.sftp.client.SftpClient.DirEntry, ?> messageSessionCallback) Construct an instance using the provided session factory and callback for performing operations on the session.
- 
Method SummaryModifier and TypeMethodDescriptionprotected List<AbstractFileInfo<org.apache.sshd.sftp.client.SftpClient.DirEntry>> asFileInfoList(Collection<org.apache.sshd.sftp.client.SftpClient.DirEntry> files) protected voiddoChmod(RemoteFileOperations<org.apache.sshd.sftp.client.SftpClient.DirEntry> remoteFileOperations, String path, int chmod) Set the mode on the remote file after transfer; the default implementation does nothing.protected org.apache.sshd.sftp.client.SftpClient.DirEntryenhanceNameWithSubDirectory(org.apache.sshd.sftp.client.SftpClient.DirEntry file, String directory) protected StringgetFilename(org.apache.sshd.sftp.client.SftpClient.DirEntry file) protected StringgetFilename(AbstractFileInfo<org.apache.sshd.sftp.client.SftpClient.DirEntry> file) protected longgetModified(org.apache.sshd.sftp.client.SftpClient.DirEntry file) booleanprotected booleanisDirectory(org.apache.sshd.sftp.client.SftpClient.DirEntry file) protected booleanisLink(org.apache.sshd.sftp.client.SftpClient.DirEntry file) Methods inherited from class org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGatewayassertRemoteFileTemplateMutability, doInit, filterFile, filterFiles, filterMputFiles, get, getFullFileName, getRemoteFilename, getRemoteFileTemplate, handleRequestMessage, ls, mGet, mPut, mv, nlst, purgeDots, purgeLinks, put, remoteFileTemplateExplicitlySet, rm, setAutoCreateDirectory, setAutoCreateLocalDirectory, setCharset, setChmod, setChmodOctal, setFileExistsMode, setFileExistsModeExpression, setFileExistsModeExpressionString, setFileNameExpression, setFileNameGenerator, setFilter, setLocalDirectory, setLocalDirectoryExpression, setLocalDirectoryExpressionString, setLocalFilenameGeneratorExpression, setLocalFilenameGeneratorExpressionString, setMputFilter, setOption, setOptions, setRemoteDirectoryExpression, setRemoteFileSeparator, setRenameExpression, setRenameExpressionString, setTemporaryFileSuffix, setTemporaryRemoteDirectoryExpression, setUseTemporaryFileNameMethods inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandlerdoInvokeAdvisedRequestHandler, getBeanClassLoader, getIntegrationPatternType, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyMethods inherited from class org.springframework.integration.handler.AbstractMessageProducingHandleraddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, setupMessageProcessor, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersMethods inherited from class org.springframework.integration.handler.AbstractMessageHandlerhandleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionMethods inherited from class org.springframework.integration.handler.MessageHandlerSupportbuildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.core.CoreSubscribercurrentContextMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
SftpOutboundGatewaypublic SftpOutboundGateway(SessionFactory<org.apache.sshd.sftp.client.SftpClient.DirEntry> sessionFactory, MessageSessionCallback<org.apache.sshd.sftp.client.SftpClient.DirEntry, ?> messageSessionCallback) Construct an instance using the provided session factory and callback for performing operations on the session.- Parameters:
- sessionFactory- the session factory.
- messageSessionCallback- the callback.
 
- 
SftpOutboundGatewaypublic SftpOutboundGateway(RemoteFileTemplate<org.apache.sshd.sftp.client.SftpClient.DirEntry> remoteFileTemplate, MessageSessionCallback<org.apache.sshd.sftp.client.SftpClient.DirEntry, ?> messageSessionCallback) Construct an instance with the supplied remote file template and callback for performing operations on the session.- Parameters:
- remoteFileTemplate- the remote file template.
- messageSessionCallback- the callback.
 
- 
SftpOutboundGatewaypublic SftpOutboundGateway(SessionFactory<org.apache.sshd.sftp.client.SftpClient.DirEntry> sessionFactory, String command, @Nullable String expression) Construct an instance with the supplied session factory, a command ('ls', 'get' etc.), and an expression to determine the remote path.- Parameters:
- sessionFactory- the session factory.
- command- the command.
- expression- the remote path expression.
 
- 
SftpOutboundGatewaypublic SftpOutboundGateway(RemoteFileTemplate<org.apache.sshd.sftp.client.SftpClient.DirEntry> remoteFileTemplate, String command, @Nullable String expression) Construct an instance with the supplied remote file template, a command ('ls', 'get' etc.), and an expression to determine the remote path.- Parameters:
- remoteFileTemplate- the remote file template.
- command- the command.
- expression- the remote path expression.
 
 
- 
- 
Method Details- 
isDirectoryprotected boolean isDirectory(org.apache.sshd.sftp.client.SftpClient.DirEntry file) - Specified by:
- isDirectoryin class- AbstractRemoteFileOutboundGateway<org.apache.sshd.sftp.client.SftpClient.DirEntry>
 
- 
isLinkprotected boolean isLink(org.apache.sshd.sftp.client.SftpClient.DirEntry file) - Specified by:
- isLinkin class- AbstractRemoteFileOutboundGateway<org.apache.sshd.sftp.client.SftpClient.DirEntry>
 
- 
getFilename- Specified by:
- getFilenamein class- AbstractRemoteFileOutboundGateway<org.apache.sshd.sftp.client.SftpClient.DirEntry>
 
- 
getFilenameprotected String getFilename(AbstractFileInfo<org.apache.sshd.sftp.client.SftpClient.DirEntry> file) - Specified by:
- getFilenamein class- AbstractRemoteFileOutboundGateway<org.apache.sshd.sftp.client.SftpClient.DirEntry>
 
- 
asFileInfoListprotected List<AbstractFileInfo<org.apache.sshd.sftp.client.SftpClient.DirEntry>> asFileInfoList(Collection<org.apache.sshd.sftp.client.SftpClient.DirEntry> files) - Specified by:
- asFileInfoListin class- AbstractRemoteFileOutboundGateway<org.apache.sshd.sftp.client.SftpClient.DirEntry>
 
- 
getModifiedprotected long getModified(org.apache.sshd.sftp.client.SftpClient.DirEntry file) - Specified by:
- getModifiedin class- AbstractRemoteFileOutboundGateway<org.apache.sshd.sftp.client.SftpClient.DirEntry>
 
- 
enhanceNameWithSubDirectoryprotected org.apache.sshd.sftp.client.SftpClient.DirEntry enhanceNameWithSubDirectory(org.apache.sshd.sftp.client.SftpClient.DirEntry file, String directory) - Specified by:
- enhanceNameWithSubDirectoryin class- AbstractRemoteFileOutboundGateway<org.apache.sshd.sftp.client.SftpClient.DirEntry>
 
- 
getComponentType- Specified by:
- getComponentTypein interface- NamedComponent
- Overrides:
- getComponentTypein class- MessageHandlerSupport
 
- 
isChmodCapablepublic boolean isChmodCapable()- Overrides:
- isChmodCapablein class- AbstractRemoteFileOutboundGateway<org.apache.sshd.sftp.client.SftpClient.DirEntry>
 
- 
doChmodprotected void doChmod(RemoteFileOperations<org.apache.sshd.sftp.client.SftpClient.DirEntry> remoteFileOperations, String path, int chmod) Description copied from class:AbstractRemoteFileOutboundGatewaySet the mode on the remote file after transfer; the default implementation does nothing.- Overrides:
- doChmodin class- AbstractRemoteFileOutboundGateway<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Parameters:
- remoteFileOperations- the remote file template.
- path- the path.
- chmod- the chmod to set.
 
 
-