org.mule.modules.ftpclient.generated.config.PollWithArchivingByRenamingDefinitionParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ftp-client-connector Show documentation
Show all versions of ftp-client-connector Show documentation
A Mule connector for ftp/sftp.
package org.mule.modules.ftpclient.generated.config;
import javax.annotation.Generated;
import org.mule.config.MuleManifest;
import org.mule.modules.ftpclient.generated.sources.PollWithArchivingByRenamingMessageSource;
import org.mule.security.oauth.config.AbstractDevkitBasedDefinitionParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
import org.springframework.beans.factory.parsing.Location;
import org.springframework.beans.factory.parsing.Problem;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
@SuppressWarnings("all")
@Generated(value = "Mule DevKit Version 3.9.0", date = "2018-04-30T04:51:01+02:00", comments = "Build UNNAMED.2793.f49b6c7")
public class PollWithArchivingByRenamingDefinitionParser
extends AbstractDevkitBasedDefinitionParser
{
private static Logger logger = LoggerFactory.getLogger(PollWithArchivingByRenamingDefinitionParser.class);
private BeanDefinitionBuilder getBeanDefinitionBuilder(ParserContext parserContext) {
try {
return BeanDefinitionBuilder.rootBeanDefinition(PollWithArchivingByRenamingMessageSource.class.getName());
} catch (NoClassDefFoundError noClassDefFoundError) {
String muleVersion = "";
try {
muleVersion = MuleManifest.getProductVersion();
} catch (Exception _x) {
logger.error("Problem while reading mule version");
}
logger.error(("Cannot launch the mule app, the @Source [poll-with-archiving-by-renaming] within the connector [ftp-client] is not supported in mule "+ muleVersion));
throw new BeanDefinitionParsingException(new Problem(("Cannot launch the mule app, the @Source [poll-with-archiving-by-renaming] within the connector [ftp-client] is not supported in mule "+ muleVersion), new Location(parserContext.getReaderContext().getResource()), null, noClassDefFoundError));
}
}
public BeanDefinition parse(Element element, ParserContext parserContext) {
BeanDefinitionBuilder builder = getBeanDefinitionBuilder(parserContext);
builder.addConstructorArgValue("pollWithArchivingByRenaming");
builder.setScope(BeanDefinition.SCOPE_PROTOTYPE);
if (!hasAttribute(element, "config-ref")) {
throw new BeanDefinitionParsingException(new Problem("It seems that the config-ref for @Processor [poll-with-archiving-by-renaming] within the connector [ftp-client] is null or missing. Please, fill the value with the correct global element.", new Location(parserContext.getReaderContext().getResource()), null));
}
parseConfigRef(element, builder);
parseProperty(builder, element, "directory", "directory");
parseProperty(builder, element, "filename", "filename");
parseProperty(builder, element, "translatedNameExpression", "translatedNameExpression");
parseProperty(builder, element, "filenameExpression", "filenameExpression");
parseProperty(builder, element, "originalFilenameExpression", "originalFilenameExpression");
parseProperty(builder, element, "streaming", "streaming");
parseProperty(builder, element, "pollingPeriod", "pollingPeriod");
BeanDefinition definition = builder.getBeanDefinition();
setNoRecurseOnDefinition(definition);
attachSourceDefinition(parserContext, definition);
return definition;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy