Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f692cad
chore(QTDI-1914): Sample dynamic schema connector.
ypiel-talend Oct 22, 2025
e53256c
Add 2 params
yyin-talend Oct 23, 2025
b4705a0
chore(QTDI-1914): remove unused option in dso, environment info manag…
ypiel-talend Oct 23, 2025
1a76af5
Add 2 connectors: dataset, datastore with tests
yyin-talend Oct 27, 2025
8c10ae1
Add 2 connectors: dataset, datastore with tests
yyin-talend Oct 27, 2025
189ac9e
chore(QTDI-1914): Some adjustments.
ypiel-talend Oct 27, 2025
51c2838
chore(QTDI-1914): Working unit test.
ypiel-talend Oct 27, 2025
a921b04
chore(QTDI-1914): working dynamic dependencies connectors.
ypiel-talend Oct 27, 2025
54714b7
fix labels
yyin-talend Oct 28, 2025
d52d6eb
chore(QTDI-1914): fix artifact group id for dependency.
ypiel-talend Oct 28, 2025
e55a7a4
refactor junits
yyin-talend Oct 29, 2025
0c8e974
add working directory in output
yyin-talend Oct 29, 2025
3b18693
chore(QTDI-1914): Improve and unit test and fix labels.
ypiel-talend Oct 29, 2025
360f13d
chore(QTDI-1914): Add a connector with same behavior as datapreprun.
ypiel-talend Oct 30, 2025
136b654
fix layout for dieOnError
yyin-talend Oct 31, 2025
c3e7ad0
Fix dataprepRunAnnotation connector
yyin-talend Oct 31, 2025
2417f80
feat(QTDI-1914): Cleanings.
ypiel-talend Nov 4, 2025
fdde448
Add Readme
yyin-talend Nov 5, 2025
55bd365
Merge branch 'master' into ypiel/QTDI-1914_sample_connector_dyndeps
yyin-talend Nov 10, 2025
0572b53
feat(QTDI-1914): try to execute a TCK connector to check if it is wel…
ypiel-talend Nov 10, 2025
6ff4e06
Merge branch 'ypiel/QTDI-1914_sample_connector_dyndeps' of github.com…
ypiel-talend Nov 10, 2025
06da286
Add function to load depended component's depends
yyin-talend Nov 12, 2025
fe550fc
# Conflicts:
yyin-talend Nov 18, 2025
caef44a
rename
yyin-talend Nov 18, 2025
15c4e2d
fix junit
yyin-talend Nov 18, 2025
132e0d9
fix(QTDI-1914): some refactoring.
ypiel-talend Nov 18, 2025
578c338
feat(QTDI-1914): Add a connector taht uses a SPI.
ypiel-talend Nov 25, 2025
2dc763d
feat(QTDI-1914): remove unnecessary dependency.
ypiel-talend Nov 25, 2025
fabc258
feat(QTDI-1914): Add a test on the spi.
ypiel-talend Nov 25, 2025
15759e1
feat(QTDI-1914): Change the SPI interface and add a unit test.
ypiel-talend Nov 26, 2025
9bb8698
Merge branch 'master' into ypiel/QTDI-1914_sample_connector_dyndeps
ypiel-talend Nov 26, 2025
bc2ded4
feat(QTDI-1914): Update pom version in dynamic-dependencies modules.
ypiel-talend Nov 26, 2025
d282b18
feat(QTDI-1914): Clean pom.xml in dynamic-dependencies sample module.
ypiel-talend Nov 27, 2025
07e2722
feat(QTDI-1914): try to add a classloader customizer.
ypiel-talend Nov 27, 2025
208067a
feat(QTDI-1914): Fix customizer SPI resource file.
ypiel-talend Nov 27, 2025
646d9ab
feat(QTDI-1914): Add some resources to be loaded.
ypiel-talend Nov 27, 2025
cad9132
feat(QTDI-1914): Add multiple resources load.
ypiel-talend Nov 27, 2025
e94f6ce
feat(QTDI-1914): Add SPI resource for classloader customizer.
ypiel-talend Nov 28, 2025
08548c9
feat(QTDI-1914): Rename StringMapTransformer t o StringListTransformer.
ypiel-talend Nov 28, 2025
2d94660
feat(QTDI-1914): Refactoring + external dependency.
ypiel-talend Dec 1, 2025
103c741
feat(QTDI-1914): Add a class from standard dependency.
ypiel-talend Dec 4, 2025
9e50baf
feat(QTDI-1914): Complete the readme.md.
ypiel-talend Dec 4, 2025
4239689
feat(QTDI-1914): Complete the readme.md.
ypiel-talend Dec 4, 2025
33dd8e2
feat(QTDI-1914): fix json2Map and record builder
undx Dec 12, 2025
ee71c1e
Merge branch 'master' into ypiel/QTDI-1914_sample_connector_dyndeps
undx Jan 6, 2026
30ac693
feat(QTDI-1914): Don't throw exception anymore if it misses a spi, ju…
ypiel-talend Jan 7, 2026
ea29927
feat(QTDI-1914): Don't throw exception anymore if it misses a spi, ju…
ypiel-talend Jan 7, 2026
dfe6b1f
feat(QTDI-1914): Don't throw exception anymore if a resources from a …
ypiel-talend Jan 7, 2026
56c3451
feat(QTDI-1914): Some improvements
ypiel-talend Jan 14, 2026
258e6c0
feat(QTDI-1914): Fix some SPI / deactivate the customer by default / …
ypiel-talend Jan 16, 2026
a53a627
feat(QTDI-1914): Simplify connectors forms.
ypiel-talend Jan 19, 2026
8e76aef
feat(QTDI-1914): Fix unit tests.
ypiel-talend Jan 19, 2026
26160e5
feat(QTDI-1914): Remove unused parameter to throw exception when a sp…
ypiel-talend Jan 19, 2026
ea5ea8a
feat(QTDI-1914): A connector needs at least one parameter to be able …
ypiel-talend Jan 23, 2026
7cbd5a1
feat(QTDI-1914): Add rootRepo/classpath/workingDir info in dyndepsWit…
ypiel-talend Jan 27, 2026
642c325
feat(QTDI-1914): Deactivate car/dependencies/scan in dynamic-dependen…
ypiel-talend Jan 29, 2026
df43a2e
feat(QTDI-1914): Update documentation.
ypiel-talend Feb 2, 2026
ab3afe8
feat(QTDI-1914): Copilot code review.
ypiel-talend Feb 2, 2026
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
@@ -0,0 +1,34 @@
/**
* Copyright (C) 2006-2025 Talend Inc. - www.talend.com
*
* Licensed 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.talend.sdk.component.api.configuration.type;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import org.talend.sdk.component.api.configuration.type.meta.ConfigurationType;
import org.talend.sdk.component.api.meta.Documentation;

@Target(TYPE)
@Retention(RUNTIME)
@ConfigurationType("dynamicDependenciesConfiguration")
@Documentation("Mark a model (complex object) as being the configuration expected to compute dynamic dependencies.")
public @interface DynamicDependenciesConfiguration {

String value() default "default";
}
2 changes: 1 addition & 1 deletion sample-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
317 changes: 317 additions & 0 deletions sample-parent/sample-features/dynamic-dependencies/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2006-2025 Talend Inc. - www.talend.com
Licensed 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.sdk.samplefeature.dynamicdependencies</groupId>
<artifactId>dynamic-dependencies</artifactId>
<version>1.89.0-SNAPSHOT</version>
</parent>

<artifactId>classloader-test-library</artifactId>

<packaging>jar</packaging>
<name>Component Runtime :: Sample Feature @DynamicDependency :: a classloader test library</name>

<properties>
<talend.car.skip>true</talend.car.skip>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>dynamic.dependencies.classloadertestlibrary</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (C) 2006-2025 Talend Inc. - www.talend.com
*
* Licensed 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.talend.sdk.component.sample.feature.dynamicdependencies.classloadertestlibrary.serviceInterfaces;

Check notice on line 16 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/serviceInterfaces/StringProviderFromExternalSPI.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/serviceInterfaces/StringProviderFromExternalSPI.java#L16

Rename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.

public interface StringProviderFromExternalSPI {

String getValueFromExternalSPI();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (C) 2006-2025 Talend Inc. - www.talend.com
*
* Licensed 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.talend.sdk.component.sample.feature.dynamicdependencies.classloadertestlibrary.serviceInterfaces;

Check notice on line 16 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/serviceInterfaces/StringProviderSPIAsDependency.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/serviceInterfaces/StringProviderSPIAsDependency.java#L16

Rename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.

public interface StringProviderSPIAsDependency {

String getValueFromDependency();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (C) 2006-2025 Talend Inc. - www.talend.com
*
* Licensed 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.talend.sdk.component.sample.feature.dynamicdependencies.classloadertestlibrary.serviceInterfaces;

Check notice on line 16 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/serviceInterfaces/StringProviderSPIAsDynamicDependency.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/serviceInterfaces/StringProviderSPIAsDynamicDependency.java#L16

Rename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.

public interface StringProviderSPIAsDynamicDependency {

String getValueFromASPIAsDynamicDependency();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* Copyright (C) 2006-2025 Talend Inc. - www.talend.com
*
* Licensed 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.talend.sdk.component.sample.feature.dynamicdependencies.classloadertestlibrary.spiConsumers;

Check notice on line 16 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/AbstractSPIConsumer.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/AbstractSPIConsumer.java#L16

Rename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.ServiceLoader;
import java.util.function.Function;
import java.util.stream.Collectors;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public abstract class AbstractSPIConsumer<S, T> {

private final Optional<S> spiImpl;

protected AbstractSPIConsumer(final Class clazz) {

Check warning on line 32 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/AbstractSPIConsumer.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/AbstractSPIConsumer.java#L32

Provide the parametrized type for this generic.
ServiceLoader<S> serviceLoader = ServiceLoader.load(clazz, AbstractSPIConsumer.class.getClassLoader());

List<S> implProvider = new ArrayList<>();

try {
serviceLoader.iterator().forEachRemaining(implProvider::add);
} catch (Throwable e) {

Check warning on line 39 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/AbstractSPIConsumer.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/AbstractSPIConsumer.java#L39

Catch Exception instead of Throwable.
log.error("Can't load %s spi implementation: %s.".formatted(clazz, e.getMessage()), e);
}

if (implProvider.size() <= 0) {

Check notice on line 43 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/AbstractSPIConsumer.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/AbstractSPIConsumer.java#L43

Use isEmpty() to check whether the collection is empty or not.
log.error("No SPI service found for %s.".formatted(clazz));
spiImpl = Optional.empty();
return;
}

if (implProvider.size() > 1) {
String join = implProvider.stream()
.map(m -> m.getClass().getName())
.collect(Collectors.joining("\n"));
log.error("More than one %s service has been found: %s.".formatted(clazz, join));
// For testing purpose (the goal of this connector), better to fail in that case.
spiImpl = Optional.empty();
return;
}

this.spiImpl = Optional.of(implProvider.get(0));
}

public abstract String getValue();

public T transform(final Function<String, T> function) {
String value = this.getValue();
return function.apply(value);
}

public Optional<S> getSPIImpl() {
return this.spiImpl;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Copyright (C) 2006-2025 Talend Inc. - www.talend.com
*
* Licensed 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.talend.sdk.component.sample.feature.dynamicdependencies.classloadertestlibrary.spiConsumers;

Check notice on line 16 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/DependencySPIConsumer.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/DependencySPIConsumer.java#L16

Rename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.

import org.talend.sdk.component.sample.feature.dynamicdependencies.classloadertestlibrary.serviceInterfaces.StringProviderSPIAsDependency;

public class DependencySPIConsumer<T> extends AbstractSPIConsumer<StringProviderSPIAsDependency, T> {

public DependencySPIConsumer() {
super(StringProviderSPIAsDependency.class);
}

public String getValue() {
if (this.getSPIImpl().isPresent()) {
StringProviderSPIAsDependency impl = this.getSPIImpl().get();

Check warning on line 28 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/DependencySPIConsumer.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/DependencySPIConsumer.java#L28

Call "Optional#isPresent()" or "!Optional#isEmpty()" before accessing the value.
return impl.getValueFromDependency();
} else {
return "[ERROR] StringsProviderSPIAsDependency not loaded!";
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Copyright (C) 2006-2025 Talend Inc. - www.talend.com
*
* Licensed 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.talend.sdk.component.sample.feature.dynamicdependencies.classloadertestlibrary.spiConsumers;

Check notice on line 16 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/DynamicDependencySPIConsumer.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/DynamicDependencySPIConsumer.java#L16

Rename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.

import org.talend.sdk.component.sample.feature.dynamicdependencies.classloadertestlibrary.serviceInterfaces.StringProviderSPIAsDynamicDependency;

public class DynamicDependencySPIConsumer<T> extends AbstractSPIConsumer<StringProviderSPIAsDynamicDependency, T> {

public DynamicDependencySPIConsumer() {
super(StringProviderSPIAsDynamicDependency.class);
}

public String getValue() {
if (this.getSPIImpl().isPresent()) {
StringProviderSPIAsDynamicDependency impl = this.getSPIImpl().get();

Check warning on line 28 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/DynamicDependencySPIConsumer.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/DynamicDependencySPIConsumer.java#L28

Call "Optional#isPresent()" or "!Optional#isEmpty()" before accessing the value.
return impl.getValueFromASPIAsDynamicDependency();
} else {
return "[ERROR] StringsProviderSPIAsDynamicDependency not loaded!";
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Copyright (C) 2006-2025 Talend Inc. - www.talend.com
*
* Licensed 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.talend.sdk.component.sample.feature.dynamicdependencies.classloadertestlibrary.spiConsumers;

Check notice on line 16 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/ExternalDependencySPIConsumer.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/ExternalDependencySPIConsumer.java#L16

Rename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.

import org.talend.sdk.component.sample.feature.dynamicdependencies.classloadertestlibrary.serviceInterfaces.StringProviderFromExternalSPI;

public class ExternalDependencySPIConsumer<T> extends AbstractSPIConsumer<StringProviderFromExternalSPI, T> {

public ExternalDependencySPIConsumer() {
super(StringProviderFromExternalSPI.class);
}

public String getValue() {
if (this.getSPIImpl().isPresent()) {
StringProviderFromExternalSPI impl = this.getSPIImpl().get();

Check warning on line 28 in sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/ExternalDependencySPIConsumer.java

View check run for this annotation

sonar-eks / SonarQube Code Analysis

sample-parent/sample-features/dynamic-dependencies/classloader-test-library/src/main/java/org/talend/sdk/component/sample/feature/dynamicdependencies/classloadertestlibrary/spiConsumers/ExternalDependencySPIConsumer.java#L28

Call "Optional#isPresent()" or "!Optional#isEmpty()" before accessing the value.
return impl.getValueFromExternalSPI();
} else {
return "[ERROR] StringProviderFromExternalSPI not loaded!";
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (C) 2006-2025 Talend Inc. - www.talend.com
#
# Licensed 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.
# Here you can change all your configuration display names to use more explicit labels
# You can also translate your configuration by adding one file by local Messages_fr.properties for french for example
org.talend.sdk.component.sample.feature.dynamicdependencies.classloadertestlibrary.message=This is a resource file from classloader-test-library.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (C) 2006-2025 Talend Inc. - www.talend.com
#
# Licensed 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.
# Here you can change all your configuration display names to use more explicit labels
# You can also translate your configuration by adding one file by local Messages_fr.properties for french for example
content=from dependency
Loading
Loading