INT-1614 cleaned up the code and schema form removed parts
This commit is contained in:
@@ -40,6 +40,8 @@ import com.jcraft.jsch.ChannelSftp;
|
||||
* Factory bean to hide the fairly complex configuration possibilities for an SFTP endpoint
|
||||
*
|
||||
* @author Josh Long
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 2.0
|
||||
*/
|
||||
class SftpInboundRemoteFileSystemSynchronizingMessageSourceFactoryBean
|
||||
extends AbstractFactoryBean<SftpInboundRemoteFileSystemSynchronizingMessageSource> implements ResourceLoaderAware {
|
||||
@@ -60,26 +62,12 @@ class SftpInboundRemoteFileSystemSynchronizingMessageSourceFactoryBean
|
||||
|
||||
private volatile SftpSessionFactory sftpSessionFactory;
|
||||
|
||||
|
||||
|
||||
public void setSftpSessionFactory(SftpSessionFactory sftpSessionFactory) {
|
||||
this.sftpSessionFactory = sftpSessionFactory;
|
||||
}
|
||||
|
||||
// private int port = 22;
|
||||
//
|
||||
// private String host;
|
||||
//
|
||||
// private String keyFile;
|
||||
//
|
||||
// private String keyFilePassword;
|
||||
//
|
||||
private String remoteDirectory;
|
||||
//
|
||||
// private String username;
|
||||
//
|
||||
// private String password;
|
||||
|
||||
|
||||
public void setLocalDirectoryResource(Resource localDirectoryResource) {
|
||||
this.localDirectoryResource = localDirectoryResource;
|
||||
@@ -105,43 +93,12 @@ class SftpInboundRemoteFileSystemSynchronizingMessageSourceFactoryBean
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
// public void setPort(int port) {
|
||||
// this.port = port;
|
||||
// }
|
||||
//
|
||||
// public void setHost(String host) {
|
||||
// this.host = host;
|
||||
// }
|
||||
//
|
||||
// public void setKeyFile(String keyFile) {
|
||||
// this.keyFile = keyFile;
|
||||
// }
|
||||
//
|
||||
// public void setKeyFilePassword(String keyFilePassword) {
|
||||
// this.keyFilePassword = keyFilePassword;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Set the remote directory to synchronize with
|
||||
*/
|
||||
public void setRemoteDirectory(String remoteDirectory) {
|
||||
this.remoteDirectory = remoteDirectory;
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * Set the user name to be used for authentication with the remote server
|
||||
// */
|
||||
// public void setUsername(String username) {
|
||||
// this.username = username;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Set the password to be used for authentication with the remote server
|
||||
// * @param password
|
||||
// */
|
||||
// public void setPassword(String password) {
|
||||
// this.password = password;
|
||||
// }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
@@ -190,9 +147,6 @@ class SftpInboundRemoteFileSystemSynchronizingMessageSourceFactoryBean
|
||||
this.filter = compositeFtpFileListFilter;
|
||||
|
||||
// pools
|
||||
|
||||
//SftpSession session = new Sf
|
||||
//SftpSessionFactory sessionFactory = SftpSessionUtils.buildSftpSessionFactory(this.host, this.password, this.username, this.keyFile, this.keyFilePassword, this.port);
|
||||
QueuedSftpSessionPool pool = new QueuedSftpSessionPool(15, sftpSessionFactory);
|
||||
pool.afterPropertiesSet();
|
||||
|
||||
|
||||
@@ -28,23 +28,13 @@ import org.springframework.integration.sftp.session.SftpSessionFactory;
|
||||
* and send them to a remote destination.
|
||||
*
|
||||
* @author Josh Long
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 2.0
|
||||
*/
|
||||
class SftpSendingMessageHandlerFactoryBean implements FactoryBean<SftpSendingMessageHandler> {
|
||||
|
||||
// private String host;
|
||||
//
|
||||
// private String keyFile;
|
||||
//
|
||||
// private String keyFilePassword;
|
||||
//
|
||||
// private String password;
|
||||
|
||||
private Expression remoteDirectoryExpression;
|
||||
|
||||
// private String username;
|
||||
//
|
||||
// private int port;
|
||||
|
||||
private volatile SftpSessionFactory sftpSessionFactory;
|
||||
|
||||
public void setSftpSessionFactory(SftpSessionFactory sftpSessionFactory) {
|
||||
@@ -58,30 +48,6 @@ class SftpSendingMessageHandlerFactoryBean implements FactoryBean<SftpSendingMes
|
||||
this.charset = charset;
|
||||
}
|
||||
|
||||
// public void setHost(final String host) {
|
||||
// this.host = host;
|
||||
// }
|
||||
//
|
||||
// public void setKeyFile(final String keyFile) {
|
||||
// this.keyFile = keyFile;
|
||||
// }
|
||||
//
|
||||
// public void setKeyFilePassword(final String keyFilePassword) {
|
||||
// this.keyFilePassword = keyFilePassword;
|
||||
// }
|
||||
//
|
||||
// public void setUsername(final String username) {
|
||||
// this.username = username;
|
||||
// }
|
||||
//
|
||||
// public void setPassword(final String password) {
|
||||
// this.password = password;
|
||||
// }
|
||||
|
||||
// public void setPort(final int port) {
|
||||
// this.port = port;
|
||||
// }
|
||||
|
||||
public void setRemoteDirectory(String remoteDirectory) {
|
||||
remoteDirectory = (remoteDirectory != null) ? remoteDirectory : "";
|
||||
this.remoteDirectoryExpression = new LiteralExpression(remoteDirectory);
|
||||
@@ -92,8 +58,6 @@ class SftpSendingMessageHandlerFactoryBean implements FactoryBean<SftpSendingMes
|
||||
}
|
||||
|
||||
public SftpSendingMessageHandler getObject() throws Exception {
|
||||
// SftpSessionFactoryBean sessionFactory = SftpSessionUtils.buildSftpSessionFactory(
|
||||
// this.host, this.password, this.username, this.keyFile, this.keyFilePassword, this.port);
|
||||
QueuedSftpSessionPool sessionPool = new QueuedSftpSessionPool(15, sftpSessionFactory);
|
||||
sessionPool.afterPropertiesSet();
|
||||
SftpSendingMessageHandler messageHandler = new SftpSendingMessageHandler(sessionPool);
|
||||
|
||||
@@ -39,6 +39,7 @@ import java.util.Collection;
|
||||
* Gandles the synchronization between a remote SFTP endpoint and a local mount.
|
||||
*
|
||||
* @author Josh Long
|
||||
* @since 2.0
|
||||
*/
|
||||
public class SftpInboundRemoteFileSystemSynchronizer extends AbstractInboundRemoteFileSystemSychronizer<ChannelSftp.LsEntry> {
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ import org.springframework.util.Assert;
|
||||
* a {@link org.springframework.integration.core.MessageSource} implementation for SFTP
|
||||
*
|
||||
* @author Josh Long
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 2.0
|
||||
*/
|
||||
public class SftpInboundRemoteFileSystemSynchronizingMessageSource extends AbstractInboundRemoteFileSystemSynchronizingMessageSource<ChannelSftp.LsEntry, SftpInboundRemoteFileSystemSynchronizer> {
|
||||
/**
|
||||
|
||||
@@ -32,14 +32,8 @@
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<!-- <xsd:attribute name="username" type="xsd:string" use="required"/>-->
|
||||
<xsd:attribute name="remote-directory" type="xsd:string"/>
|
||||
<xsd:attribute name="remote-directory-expression" type="xsd:string"/>
|
||||
<!-- <xsd:attribute name="host" type="xsd:string" use="required"/>-->
|
||||
<!-- <xsd:attribute name="password" type="xsd:string"/>-->
|
||||
<!-- <xsd:attribute name="port" type="xsd:int" default="22"/>-->
|
||||
<!-- <xsd:attribute name="key-file" type="xsd:string"/>-->
|
||||
<!-- <xsd:attribute name="key-file-password" type="xsd:string"/>-->
|
||||
<xsd:attribute name="charset" type="xsd:string"/>
|
||||
<xsd:attribute name="auto-create-directories" type="xsd:boolean"/>
|
||||
</xsd:complexType>
|
||||
@@ -83,14 +77,8 @@
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="filename-pattern" type="xsd:string"/>
|
||||
<!-- <xsd:attribute name="username" type="xsd:string" use="required"/>-->
|
||||
<xsd:attribute name="remote-directory" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="local-directory-path" type="xsd:string"/>
|
||||
<!-- <xsd:attribute name="host" type="xsd:string" use="required"/>-->
|
||||
<!-- <xsd:attribute name="password" type="xsd:string"/>-->
|
||||
<!-- <xsd:attribute name="port" type="xsd:int" default="22"/>-->
|
||||
<!-- <xsd:attribute name="key-file" type="xsd:string"/>-->
|
||||
<!-- <xsd:attribute name="key-file-password" type="xsd:string"/>-->
|
||||
<xsd:attribute name="auto-create-directories" type="xsd:boolean"/>
|
||||
<xsd:attribute name="auto-delete-remote-files-on-sync" type="xsd:boolean"/>
|
||||
</xsd:complexType>
|
||||
|
||||
Reference in New Issue
Block a user