Skip to content

Commit ab899db

Browse files
Merge remote-tracking branch 'origin' into feature/ucp-monitoring-otel-jfr
2 parents 6629a57 + 6969e2c commit ab899db

12 files changed

Lines changed: 196 additions & 52 deletions

File tree

ojdbc-provider-aws/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,21 @@
9090
<artifactId>junit-jupiter-engine</artifactId>
9191
</dependency>
9292
</dependencies>
93+
94+
<build>
95+
<plugins>
96+
<plugin>
97+
<groupId>org.apache.maven.plugins</groupId>
98+
<artifactId>maven-jar-plugin</artifactId>
99+
<version>3.3.0</version>
100+
<configuration>
101+
<archive>
102+
<manifestEntries>
103+
<Automatic-Module-Name>com.oracle.database.jdbc.provider.aws</Automatic-Module-Name>
104+
</manifestEntries>
105+
</archive>
106+
</configuration>
107+
</plugin>
108+
</plugins>
109+
</build>
93110
</project>

ojdbc-provider-aws/src/main/java/oracle/jdbc/provider/aws/appconfig/AppConfigFactory.java

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import java.io.InputStream;
5353

5454
import static oracle.jdbc.provider.aws.configuration.AwsConfigurationParameters.*;
55+
import static oracle.jdbc.provider.util.ParameterUtils.getParameterWithFallback;
5556

5657
/**
5758
* A factory for retrieving <b>Freeform Configurations</b> data from AWS
@@ -132,29 +133,4 @@ public Resource<InputStream> request(AwsCredentials awsCredentials, ParameterSet
132133
false);
133134
}
134135
}
135-
136-
/**
137-
* Retrieves a parameter value with fallback to system property and environment variable.
138-
* @param parameter The Parameter object to retrieve from ParameterSet.
139-
* @param sysPropKey The system property key to check.
140-
* @param envVarKey The environment variable key to check.
141-
* @param paramSet The ParameterSet to check first.
142-
* @return The parameter value, or throws an exception if not found.
143-
* @throws IllegalArgumentException if the parameter is not found in any source.
144-
*/
145-
private static String getParameterWithFallback(Parameter<String> parameter, String sysPropKey, String envVarKey, ParameterSet paramSet) {
146-
String value = paramSet.getOptional(parameter);
147-
if (value == null) {
148-
value = System.getProperty(sysPropKey);
149-
if (value == null) {
150-
value = System.getenv(envVarKey);
151-
if (value == null) {
152-
throw new IllegalArgumentException(
153-
String.format("Parameter '%s' is required and not found in ParameterSet, system property '%s', or environment variable '%s'",
154-
paramSet.getName(parameter), sysPropKey, envVarKey));
155-
}
156-
}
157-
}
158-
return value;
159-
}
160136
}

ojdbc-provider-azure/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,21 @@
6969
<artifactId>junit-jupiter-engine</artifactId>
7070
</dependency>
7171
</dependencies>
72+
73+
<build>
74+
<plugins>
75+
<plugin>
76+
<groupId>org.apache.maven.plugins</groupId>
77+
<artifactId>maven-jar-plugin</artifactId>
78+
<version>3.3.0</version>
79+
<configuration>
80+
<archive>
81+
<manifestEntries>
82+
<Automatic-Module-Name>com.oracle.database.jdbc.provider.azure</Automatic-Module-Name>
83+
</manifestEntries>
84+
</archive>
85+
</configuration>
86+
</plugin>
87+
</plugins>
88+
</build>
7289
</project>

ojdbc-provider-common/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
<groupId>org.apache.maven.plugins</groupId>
4040
<artifactId>maven-jar-plugin</artifactId>
4141
<version>3.3.0</version>
42+
<configuration>
43+
<archive>
44+
<manifestEntries>
45+
<Automatic-Module-Name>com.oracle.database.jdbc.provider.common</Automatic-Module-Name>
46+
</manifestEntries>
47+
</archive>
48+
</configuration>
4249
<executions>
4350
<execution>
4451
<goals>

