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
12 changes: 12 additions & 0 deletions dsf-bpe/dsf-bpe-process-api-v1-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,16 @@
</plugin>
</plugins>
</build>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ protected ProcessPlugin createProcessPlugin(Object processPluginDefinition, bool
}

@Override
@SuppressWarnings("rawtypes")
public Stream<TypedValueSerializer> getSerializer()
public Stream<TypedValueSerializer<?>> getSerializer()
{
return apiApplicationContext.getBeansOfType(TypedValueSerializer.class).values().stream();
return apiApplicationContext.getBeansOfType(TypedValueSerializer.class).values().stream()
.map(s -> (TypedValueSerializer<?>) s);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,24 @@ else if (nTimes != RetryClient.RETRY_FOREVER)
{
if (tryNumber < nTimes || nTimes == RetryClient.RETRY_FOREVER)
{
logger.warn("Caught {} - {}; trying again in {}s{}", e.getClass(), e.getMessage(), delay,
nTimes == RetryClient.RETRY_FOREVER ? " (retry " + (tryNumber + 1) + ")" : "");
logger.warn("Caught {} - {}; trying again in {}s{}", e.getClass().getName(), e.getMessage(),
delay, nTimes == RetryClient.RETRY_FOREVER ? " (retry " + (tryNumber + 1) + ")" : "");

try
{
Thread.sleep(delay);
}
catch (InterruptedException e1)
{
logger.warn("Thread interrupted; not trying again");
Thread.currentThread().interrupt();
e.addSuppressed(e1);
throw e;
}
}
else
{
logger.warn("Caught {} - {}; not trying again", e.getClass(), e.getMessage());
logger.warn("Caught {} - {}; not trying again", e.getClass().getName(), e.getMessage());
}

if (caughtException != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ else if (nTimes != RetryClient.RETRY_FOREVER)
if (tryNumber > 0)
delay = delayStrategy.getNextDelay(delay);

logger.warn("Caught {} - {}; trying again in {}{}", e.getClass(), e.getMessage(),
logger.warn("Caught {} - {}; trying again in {}{}", e.getClass().getName(), e.getMessage(),
delay.toString(),
nTimes == RetryClient.RETRY_FOREVER ? " (retry " + (tryNumber + 1) + ")" : "");

Expand All @@ -78,11 +78,15 @@ else if (nTimes != RetryClient.RETRY_FOREVER)
}
catch (InterruptedException e1)
{
logger.warn("Thread interrupted; not trying again");
Thread.currentThread().interrupt();
e.addSuppressed(e1);
throw e;
}
}
else
{
logger.warn("Caught {} - {}; not trying again", e.getClass(), e.getMessage());
logger.warn("Caught {} - {}; not trying again", e.getClass().getName(), e.getMessage());
}

if (caughtException != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ protected ProcessPlugin createProcessPlugin(Object processPluginDefinition, bool
}

@Override
@SuppressWarnings("rawtypes")
public Stream<TypedValueSerializer> getSerializer()
public Stream<TypedValueSerializer<?>> getSerializer()
{
return apiApplicationContext.getBeansOfType(TypedValueSerializer.class).values().stream();
return apiApplicationContext.getBeansOfType(TypedValueSerializer.class).values().stream()
.map(s -> (TypedValueSerializer<?>) s);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public interface ProcessPluginFactory
{
int getApiVersion();

@SuppressWarnings("rawtypes")
Stream<TypedValueSerializer> getSerializer();
Stream<TypedValueSerializer<?>> getSerializer();

ListenerFactory getListenerFactory();

Expand Down
4 changes: 2 additions & 2 deletions dsf-bpe/dsf-bpe-server-jetty/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

FROM debian:trixie-slim@sha256:1d3c811171a08a5adaa4a163fbafd96b61b87aa871bbc7aa15431ac275d3d430 AS builder
FROM debian:trixie-slim@sha256:4ffb3a1511099754cddc70eb1b12e50ffdb67619aa0ab6c13fcd800a78ef7c7a AS builder
WORKDIR /opt/bpe
COPY --chown=root:2202 ./ ./
RUN chown root:2202 ./ && \
Expand All @@ -23,7 +23,7 @@ RUN chown root:2202 ./ && \
chmod 1775 ./log


FROM azul/zulu-openjdk:25-jre-headless@sha256:c8e35e74e2cfbdeffb4e4850123c41378d3ec0a6d80f17d2f9f3a9293f9236e6
FROM azul/zulu-openjdk:25-jre-headless@sha256:205a88e67ff7acca2c4452c60fd078a95f6e5a7c9a3bc8bad83dbd3a140c58f4
LABEL org.opencontainers.image.source=https://github.com/datasharingframework/dsf
LABEL org.opencontainers.image.description="DSF BPE Server"
LABEL org.opencontainers.image.licenses="Apache License, Version 2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ else if (nTimes != RetryClient.RETRY_FOREVER)
{
if (tryNumber < nTimes || nTimes == RetryClient.RETRY_FOREVER)
{
logger.warn("Caught {} - {}; trying again in {}s{}", e.getClass(), e.getMessage(),
logger.warn("Caught {} - {}; trying again in {}s{}", e.getClass().getName(), e.getMessage(),
delay.toSeconds(),
nTimes == RetryClient.RETRY_FOREVER ? " (retry " + (tryNumber + 1) + ")" : "");

Expand All @@ -73,11 +73,15 @@ else if (nTimes != RetryClient.RETRY_FOREVER)
}
catch (InterruptedException e1)
{
logger.warn("Thread interrupted; not trying again");
Thread.currentThread().interrupt();
e.addSuppressed(e1);
throw e;
}
}
else
{
logger.warn("Caught {} - {}; not trying again", e.getClass(), e.getMessage());
logger.warn("Caught {} - {}; not trying again", e.getClass().getName(), e.getMessage());
}

if (caughtException != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected Class<?> loadClass(String className, boolean resolve) throws ClassNotF
if (isBpeClassAllowed(bpeClass))
return bpeClass;

logger.debug("Class " + className + " not found or hidden");
logger.debug("Class {} not found or hidden", className);
throw new ClassNotFoundException(className);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private void testConnection(FhirClientConfig config)
}
catch (OidcClientException e)
{
logger.debug("Testing connection with OIDC provider at {} for '{}' [Failed] -> {}",
logger.debug("Testing connection with OIDC provider at {} for '{}' [Failed]",
config.oidcAuthentication().baseUrl(), config.fhirServerId(), e);
logger.warn("Testing connection with OIDC provider at {} for '{}' [Failed] -> {}",
config.oidcAuthentication().baseUrl(), config.fhirServerId(), e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ private Subscription retry(Supplier<Subscription> supplier)
}
catch (InterruptedException e1)
{
logger.warn("Thread interrupted; not trying again");
Thread.currentThread().interrupt();
e.addSuppressed(e1);
throw e;
}
}

Expand Down Expand Up @@ -184,6 +188,10 @@ private Subscription retryForever(Supplier<Subscription> supplier)
}
catch (InterruptedException e1)
{
logger.warn("Thread interrupted; not trying again");
Thread.currentThread().interrupt();
e.addSuppressed(e1);
throw e;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ else if ("identifiers".equals(type))
expectNotNull(idExts);
expectSame(3, idExts.size());

idExts.stream().filter(Extension::hasValue).filter(e -> e.getValue() instanceof Identifier)
expectTrue(idExts.stream().filter(Extension::hasValue).filter(e -> e.getValue() instanceof Identifier)
.map(e -> (Identifier) e.getValue()).map(Identifier::getSystem)
.allMatch(NamingSystems.PractitionerIdentifier.SID::equals);
.allMatch(NamingSystems.PractitionerIdentifier.SID::equals));

List<String> values = idExts.stream().filter(Extension::hasValue)
.filter(e -> e.getValue() instanceof Identifier).map(e -> (Identifier) e.getValue())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.io.ByteArrayOutputStream;
import java.net.ConnectException;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Arrays;
Expand Down Expand Up @@ -134,8 +135,8 @@ public void migrate()
logger.warn("Unlocking DB for migration ...");
unlockCommand.execute();

Arrays.stream(output.toString().split("[\r\n]+")).filter(row -> !row.isBlank())
.forEach(row -> logger.debug("{}", row));
Arrays.stream(output.toString(StandardCharsets.UTF_8).split("[\r\n]+"))
.filter(row -> !row.isBlank()).forEach(row -> logger.debug("{}", row));
logger.warn("Unlocking DB for migration [Done]");
}

Expand All @@ -156,8 +157,8 @@ public void migrate()
logger.info("Executing DB migration ...");
updateCommand.execute();

Arrays.stream(output.toString().split("[\r\n]+")).filter(row -> !row.isBlank())
.forEach(row -> logger.debug("{}", row));
Arrays.stream(output.toString(StandardCharsets.UTF_8).split("[\r\n]+"))
.filter(row -> !row.isBlank()).forEach(row -> logger.debug("{}", row));
logger.info("Executing DB migration [Done]");
}
}
Expand Down Expand Up @@ -214,6 +215,10 @@ public static void retryOnConnectException(int times, Runnable run)
}
catch (InterruptedException e1)
{
logger.warn("Thread interrupted; not trying again");
Thread.currentThread().interrupt();
e.addSuppressed(e1);
throw e;
}
retryOnConnectException(--times, run);
}
Expand All @@ -226,19 +231,28 @@ else if (cause instanceof UnknownHostException && times > 1)
}
catch (InterruptedException e1)
{
logger.warn("Thread interrupted; not trying again");
Thread.currentThread().interrupt();
e.addSuppressed(e1);
throw e;
}
retryOnConnectException(--times, run);
}
else if (cause instanceof PSQLException p
else if (cause instanceof PSQLException p && p.getServerErrorMessage() != null
&& POSTGRES_TRY_AGAIN_ERROR_MESSAGES.contains(p.getServerErrorMessage().getMessage()) && times > 1)
{
logger.warn("PSQLException ({}): trying again in 5s", p.getServerErrorMessage().getMessage());
logger.warn("PSQLException ({}): trying again in 5s",
p.getServerErrorMessage() != null ? p.getServerErrorMessage().getMessage() : "?");
try
{
Thread.sleep(5_000);
}
catch (InterruptedException e1)
{
logger.warn("Thread interrupted; not trying again");
Thread.currentThread().interrupt();
e.addSuppressed(e1);
throw e;
}
retryOnConnectException(--times, run);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public ContentResponse GETWithRetryOnConnectException(int times, URI uri)
}
catch (InterruptedException e1)
{
logger.warn("Thread interrupted; not trying again");
Thread.currentThread().interrupt();
e.addSuppressed(e1);
throw e;
}

return GETWithRetryOnConnectException(--times, uri);
Expand All @@ -90,6 +94,10 @@ else if (cause instanceof UnknownHostException && times > 1)
}
catch (InterruptedException e1)
{
logger.warn("Thread interrupted; not trying again");
Thread.currentThread().interrupt();
e.addSuppressed(e1);
throw e;
}

