Skip to content

Commit a6996c3

Browse files
committed
Merge remote-tracking branch 'origin/issue/301_Upgrade_Dependencies'
into develop_2
2 parents c4c6858 + c45f65e commit a6996c3

File tree

60 files changed

+7884
-942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+7884
-942
lines changed

dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/variables/ObjectMapperFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.hl7.fhir.r4.model.Resource;
44

5+
import com.fasterxml.jackson.annotation.JsonInclude;
56
import com.fasterxml.jackson.annotation.JsonInclude.Include;
67
import com.fasterxml.jackson.databind.MapperFeature;
78
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -18,7 +19,9 @@ private ObjectMapperFactory()
1819

1920
public static ObjectMapper createObjectMapper(FhirContext fhirContext)
2021
{
21-
return JsonMapper.builder().serializationInclusion(Include.NON_NULL).serializationInclusion(Include.NON_EMPTY)
22+
return JsonMapper.builder()
23+
.defaultPropertyInclusion(JsonInclude.Value.construct(Include.NON_NULL, Include.NON_NULL))
24+
.defaultPropertyInclusion(JsonInclude.Value.construct(Include.NON_EMPTY, Include.NON_EMPTY))
2225
.addModule(fhirModule(fhirContext)).disable(MapperFeature.AUTO_DETECT_CREATORS)
2326
.disable(MapperFeature.AUTO_DETECT_FIELDS)
2427
// .disable(MapperFeature.AUTO_DETECT_GETTERS).disable(MapperFeature.AUTO_DETECT_IS_GETTERS)

dsf-bpe/dsf-bpe-process-api-v2-impl/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
<artifactItem>
163163
<groupId>org.xerial</groupId>
164164
<artifactId>sqlite-jdbc</artifactId>
165-
<version>3.45.1.0</version>
165+
<version>3.49.1.0</version>
166166
</artifactItem>
167167
<artifactItem>
168168
<groupId>ca.uhn.hapi.fhir</groupId>

dsf-bpe/dsf-bpe-process-api-v2-impl/src/main/java/dev/dsf/bpe/v2/client/oidc/OidcClientDelegate.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,6 @@ public Jwks getJwks() throws OidcClientException
269269
return jwks == null ? null : new JwksApiDelegate(jwks);
270270
}
271271

272-
@Override
273-
public Jwks getJwks(Configuration configuration) throws OidcClientException
274-
{
275-
var jwks = delegate.getJwks(configuration == null ? null : new ConfigurationV2Delegate(configuration));
276-
return jwks == null ? null : new JwksApiDelegate(jwks);
277-
}
278-
279272
@Override
280273
public char[] getAccessToken() throws OidcClientException
281274
{

dsf-bpe/dsf-bpe-process-api-v2-impl/src/main/java/dev/dsf/bpe/v2/plugin/ProcessPluginImpl.java

Lines changed: 13 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -127,75 +127,40 @@ protected void customizeApplicationContext(AnnotationConfigApplicationContext co
127127
new ProcessPluginApiFactory(processPluginDefinition, parentContext));
128128
}
129129

130-
private ProcessPluginApi getProcessPluginApi()
130+
private <T> T getOrSet(AtomicReference<T> cache, Supplier<T> supplier)
131131
{
132-
ProcessPluginApi entry = processPluginApi.get();
133-
if (entry == null)
132+
T cached = cache.get();
133+
if (cached == null)
134134
{
135-
ProcessPluginApi o = doGetProcessPluginApi();
136-
if (processPluginApi.compareAndSet(entry, o))
137-
return o;
135+
T value = supplier.get();
136+
if (cache.compareAndSet(cached, value))
137+
return value;
138138
else
139-
return processPluginApi.get();
139+
return cache.get();
140140
}
141141
else
142-
return entry;
142+
return cached;
143143
}
144144

145-
private ProcessPluginApi doGetProcessPluginApi()
145+
private ProcessPluginApi getProcessPluginApi()
146146
{
147-
return getApplicationContext().getBean(ProcessPluginApi.class);
147+
return getOrSet(processPluginApi, () -> getApplicationContext().getBean(ProcessPluginApi.class));
148148
}
149149

150150
private FhirContext getFhirContext()
151151
{
152-
FhirContext entry = fhirContext.get();
153-
if (entry == null)
154-
{
155-
FhirContext o = doGetFhirContext();
156-
if (fhirContext.compareAndSet(entry, o))
157-
return o;
158-
else
159-
return fhirContext.get();
160-
}
161-
else
162-
return entry;
163-
}
164-
165-
private FhirContext doGetFhirContext()
166-
{
167-
return getApplicationContext().getBean(FhirContext.class);
152+
return getOrSet(fhirContext, () -> getApplicationContext().getBean(FhirContext.class));
168153
}
169154