ojdbc-provider-hashicorp/src/main/java/oracle/jdbc/provider/hashicorp/util/Parameterutil.java renamed to ojdbc-provider-common/src/main/java/oracle/jdbc/provider/util/ParameterUtils.java

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** Copyright (c) 2025 Oracle and/or its affiliates.
2+
** Copyright (c) 2026 Oracle and/or its affiliates.
33
**
44
** The Universal Permissive License (UPL), Version 1.0
55
**
@@ -36,14 +36,21 @@
3636
** SOFTWARE.
3737
*/
3838

39-
package oracle.jdbc.provider.hashicorp.util;
39+
package oracle.jdbc.provider.util;
40+
41+
import oracle.jdbc.provider.parameter.Parameter;
42+
import oracle.jdbc.provider.parameter.ParameterSet;
4043

4144
/**
42-
* Utility class for parameter resolution.
45+
* Utility class for parameter resolution with fallback support.
46+
* <p>
47+
* This class provides methods to retrieve parameter values from multiple sources
48+
* with a priority order: ParameterSet → System Properties → Environment Variables.
49+
* </p>
4350
*/
44-
public final class Parameterutil {
51+
public final class ParameterUtils {
4552

46-
private Parameterutil() {
53+
private ParameterUtils() {
4754
// Prevent instantiation.
4855
}
4956

@@ -57,4 +64,38 @@ private Parameterutil() {
5764
public static String getFallback(String key) {
5865
return System.getProperty(key, System.getenv(key));
5966
}
60-
}
67+
68+
/**
69+
* Retrieves a parameter value with cascading fallback to system property and environment variable.
70+
* <p>
71+
* The lookup order is:
72+
* <ol>
73+
* <li>ParameterSet</li>
74+
* <li>System property</li>
75+
* <li>Environment variable</li>
76+
* </ol>
77+
*
78+
* @param parameter The Parameter object to retrieve from ParameterSet
79+
* @param sysPropKey The system property key to check as fallback
80+
* @param envVarKey The environment variable key to check as fallback
81+
* @param paramSet The ParameterSet to check first
82+
* @return The parameter value from the first available source
83+
* @throws IllegalArgumentException if the parameter is not found in any source
84+
*/
85+
public static String getParameterWithFallback(Parameter<String> parameter,
86+
String sysPropKey, String envVarKey, ParameterSet paramSet) {
87+
String value = paramSet.getOptional(parameter);
88+
if (value == null) {
89+
value = System.getProperty(sysPropKey);
90+
if (value == null) {
91+
value = System.getenv(envVarKey);
92+
if (value == null) {
93+
throw new IllegalArgumentException(
94+
String.format("Parameter '%s' is required and not found in ParameterSet, system property '%s', or environment variable '%s'",
95+
paramSet.getName(parameter), sysPropKey, envVarKey));
96+
}
97+
}
98+
}
99+
return value;
100+
}
101+
}

ojdbc-provider-gcp/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,21 @@
6363
</dependency>
6464
</dependencies>
6565

66+
<build>
67+
<plugins>
68+
<plugin>
69+
<groupId>org.apache.maven.plugins</groupId>
70+
<artifactId>maven-jar-plugin</artifactId>
71+
<version>3.3.0</version>
72+
<configuration>
73+
<archive>
74+
<manifestEntries>
75+
<Automatic-Module-Name>com.oracle.database.jdbc.provider.gcp</Automatic-Module-Name>
76+
</manifestEntries>
77+
</archive>
78+
</configuration>
79+
</plugin>
80+
</plugins>
81+
</build>
82+
6683
</project>

ojdbc-provider-hashicorp/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,21 @@
4040
</dependency>
4141
</dependencies>
4242

43+
<build>
44+
<plugins>
45+
<plugin>
46+
<groupId>org.apache.maven.plugins</groupId>
47+
<artifactId>maven-jar-plugin</artifactId>
48+
<version>3.3.0</version>
49+
<configuration>
50+
<archive>
51+
<manifestEntries>
52+
<Automatic-Module-Name>com.oracle.database.jdbc.provider.hashicorp</Automatic-Module-Name>
53+
</manifestEntries>
54+
</archive>
55+
</configuration>
56+
</plugin>
57+
</plugins>
58+
</build>
59+
4360
</project>

ojdbc-provider-hashicorp/src/main/java/oracle/jdbc/provider/hashicorp/hcpvaultdedicated/authentication/DedicatedVaultParameters.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838

3939
package oracle.jdbc.provider.hashicorp.hcpvaultdedicated.authentication;
4040

41-
import oracle.jdbc.provider.hashicorp.util.Parameterutil;
4241
import oracle.jdbc.provider.parameter.Parameter;
4342
import oracle.jdbc.provider.parameter.ParameterSet;
4443
import oracle.jdbc.provider.parameter.ParameterSetParser;
44+
import oracle.jdbc.provider.util.ParameterUtils;
4545

4646
import java.util.HashMap;
4747
import java.util.Map;
@@ -213,37 +213,37 @@ public static ParameterSet buildResolvedParameterSet(Map<String, String> inputOp
213213
DedicatedVaultAuthenticationMethod authMethod =
214214
DedicatedVaultAuthenticationMethod.valueOf(authStr.toUpperCase());
215215

216-
opts.computeIfAbsent(PARAM_VAULT_ADDR, Parameterutil::getFallback);
217-
opts.computeIfAbsent(PARAM_VAULT_NAMESPACE, Parameterutil::getFallback);
216+
opts.computeIfAbsent(PARAM_VAULT_ADDR, ParameterUtils::getFallback);
217+
opts.computeIfAbsent(PARAM_VAULT_NAMESPACE, ParameterUtils::getFallback);
218218

219219
switch (authMethod) {
220220
case VAULT_TOKEN:
221-
opts.computeIfAbsent(PARAM_VAULT_TOKEN, Parameterutil::getFallback);
221+
opts.computeIfAbsent(PARAM_VAULT_TOKEN, ParameterUtils::getFallback);
222222
break;
223223
case GITHUB:
224-
opts.computeIfAbsent(PARAM_GITHUB_TOKEN, Parameterutil::getFallback);
225-
opts.computeIfAbsent(PARAM_GITHUB_AUTH_PATH, Parameterutil::getFallback);
224+
opts.computeIfAbsent(PARAM_GITHUB_TOKEN, ParameterUtils::getFallback);
225+
opts.computeIfAbsent(PARAM_GITHUB_AUTH_PATH, ParameterUtils::getFallback);
226226
break;
227227
case APPROLE:
228-
opts.computeIfAbsent(PARAM_VAULT_ROLE_ID, Parameterutil::getFallback);
229-
opts.computeIfAbsent(PARAM_VAULT_SECRET_ID, Parameterutil::getFallback);
230-
opts.computeIfAbsent(PARAM_APPROLE_AUTH_PATH, Parameterutil::getFallback);
228+
opts.computeIfAbsent(PARAM_VAULT_ROLE_ID, ParameterUtils::getFallback);
229+
opts.computeIfAbsent(PARAM_VAULT_SECRET_ID, ParameterUtils::getFallback);
230+
opts.computeIfAbsent(PARAM_APPROLE_AUTH_PATH, ParameterUtils::getFallback);
231231
break;
232232
case USERPASS:
233-
opts.computeIfAbsent(PARAM_VAULT_USERNAME, Parameterutil::getFallback);
234-
opts.computeIfAbsent(PARAM_VAULT_PASSWORD, Parameterutil::getFallback);
235-
opts.computeIfAbsent(PARAM_USERPASS_AUTH_PATH, Parameterutil::getFallback);
233+
opts.computeIfAbsent(PARAM_VAULT_USERNAME, ParameterUtils::getFallback);
234+
opts.computeIfAbsent(PARAM_VAULT_PASSWORD, ParameterUtils::getFallback);
235+
opts.computeIfAbsent(PARAM_USERPASS_AUTH_PATH, ParameterUtils::getFallback);
236236
break;
237237
case AUTO_DETECT:
238-
opts.computeIfAbsent(PARAM_VAULT_TOKEN, Parameterutil::getFallback);
239-
opts.computeIfAbsent(PARAM_VAULT_USERNAME, Parameterutil::getFallback);
240-
opts.computeIfAbsent(PARAM_VAULT_PASSWORD, Parameterutil::getFallback);
241-
opts.computeIfAbsent(PARAM_USERPASS_AUTH_PATH, Parameterutil::getFallback);
242-
opts.computeIfAbsent(PARAM_VAULT_ROLE_ID, Parameterutil::getFallback);
243-
opts.computeIfAbsent(PARAM_VAULT_SECRET_ID, Parameterutil::getFallback);
244-
opts.computeIfAbsent(PARAM_APPROLE_AUTH_PATH, Parameterutil::getFallback);
245-
opts.computeIfAbsent(PARAM_GITHUB_TOKEN, Parameterutil::getFallback);
246-
opts.computeIfAbsent(PARAM_GITHUB_AUTH_PATH, Parameterutil::getFallback);
238+
opts.computeIfAbsent(PARAM_VAULT_TOKEN, ParameterUtils::getFallback);
239+
opts.computeIfAbsent(PARAM_VAULT_USERNAME, ParameterUtils::getFallback);
240+
opts.computeIfAbsent(PARAM_VAULT_PASSWORD, ParameterUtils::getFallback);
241+
opts.computeIfAbsent(PARAM_USERPASS_AUTH_PATH, ParameterUtils::getFallback);
242+
opts.computeIfAbsent(PARAM_VAULT_ROLE_ID, ParameterUtils::getFallback);
243+
opts.computeIfAbsent(PARAM_VAULT_SECRET_ID, ParameterUtils::getFallback);
244+
opts.computeIfAbsent(PARAM_APPROLE_AUTH_PATH, ParameterUtils::getFallback);
245+
opts.computeIfAbsent(PARAM_GITHUB_TOKEN, ParameterUtils::getFallback);
246+
opts.computeIfAbsent(PARAM_GITHUB_AUTH_PATH, ParameterUtils::getFallback);
247247
break;
248248
default:
249249
break;

ojdbc-provider-jackson-oson/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@
7373
</systemPropertyVariables>
7474
</configuration>
7575
</plugin>
76+
<plugin>
77+
<groupId>org.apache.maven.plugins</groupId>
78+
<artifactId>maven-jar-plugin</artifactId>
79+
<configuration>
80+
<archive>
81+
<manifestEntries>
82+
<Automatic-Module-Name>com.oracle.database.jdbc.provider.jackson.oson</Automatic-Module-Name>
83+
</manifestEntries>
84+
</archive>
85+
</configuration>
86+
</plugin>
7687
</plugins>
7788
</build>
7889

ojdbc-provider-oci/pom.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,22 @@
8383
<artifactId>junit-jupiter-engine</artifactId>
8484
</dependency>
8585
</dependencies>
86+
87+
<build>
88+
<plugins>
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-jar-plugin</artifactId>
92+
<version>3.3.0</version>
93+
<configuration>
94+
<archive>
95+
<manifestEntries>
96+
<Automatic-Module-Name>com.oracle.database.jdbc.provider.oci</Automatic-Module-Name>
97+
</manifestEntries>
98+
</archive>
99+
</configuration>
100+
</plugin>
101+
</plugins>
102+
</build>
103+
86104
</project>

0 commit comments

Comments
 (0)