return GETWithRetryOnConnectException(--times, uri);
Expand Down
4 changes: 2 additions & 2 deletions dsf-fhir/dsf-fhir-server-jetty/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

FROM debian:trixie-slim@sha256:1d3c811171a08a5adaa4a163fbafd96b61b87aa871bbc7aa15431ac275d3d430 AS builder
FROM debian:trixie-slim@sha256:4ffb3a1511099754cddc70eb1b12e50ffdb67619aa0ab6c13fcd800a78ef7c7a AS builder
WORKDIR /opt/fhir
COPY --chown=root:2101 ./ ./
RUN chown root:2101 ./ && \
Expand All @@ -23,7 +23,7 @@ RUN chown root:2101 ./ && \
chmod 1775 ./log


FROM azul/zulu-openjdk:25-jre-headless@sha256:c8e35e74e2cfbdeffb4e4850123c41378d3ec0a6d80f17d2f9f3a9293f9236e6
FROM azul/zulu-openjdk:25-jre-headless@sha256:205a88e67ff7acca2c4452c60fd078a95f6e5a7c9a3bc8bad83dbd3a140c58f4
LABEL org.opencontainers.image.source=https://github.com/datasharingframework/dsf
LABEL org.opencontainers.image.description="DSF FHIR Server"
LABEL org.opencontainers.image.licenses="Apache License, Version 2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private String toDataSize(Binary resource)
unitIndex++;
}

