Merge branch 'master' of git.springsource.org:spring-integration/spring-integration

This commit is contained in:
Oleg Zhurakousky
2010-11-19 12:36:27 -05:00
12 changed files with 35 additions and 35 deletions

View File

@@ -32,8 +32,8 @@ import org.springframework.integration.ftp.client.AbstractFtpClientFactory;
import org.springframework.integration.ftp.client.DefaultFtpClientFactory;
import org.springframework.integration.ftp.client.QueuedFtpClientPool;
import org.springframework.integration.ftp.filters.FtpPatternMatchingFileListFilter;
import org.springframework.integration.ftp.inbound.FtpInboundFileSystemSynchronizer;
import org.springframework.integration.ftp.inbound.FtpInboundFileSystemSynchronizingMessageSource;
import org.springframework.integration.ftp.inbound.FtpInboundFileSynchronizer;
import org.springframework.integration.ftp.inbound.FtpInboundFileSynchronizingMessageSource;
import org.springframework.util.StringUtils;
/**
@@ -45,7 +45,7 @@ import org.springframework.util.StringUtils;
* @since 2.0
*/
class FtpInboundFileSynchronizingMessageSourceFactoryBean
extends AbstractFactoryBean<FtpInboundFileSystemSynchronizingMessageSource> implements ResourceLoaderAware {
extends AbstractFactoryBean<FtpInboundFileSynchronizingMessageSource> implements ResourceLoaderAware {
private volatile String autoCreateDirectories;
@@ -95,7 +95,7 @@ class FtpInboundFileSynchronizingMessageSourceFactoryBean
@Override
public Class<?> getObjectType() {
return FtpInboundFileSystemSynchronizingMessageSource.class;
return FtpInboundFileSynchronizingMessageSource.class;
}
private Resource resolveResource(String path) {
@@ -105,11 +105,11 @@ class FtpInboundFileSynchronizingMessageSourceFactoryBean
}
@Override
protected FtpInboundFileSystemSynchronizingMessageSource createInstance() throws Exception {
protected FtpInboundFileSynchronizingMessageSource createInstance() throws Exception {
boolean autoCreatDirs = Boolean.parseBoolean(this.autoCreateDirectories);
boolean ackRemoteDir = Boolean.parseBoolean(this.autoDeleteRemoteFilesOnSync);
FtpInboundFileSystemSynchronizingMessageSource messageSource =
new FtpInboundFileSystemSynchronizingMessageSource();
FtpInboundFileSynchronizingMessageSource messageSource =
new FtpInboundFileSynchronizingMessageSource();
messageSource.setAutoCreateDirectories(autoCreatDirs);
if (!StringUtils.hasText(this.localWorkingDirectory)) {
File tmp = new File(SystemUtils.getJavaIoTmpDir(), this.defaultFtpInboundFolderName);
@@ -126,7 +126,7 @@ class FtpInboundFileSynchronizingMessageSourceFactoryBean
compositeFilter.addFilter(this.filter);
}
QueuedFtpClientPool queuedFtpClientPool = new QueuedFtpClientPool(15, this.clientFactory);
FtpInboundFileSystemSynchronizer synchronizer = new FtpInboundFileSystemSynchronizer();
FtpInboundFileSynchronizer synchronizer = new FtpInboundFileSynchronizer();
synchronizer.setClientPool(queuedFtpClientPool);
synchronizer.setShouldDeleteSourceFile(ackRemoteDir);
synchronizer.setFilter(compositeFilter);

View File

@@ -40,7 +40,7 @@ import org.springframework.util.Assert;
* @author Iwein Fuld
* @author Josh Long
*/
public class FtpInboundFileSystemSynchronizer extends AbstractInboundFileSynchronizer<FTPFile> {
public class FtpInboundFileSynchronizer extends AbstractInboundFileSynchronizer<FTPFile> {
private volatile FtpClientPool clientPool;

View File

@@ -27,7 +27,7 @@ import org.springframework.integration.file.synchronizer.AbstractInboundFileSync
* @author Iwein Fuld
* @author Josh Long
*/
public class FtpInboundFileSystemSynchronizingMessageSource extends AbstractInboundFileSynchronizingMessageSource<FTPFile> {
public class FtpInboundFileSynchronizingMessageSource extends AbstractInboundFileSynchronizingMessageSource<FTPFile> {
public String getComponentType() {
return "ftp:inbound-channel-adapter";

View File

@@ -34,8 +34,8 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
import org.springframework.integration.file.filters.CompositeFileListFilter;
import org.springframework.integration.ftp.client.DefaultFtpClientFactory;
import org.springframework.integration.ftp.inbound.FtpInboundFileSystemSynchronizer;
import org.springframework.integration.ftp.inbound.FtpInboundFileSystemSynchronizingMessageSource;
import org.springframework.integration.ftp.inbound.FtpInboundFileSynchronizer;
import org.springframework.integration.ftp.inbound.FtpInboundFileSynchronizingMessageSource;
import org.springframework.integration.test.util.TestUtils;
/**
@@ -52,11 +52,11 @@ public class FtpInboundChannelAdapterParserTests {
assertEquals("ftp:inbound-channel-adapter", adapter.getComponentType());
assertNotNull(TestUtils.getPropertyValue(adapter, "poller"));
assertEquals(ac.getBean("ftpChannel"), TestUtils.getPropertyValue(adapter, "outputChannel"));
FtpInboundFileSystemSynchronizingMessageSource inbound =
(FtpInboundFileSystemSynchronizingMessageSource) TestUtils.getPropertyValue(adapter, "source");
FtpInboundFileSynchronizingMessageSource inbound =
(FtpInboundFileSynchronizingMessageSource) TestUtils.getPropertyValue(adapter, "source");
FtpInboundFileSystemSynchronizer fisync =
(FtpInboundFileSystemSynchronizer) TestUtils.getPropertyValue(inbound, "synchronizer");
FtpInboundFileSynchronizer fisync =
(FtpInboundFileSynchronizer) TestUtils.getPropertyValue(inbound, "synchronizer");
CompositeFileListFilter<?> filter = (CompositeFileListFilter<?>) TestUtils.getPropertyValue(fisync, "filter");
Set<?> filters = (Set<?>) TestUtils.getPropertyValue(filter, "fileFilters");
assertEquals(2, filters.size());

View File

@@ -29,8 +29,8 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
import org.springframework.integration.file.filters.CompositeFileListFilter;
import org.springframework.integration.ftp.inbound.FtpInboundFileSystemSynchronizer;
import org.springframework.integration.ftp.inbound.FtpInboundFileSystemSynchronizingMessageSource;
import org.springframework.integration.ftp.inbound.FtpInboundFileSynchronizer;
import org.springframework.integration.ftp.inbound.FtpInboundFileSynchronizingMessageSource;
import org.springframework.integration.test.util.TestUtils;
/**
@@ -48,11 +48,11 @@ public class FtpsInboundChannelAdapterParserTests {
assertEquals("ftp:inbound-channel-adapter", adapter.getComponentType());
assertNotNull(TestUtils.getPropertyValue(adapter, "poller"));
assertEquals(ac.getBean("ftpChannel"), TestUtils.getPropertyValue(adapter, "outputChannel"));
FtpInboundFileSystemSynchronizingMessageSource inbound =
(FtpInboundFileSystemSynchronizingMessageSource) TestUtils.getPropertyValue(adapter, "source");
FtpInboundFileSynchronizingMessageSource inbound =
(FtpInboundFileSynchronizingMessageSource) TestUtils.getPropertyValue(adapter, "source");
FtpInboundFileSystemSynchronizer fisync =
(FtpInboundFileSystemSynchronizer) TestUtils.getPropertyValue(inbound, "synchronizer");
FtpInboundFileSynchronizer fisync =
(FtpInboundFileSynchronizer) TestUtils.getPropertyValue(inbound, "synchronizer");
CompositeFileListFilter<?> filter = (CompositeFileListFilter<?>) TestUtils.getPropertyValue(fisync, "filter");
Set<?> filters = (Set<?>) TestUtils.getPropertyValue(filter, "fileFilters");
assertEquals(2, filters.size());

View File

@@ -49,7 +49,7 @@ public class FtpInboundRemoteFileSystemSynchronizerTest {
if (file.exists()){
file.delete();
}
FtpInboundFileSystemSynchronizer syncronizer = new FtpInboundFileSystemSynchronizer();
FtpInboundFileSynchronizer syncronizer = new FtpInboundFileSynchronizer();
FileListFilter filter = new FtpPatternMatchingFileListFilter("foo.txt");
syncronizer.setFilter(filter);

View File

@@ -54,13 +54,13 @@ public class SftpInboundChannelAdapterParser extends AbstractPollingInboundChann
String sessionPollName = BeanDefinitionReaderUtils.registerWithGeneratedName(
sessionFactoryBuilder.getBeanDefinition(), parserContext.getRegistry());
BeanDefinitionBuilder synchronizerBuilder = BeanDefinitionBuilder.genericBeanDefinition(
"org.springframework.integration.sftp.inbound.SftpInboundSynchronizer");
"org.springframework.integration.sftp.inbound.SftpInboundFileSynchronizer");
synchronizerBuilder.addConstructorArgReference(sessionPollName);
IntegrationNamespaceUtils.setValueIfAttributeDefined(synchronizerBuilder, element, "remote-directory", "remotePath");
IntegrationNamespaceUtils.setValueIfAttributeDefined(synchronizerBuilder, element, "auto-delete-remote-files-on-sync", "shouldDeleteSourceFile");
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(synchronizerBuilder, element, "filter");
BeanDefinitionBuilder messageSourceBuilder = BeanDefinitionBuilder.rootBeanDefinition(
"org.springframework.integration.sftp.inbound.SftpInboundSynchronizingMessageSource");
"org.springframework.integration.sftp.inbound.SftpInboundFileSynchronizingMessageSource");
messageSourceBuilder.addPropertyValue("synchronizer", synchronizerBuilder.getBeanDefinition());
if (hasFileNamePattern) {
if (parserContext.getRegistry().containsBeanDefinition(fileNamePattern)) {

View File

@@ -40,7 +40,7 @@ import com.jcraft.jsch.ChannelSftp;
* @author Oleg Zhurakousky
* @since 2.0
*/
public class SftpInboundSynchronizer extends AbstractInboundFileSynchronizer<ChannelSftp.LsEntry> {
public class SftpInboundFileSynchronizer extends AbstractInboundFileSynchronizer<ChannelSftp.LsEntry> {
/**
* the path on the remote mount
@@ -53,7 +53,7 @@ public class SftpInboundSynchronizer extends AbstractInboundFileSynchronizer<Cha
private final SftpSessionFactory sessionFactory;
public SftpInboundSynchronizer(SftpSessionFactory sessionFactory) {
public SftpInboundFileSynchronizer(SftpSessionFactory sessionFactory) {
Assert.notNull(sessionFactory, "sessionFactory must not be null");
this.sessionFactory = sessionFactory;
}

View File

@@ -33,7 +33,7 @@ import com.jcraft.jsch.ChannelSftp;
* @author Oleg Zhurakousky
* @since 2.0
*/
public class SftpInboundSynchronizingMessageSource extends AbstractInboundFileSynchronizingMessageSource<ChannelSftp.LsEntry> {
public class SftpInboundFileSynchronizingMessageSource extends AbstractInboundFileSynchronizingMessageSource<ChannelSftp.LsEntry> {
private volatile Pattern filenamePattern;

View File

@@ -32,7 +32,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.core.PollableChannel;
import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
import org.springframework.integration.sftp.inbound.SftpInboundSynchronizingMessageSource;
import org.springframework.integration.sftp.inbound.SftpInboundFileSynchronizingMessageSource;
import org.springframework.integration.test.util.TestUtils;
/**
@@ -53,8 +53,8 @@ public class InboundChannelAdapaterParserTests {
Object adapter = context.getBean("sftpAdapterAutoCreate");
assertTrue(adapter instanceof SourcePollingChannelAdapter);
SftpInboundSynchronizingMessageSource source =
(SftpInboundSynchronizingMessageSource) TestUtils.getPropertyValue(adapter, "source");
SftpInboundFileSynchronizingMessageSource source =
(SftpInboundFileSynchronizingMessageSource) TestUtils.getPropertyValue(adapter, "source");
assertNotNull(source);
PollableChannel requestChannel = context.getBean("requestChannel", PollableChannel.class);
assertNotNull(requestChannel.receive(2000));

View File

@@ -28,7 +28,7 @@ import org.junit.Test;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.integration.file.synchronizer.AbstractInboundFileSynchronizer.EntryAcknowledgmentStrategy;
import org.springframework.integration.sftp.inbound.SftpInboundSynchronizer;
import org.springframework.integration.sftp.inbound.SftpInboundFileSynchronizer;
import org.springframework.integration.sftp.session.SftpSession;
import org.springframework.integration.sftp.session.SftpSessionFactory;
import org.springframework.util.ReflectionUtils;
@@ -65,7 +65,7 @@ public class SftpInboundRemoteFileSystemSynchronizerTests {
*/
@Test
public void testCopyAndRenameWhenLocalFileExists() throws Exception {
SftpInboundSynchronizer synchronizer = new SftpInboundSynchronizer(mock(SftpSessionFactory.class));
SftpInboundFileSynchronizer synchronizer = new SftpInboundFileSynchronizer(mock(SftpSessionFactory.class));
Method method =
ReflectionUtils.findMethod(synchronizer.getClass(), "copyFromRemoteToLocalDirectory", SftpSession.class, LsEntry.class, Resource.class);
method.setAccessible(true);
@@ -87,7 +87,7 @@ public class SftpInboundRemoteFileSystemSynchronizerTests {
@org.junit.Ignore
@Test
public void testCopyAndRenameWhenLocalFileDoesntExist() throws Exception {
SftpInboundSynchronizer synchronizer = new SftpInboundSynchronizer(mock(SftpSessionFactory.class));
SftpInboundFileSynchronizer synchronizer = new SftpInboundFileSynchronizer(mock(SftpSessionFactory.class));
synchronizer.setEntryAcknowledgmentStrategy(mock(EntryAcknowledgmentStrategy.class));
Method method =
ReflectionUtils.findMethod(synchronizer.getClass(), "copyFromRemoteToLocalDirectory", SftpSession.class, LsEntry.class, Resource.class);

View File

@@ -58,7 +58,7 @@ public class SftpInboundRemoteFileSystemSynchronizerTests {
file.delete();
}
SftpSessionFactory sessionFactory = mock(SftpSessionFactory.class);
SftpInboundSynchronizer syncronizer = new SftpInboundSynchronizer(sessionFactory);
SftpInboundFileSynchronizer syncronizer = new SftpInboundFileSynchronizer(sessionFactory);
syncronizer.setRemotePath("foo/bar");
FileListFilter filter = mock(FileListFilter.class);