170155
private ObjectMapper getObjectMapper()
171156
{
172-
ObjectMapper entry = objectMapper.get();
173-
if (entry == null)
174-
{
175-
ObjectMapper o = doGetObjectMapper();
176-
if (objectMapper.compareAndSet(entry, o))
177-
return o;
178-
else
179-
return objectMapper.get();
180-
}
181-
else
182-
return entry;
183-
}
184-
185-
private ObjectMapper doGetObjectMapper()
186-
{
187-
try
157+
return getOrSet(objectMapper, () ->
188158
{
189159
ObjectMapper objectMapper = getApplicationContext().getBean(ObjectMapper.class).copy();
190160
objectMapper.setTypeFactory(TypeFactory.defaultInstance().withClassLoader(getProcessPluginClassLoader()));
191161

192162
return objectMapper;
193-
194-
}
195-
catch (BeansException e)
196-
{
197-
throw new RuntimeException(e);
198-
}
163+
});
199164
}
200165

201166
@Override

dsf-bpe/dsf-bpe-process-api-v2-impl/src/main/java/dev/dsf/bpe/v2/variables/ObjectMapperFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.hl7.fhir.r4.model.Resource;
44

5+
import com.fasterxml.jackson.annotation.JsonInclude;
56
import com.fasterxml.jackson.annotation.JsonInclude.Include;
67
import com.fasterxml.jackson.databind.MapperFeature;
78
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -18,7 +19,9 @@ private ObjectMapperFactory()
1819

1920
public static ObjectMapper createObjectMapper(FhirContext fhirContext)
2021
{
21-
return JsonMapper.builder().serializationInclusion(Include.NON_NULL).serializationInclusion(Include.NON_EMPTY)
22+
return JsonMapper.builder()
23+
.defaultPropertyInclusion(JsonInclude.Value.construct(Include.NON_NULL, Include.NON_NULL))
24+
.defaultPropertyInclusion(JsonInclude.Value.construct(Include.NON_EMPTY, Include.NON_EMPTY))
2225
.addModule(fhirModule(fhirContext)).disable(MapperFeature.AUTO_DETECT_CREATORS)
2326
.disable(MapperFeature.AUTO_DETECT_FIELDS).disable(MapperFeature.AUTO_DETECT_GETTERS)
2427
.disable(MapperFeature.AUTO_DETECT_IS_GETTERS).disable(MapperFeature.AUTO_DETECT_SETTERS).build();

dsf-bpe/dsf-bpe-process-api-v2/src/main/java/dev/dsf/bpe/v2/client/oidc/OidcClient.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ public interface OidcClient
2020
*/
2121
Jwks getJwks() throws OidcClientException;
2222

23-
/**
24-
* @param configuration
25-
* not <code>null</code>
26-
* @return {@link Jwks} resource
27-
* @throws OidcClientException
28-
* if response status not 200 OK
29-
*/
30-
Jwks getJwks(Configuration configuration) throws OidcClientException;
31-
3223
/**
3324
* @return access token
3425
*/

dsf-bpe/dsf-bpe-process-api/src/main/java/dev/dsf/bpe/api/client/oidc/OidcClient.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ public interface OidcClient
1515
* @throws OidcClientException
1616
* if response status not 200 OK
1717
*/
18-
Jwks getJwks() throws OidcClientException;
18+
default Jwks getJwks() throws OidcClientException
19+
{
20+
return getJwks(getConfiguration());
21+
}
1922

2023
/**
24+
* <i>Implementation may ignore the configuration parameter and use value from {@link #getConfiguration()}
25+
* instead.</i>
26+
*
2127
* @param configuration
22-
* not <code>null</code>
28+
* may be <code>null</code>, uses value from {@link #getConfiguration()} if <code>null</code>
2329
* @return {@link Jwks} resource
2430
* @throws OidcClientException
2531
* if response status not 200 OK

dsf-bpe/dsf-bpe-server/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
<groupId>dev.dsf</groupId>
4141
<artifactId>dsf-common-documentation</artifactId>
4242
</dependency>
43+
<dependency>
44+
<groupId>dev.dsf</groupId>
45+
<artifactId>dsf-common-oidc</artifactId>
46+
</dependency>
4347
<dependency>
4448
<groupId>dev.dsf</groupId>
4549
<artifactId>dsf-common-status</artifactId>

0 commit comments

Comments
 (0)