if (value == (long) value)
if (Math.abs(value - (long) value) < .0000001)
return String.format("%d %s", (long) value, UNITS[unitIndex]);
else
return String.format("%.2f %s", value, UNITS[unitIndex]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private String toDataSize(Binary resource)
unitIndex++;
}

if (value == (long) value)
if (Math.abs(value - (long) value) < .0000001)
return String.format("%d %s", (long) value, UNITS[unitIndex]);
else
return String.format("%.2f %s", value, UNITS[unitIndex]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ public void stopLargeObjectUnlinker()
catch (InterruptedException ex)
{
loUnlinker.shutdownNow();
Thread.currentThread().interrupt();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public SnapshotWithValidationMessages generateSnapshot(StructureDefinition diffe
String baseAbsoluteUrlPrefix)
{
if (differential == null)
return new SnapshotWithValidationMessages(differential, List.of(new ValidationMessage(null,
IssueType.PROCESSING, null, "StructureDefinition is null", IssueSeverity.ERROR)));
return new SnapshotWithValidationMessages(null, List.of(new ValidationMessage(null, IssueType.PROCESSING,
null, "StructureDefinition is null", IssueSeverity.ERROR)));
if (!differential.hasBaseDefinition())
return new SnapshotWithValidationMessages(differential, List.of(new ValidationMessage(null,
IssueType.PROCESSING, null, "StructureDefinition.baseDefinition missing", IssueSeverity.ERROR)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ private StructureDefinition doReadXml(Path xmlPath)
{
try (InputStream in = Files.newInputStream(xmlPath))
{
if (in == null)
logger.warn("File {} not found", xmlPath);

return context.newXmlParser().parseResource(StructureDefinition.class, in);
}
catch (DataFormatException | IOException e)
Expand All @@ -127,9 +124,6 @@ private StructureDefinition doReadXmlAndReplaceVersion(Path xmlPath, String vers
{
try (InputStream in = Files.newInputStream(xmlPath))
{
if (in == null)
logger.warn("File {} not found", xmlPath);

String read = IOUtils.toString(in, StandardCharsets.UTF_8);
read = replaceVersionAndDate(read, version, date);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private void warnForDeprecatedResources(String resource, List<String> file)
}
catch (IOException e)
{
logger.warn("FHIR resource " + f + " is deprecated, unable to read replacement message: {}",
logger.warn("FHIR resource {} is deprecated, unable to read replacement message: {}", f,
e.getMessage());
}
});
Expand Down
Loading
Loading