diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java index 4fae5f6479..f0298e03ad 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java @@ -53,17 +53,17 @@ public abstract class AbstractInboundFileSynchronizer implements InboundFileS private volatile FileListFilter filter; /** - * The {@link EntryAcknowledgmentStrategy} implementation. + * The {@link AcknowledgmentStrategy} implementation. */ - private EntryAcknowledgmentStrategy entryAcknowledgmentStrategy; + private AcknowledgmentStrategy acknowledgmentStrategy; public void setFilter(FileListFilter filter) { this.filter = filter; } - public void setEntryAcknowledgmentStrategy(EntryAcknowledgmentStrategy entryAcknowledgmentStrategy) { - this.entryAcknowledgmentStrategy = entryAcknowledgmentStrategy; + public void setAcknowledgmentStrategy(AcknowledgmentStrategy acknowledgmentStrategy) { + this.acknowledgmentStrategy = acknowledgmentStrategy; } public void setShouldDeleteSourceFile(boolean shouldDeleteSourceFile) { @@ -85,8 +85,8 @@ public abstract class AbstractInboundFileSynchronizer implements InboundFileS * escape hatch exception, let the adapter deal with it. */ protected final void acknowledge(Session session, F file) throws Exception { - if (this.entryAcknowledgmentStrategy != null) { - this.entryAcknowledgmentStrategy.acknowledge(session, file); + if (this.acknowledgmentStrategy != null) { + this.acknowledgmentStrategy.acknowledge(session, file); } } @@ -104,7 +104,7 @@ public abstract class AbstractInboundFileSynchronizer implements InboundFileS * * @param the file entry type (file, sftp, ftp, ...) */ - public static interface EntryAcknowledgmentStrategy { + public static interface AcknowledgmentStrategy { /** * Semantics are simple. You get a pointer to the file just processed diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/inbound/FtpInboundFileSynchronizer.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/inbound/FtpInboundFileSynchronizer.java index a9ded70385..e671718eb7 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/inbound/FtpInboundFileSynchronizer.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/inbound/FtpInboundFileSynchronizer.java @@ -65,7 +65,7 @@ public class FtpInboundFileSynchronizer extends AbstractInboundFileSynchronizer< public void afterPropertiesSet() { Assert.notNull(this.sessionFactory, "sessionFactory must not be null"); if (this.shouldDeleteSourceFile) { - this.setEntryAcknowledgmentStrategy(new DeletionEntryAcknowledgmentStrategy()); + this.setAcknowledgmentStrategy(new DeletionAcknowledgmentStrategy()); } } @@ -137,7 +137,7 @@ public class FtpInboundFileSynchronizer extends AbstractInboundFileSynchronizer< /** * An acknowledgment strategy that deletes the file. */ - private static class DeletionEntryAcknowledgmentStrategy implements EntryAcknowledgmentStrategy { + private static class DeletionAcknowledgmentStrategy implements AcknowledgmentStrategy { private final Log logger = LogFactory.getLog(this.getClass()); diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/inbound/SftpInboundFileSynchronizer.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/inbound/SftpInboundFileSynchronizer.java index 11c6be963e..3620f3ecde 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/inbound/SftpInboundFileSynchronizer.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/inbound/SftpInboundFileSynchronizer.java @@ -64,7 +64,7 @@ public class SftpInboundFileSynchronizer extends AbstractInboundFileSynchronizer public void afterPropertiesSet() throws Exception { Assert.notNull(this.remotePath, "'remotePath' must not be null"); if (this.shouldDeleteSourceFile) { - this.setEntryAcknowledgmentStrategy(new DeletionEntryAcknowledgmentStrategy()); + this.setAcknowledgmentStrategy(new DeletionAcknowledgmentStrategy()); } } @@ -141,7 +141,7 @@ public class SftpInboundFileSynchronizer extends AbstractInboundFileSynchronizer } - private class DeletionEntryAcknowledgmentStrategy implements AbstractInboundFileSynchronizer.EntryAcknowledgmentStrategy { + private class DeletionAcknowledgmentStrategy implements AcknowledgmentStrategy { public void acknowledge(Session session, ChannelSftp.LsEntry msg) throws Exception { String remoteFqPath = remotePath + "/" + msg.getFilename(); diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/impl/SftpInboundRemoteFileSystemSynchronizerTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/impl/SftpInboundRemoteFileSystemSynchronizerTests.java index 2065332abd..d9fce38e98 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/impl/SftpInboundRemoteFileSystemSynchronizerTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/impl/SftpInboundRemoteFileSystemSynchronizerTests.java @@ -29,7 +29,7 @@ import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; import org.springframework.integration.file.remote.session.Session; import org.springframework.integration.file.remote.session.SessionFactory; -import org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.EntryAcknowledgmentStrategy; +import org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.AcknowledgmentStrategy; import org.springframework.integration.sftp.inbound.SftpInboundFileSynchronizer; import org.springframework.util.ReflectionUtils; @@ -88,7 +88,7 @@ public class SftpInboundRemoteFileSystemSynchronizerTests { @Test public void testCopyAndRenameWhenLocalFileDoesntExist() throws Exception { SftpInboundFileSynchronizer synchronizer = new SftpInboundFileSynchronizer(mock(SessionFactory.class)); - synchronizer.setEntryAcknowledgmentStrategy(mock(EntryAcknowledgmentStrategy.class)); + synchronizer.setAcknowledgmentStrategy(mock(AcknowledgmentStrategy.class)); Method method = ReflectionUtils.findMethod(synchronizer.getClass(), "copyFromRemoteToLocalDirectory", Session.class, LsEntry.class, Resource.class); method.setAccessible(true);