INT-1562 naming consistencies, package-protected classes

This commit is contained in:
Mark Fisher
2010-11-12 08:50:32 -05:00
parent ce2bc45eaa
commit 97b5c42411
3 changed files with 25 additions and 24 deletions

View File

@@ -42,7 +42,7 @@ import com.jcraft.jsch.ChannelSftp;
*
* @author Josh Long
*/
public class SftpRemoteFileSystemSynchronizingMessageSourceFactoryBean
class SftpInboundRemoteFileSystemSynchronizingMessageSourceFactoryBean
extends AbstractFactoryBean<SftpInboundRemoteFileSystemSynchronizingMessageSource> implements ResourceLoaderAware {
private volatile ResourceLoader resourceLoader;
@@ -148,7 +148,7 @@ public class SftpRemoteFileSystemSynchronizingMessageSourceFactoryBean
*/
@Override
public Class<?> getObjectType() {
return SftpRemoteFileSystemSynchronizingMessageSourceFactoryBean.class;
return SftpInboundRemoteFileSystemSynchronizingMessageSourceFactoryBean.class;
}
/**

View File

@@ -39,19 +39,36 @@ import org.springframework.util.StringUtils;
public class SftpNamespaceHandler extends AbstractIntegrationNamespaceHandler {
public void init() {
registerBeanDefinitionParser("inbound-channel-adapter", new SFTPMessageSourceBeanDefinitionParser());
registerBeanDefinitionParser("outbound-channel-adapter", new SFTPMessageSendingConsumerBeanDefinitionParser());
registerBeanDefinitionParser("inbound-channel-adapter", new SftpInboundChannelAdapterParser());
registerBeanDefinitionParser("outbound-channel-adapter", new SftpOutboundChannelAdapterParser());
}
/**
* Configures an object that can take inbound messages and send them.
* Configures an object that can receive files from a remote SFTP endpoint and broadcast their arrival to a channel.
*/
private static class SFTPMessageSendingConsumerBeanDefinitionParser extends AbstractOutboundChannelAdapterParser {
private static class SftpInboundChannelAdapterParser extends AbstractPollingInboundChannelAdapterParser {
@Override
protected BeanMetadataElement parseSource(Element element, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(SftpInboundRemoteFileSystemSynchronizingMessageSourceFactoryBean.class.getName());
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "filter");
for (String p : "filename-pattern,auto-create-directories,username,password,host,key-file,key-file-password,remote-directory,local-directory-path,auto-delete-remote-files-on-sync".split(",")) {
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, p);
}
return builder.getBeanDefinition();
}
}
/**
* Configures an object that can take messages and send them via SFTP.
*/
private static class SftpOutboundChannelAdapterParser extends AbstractOutboundChannelAdapterParser {
@Override
protected AbstractBeanDefinition parseConsumer(Element element, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(SftpMessageSendingConsumerFactoryBean.class.getName());
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(SftpSendingMessageHandlerFactoryBean.class.getName());
for (String p : "auto-create-directories,username,password,host,port,key-file,key-file-password,charset".split(",")) {
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, p);
}
@@ -77,20 +94,4 @@ public class SftpNamespaceHandler extends AbstractIntegrationNamespaceHandler {
}
}
/**
* Configures an object that can receive files from a remote SFTP endpoint and broadcast their arrival to the consumer.
*/
private static class SFTPMessageSourceBeanDefinitionParser extends AbstractPollingInboundChannelAdapterParser {
@Override
protected BeanMetadataElement parseSource(Element element, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(SftpRemoteFileSystemSynchronizingMessageSourceFactoryBean.class.getName());
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "filter");
for (String p : "filename-pattern,auto-create-directories,username,password,host,key-file,key-file-password,remote-directory,local-directory-path,auto-delete-remote-files-on-sync".split(",")) {
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, p);
}
return builder.getBeanDefinition();
}
}
}

View File

@@ -30,7 +30,7 @@ import org.springframework.integration.sftp.session.SftpSessionUtils;
*
* @author Josh Long
*/
public class SftpMessageSendingConsumerFactoryBean implements FactoryBean<SftpSendingMessageHandler> {
class SftpSendingMessageHandlerFactoryBean implements FactoryBean<SftpSendingMessageHandler> {
private String host;