Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ milo-client
milo-server
milvus
mina
mina-sftp
minio
mllp
mock
Expand Down
56 changes: 56 additions & 0 deletions components-starter/camel-mina-sftp-starter/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>components-starter</artifactId>
<version>4.18.0-SNAPSHOT</version>
</parent>
<artifactId>camel-mina-sftp-starter</artifactId>
<packaging>jar</packaging>
<name>Camel SB Starters :: mina-sftp</name>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-mina-sftp</artifactId>
<version>${camel-version}</version>
</dependency>
<!-- for testing sftp -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-infra-ftp</artifactId>
<version>${camel-version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!--START OF GENERATED CODE-->
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-core-starter</artifactId>
</dependency>
<!--END OF GENERATED CODE-->
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"groups": [
{
"name": "camel.component.mina-sftp",
"type": "org.apache.camel.component.file.remote.mina.springboot.MinaSftpComponentConfiguration",
"sourceType": "org.apache.camel.component.file.remote.mina.springboot.MinaSftpComponentConfiguration"
},
{
"name": "camel.component.mina-sftp.customizer",
"type": "org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon$CustomizerProperties",
"sourceType": "org.apache.camel.component.file.remote.mina.springboot.MinaSftpComponentConfiguration",
"sourceMethod": "getCustomizer()"
}
],
"properties": [
{
"name": "camel.component.mina-sftp.autowired-enabled",
"type": "java.lang.Boolean",
"description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.",
"sourceType": "org.apache.camel.component.file.remote.mina.springboot.MinaSftpComponentConfiguration",
"defaultValue": true
},
{
"name": "camel.component.mina-sftp.bridge-error-handler",
"type": "java.lang.Boolean",
"description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.",
"sourceType": "org.apache.camel.component.file.remote.mina.springboot.MinaSftpComponentConfiguration",
"defaultValue": false
},
{
"name": "camel.component.mina-sftp.customizer.enabled",
"type": "java.lang.Boolean",
"sourceType": "org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon$CustomizerProperties"
},
{
"name": "camel.component.mina-sftp.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable auto configuration of the mina-sftp component. This is enabled by default.",
"sourceType": "org.apache.camel.component.file.remote.mina.springboot.MinaSftpComponentConfiguration"
},
{
"name": "camel.component.mina-sftp.health-check-consumer-enabled",
"type": "java.lang.Boolean",
"description": "Used for enabling or disabling all consumer based health checks from this component",
"sourceType": "org.apache.camel.component.file.remote.mina.springboot.MinaSftpComponentConfiguration",
"defaultValue": true
},
{
"name": "camel.component.mina-sftp.health-check-producer-enabled",
"type": "java.lang.Boolean",
"description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.",
"sourceType": "org.apache.camel.component.file.remote.mina.springboot.MinaSftpComponentConfiguration",
"defaultValue": true
},
{
"name": "camel.component.mina-sftp.lazy-start-producer",
"type": "java.lang.Boolean",
"description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.",
"sourceType": "org.apache.camel.component.file.remote.mina.springboot.MinaSftpComponentConfiguration",
"defaultValue": false
}
],
"hints": [],
"ignored": {
"properties": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.component.file.remote.mina.springboot;

import org.apache.camel.CamelContext;
import org.apache.camel.Component;
import org.apache.camel.component.file.remote.mina.MinaSftpComponent;
import org.apache.camel.spi.ComponentCustomizer;
import org.apache.camel.spring.boot.CamelAutoConfiguration;
import org.apache.camel.spring.boot.ComponentConfigurationProperties;
import org.apache.camel.spring.boot.util.CamelPropertiesHelper;
import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties;
import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

/**
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@Configuration(proxyBeanMethods = false)
@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class)
@EnableConfigurationProperties({ComponentConfigurationProperties.class,MinaSftpComponentConfiguration.class})
@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.mina-sftp"})
@AutoConfigureAfter(CamelAutoConfiguration.class)
public class MinaSftpComponentAutoConfiguration {

@Autowired
private ApplicationContext applicationContext;
private final CamelContext camelContext;
@Autowired
private MinaSftpComponentConfiguration configuration;

public MinaSftpComponentAutoConfiguration(
org.apache.camel.CamelContext camelContext) {
this.camelContext = camelContext;
}

@Lazy
@Bean
public ComponentCustomizer configureMinaSftpComponent() {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
CamelPropertiesHelper.copyProperties(camelContext, configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
return HierarchicalPropertiesEvaluator.evaluate(
applicationContext,
"camel.component.customizer",
"camel.component.mina-sftp.customizer")
&& target instanceof MinaSftpComponent;
}
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.component.file.remote.mina.springboot;

import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
* Upload and download files to/from SFTP servers using Apache MINA SSHD.
*
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@ConfigurationProperties(prefix = "camel.component.mina-sftp")
public class MinaSftpComponentConfiguration
extends
ComponentConfigurationPropertiesCommon {

/**
* Whether to enable auto configuration of the mina-sftp component. This is
* enabled by default.
*/
private Boolean enabled;
/**
* Allows for bridging the consumer to the Camel routing Error Handler,
* which mean any exceptions (if possible) occurred while the Camel consumer
* is trying to pickup incoming messages, or the likes, will now be
* processed as a message and handled by the routing Error Handler.
* Important: This is only possible if the 3rd party component allows Camel
* to be alerted if an exception was thrown. Some components handle this
* internally only, and therefore bridgeErrorHandler is not possible. In
* other situations we may improve the Camel component to hook into the 3rd
* party component and make this possible for future releases. By default
* the consumer will use the org.apache.camel.spi.ExceptionHandler to deal
* with exceptions, that will be logged at WARN or ERROR level and ignored.
*/
private Boolean bridgeErrorHandler = false;
/**
* Whether the producer should be started lazy (on the first message). By
* starting lazy you can use this to allow CamelContext and routes to
* startup in situations where a producer may otherwise fail during starting
* and cause the route to fail being started. By deferring this startup to
* be lazy then the startup failure can be handled during routing messages
* via Camel's routing error handlers. Beware that when the first message is
* processed then creating and starting the producer may take a little time
* and prolong the total processing time of the processing.
*/
private Boolean lazyStartProducer = false;
/**
* Whether autowiring is enabled. This is used for automatic autowiring
* options (the option must be marked as autowired) by looking up in the
* registry to find if there is a single instance of matching type, which
* then gets configured on the component. This can be used for automatic
* configuring JDBC data sources, JMS connection factories, AWS Clients,
* etc.
*/
private Boolean autowiredEnabled = true;
/**
* Used for enabling or disabling all consumer based health checks from this
* component
*/
private Boolean healthCheckConsumerEnabled = true;
/**
* Used for enabling or disabling all producer based health checks from this
* component. Notice: Camel has by default disabled all producer based
* health-checks. You can turn on producer checks globally by setting
* camel.health.producersEnabled=true.
*/
private Boolean healthCheckProducerEnabled = true;

public Boolean getBridgeErrorHandler() {
return bridgeErrorHandler;
}

public void setBridgeErrorHandler(Boolean bridgeErrorHandler) {
this.bridgeErrorHandler = bridgeErrorHandler;
}

public Boolean getLazyStartProducer() {
return lazyStartProducer;
}

public void setLazyStartProducer(Boolean lazyStartProducer) {
this.lazyStartProducer = lazyStartProducer;
}

public Boolean getAutowiredEnabled() {
return autowiredEnabled;
}

public void setAutowiredEnabled(Boolean autowiredEnabled) {
this.autowiredEnabled = autowiredEnabled;
}

public Boolean getHealthCheckConsumerEnabled() {
return healthCheckConsumerEnabled;
}

public void setHealthCheckConsumerEnabled(Boolean healthCheckConsumerEnabled) {
this.healthCheckConsumerEnabled = healthCheckConsumerEnabled;
}

public Boolean getHealthCheckProducerEnabled() {
return healthCheckProducerEnabled;
}

public void setHealthCheckProducerEnabled(Boolean healthCheckProducerEnabled) {
this.healthCheckProducerEnabled = healthCheckProducerEnabled;
}
}
Loading
Loading