From 695b0b596ec08d1f97906eeee2bb82a794db3a4d Mon Sep 17 00:00:00 2001 From: Rui Jesus Date: Mon, 20 Jun 2022 14:39:06 +0100 Subject: [PATCH] Added ImageWorkerInterface to PlatformInterface --- .../dicoogle/plugins/DicooglePlatformProxy.java | 11 +++++++++++ .../core/plugins/PlatformInterfaceMock.java | 11 +++++++++++ .../sdk/core/DicooglePlatformInterface.java | 16 ++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/dicoogle/src/main/java/pt/ua/dicoogle/plugins/DicooglePlatformProxy.java b/dicoogle/src/main/java/pt/ua/dicoogle/plugins/DicooglePlatformProxy.java index 6878fa77b..255edd047 100644 --- a/dicoogle/src/main/java/pt/ua/dicoogle/plugins/DicooglePlatformProxy.java +++ b/dicoogle/src/main/java/pt/ua/dicoogle/plugins/DicooglePlatformProxy.java @@ -32,6 +32,7 @@ import pt.ua.dicoogle.sdk.datastructs.Report; import pt.ua.dicoogle.sdk.datastructs.SearchResult; import pt.ua.dicoogle.sdk.datastructs.dim.DimLevel; +import pt.ua.dicoogle.sdk.imageworker.ImageWorkerInterface; import pt.ua.dicoogle.sdk.settings.server.ServerSettingsReader; import pt.ua.dicoogle.sdk.task.JointQueryTask; import pt.ua.dicoogle.sdk.task.Task; @@ -162,6 +163,16 @@ public List indexBlocking(URI path) { return pluginController.indexBlocking(path); } + @Override + public ImageWorkerInterface getImageWorkerByName(String name, boolean onlyEnabled) { + return pluginController.getImageWorkerInterfaceByName(name, onlyEnabled); + } + + @Override + public Collection getImageWorkers(boolean onlyEnabled) { + return pluginController.getImageWorkerPlugins(onlyEnabled); + } + @Override public ServerSettingsReader getSettings() { return ServerSettingsManager.getSettings(); diff --git a/dicoogle/src/test/java/pt/ua/dicoogle/core/plugins/PlatformInterfaceMock.java b/dicoogle/src/test/java/pt/ua/dicoogle/core/plugins/PlatformInterfaceMock.java index 5b2974dcf..efd0a9480 100644 --- a/dicoogle/src/test/java/pt/ua/dicoogle/core/plugins/PlatformInterfaceMock.java +++ b/dicoogle/src/test/java/pt/ua/dicoogle/core/plugins/PlatformInterfaceMock.java @@ -26,6 +26,7 @@ import pt.ua.dicoogle.sdk.datastructs.Report; import pt.ua.dicoogle.sdk.datastructs.SearchResult; import pt.ua.dicoogle.sdk.datastructs.dim.DimLevel; +import pt.ua.dicoogle.sdk.imageworker.ImageWorkerInterface; import pt.ua.dicoogle.sdk.settings.server.ServerSettingsReader; import pt.ua.dicoogle.sdk.task.JointQueryTask; import pt.ua.dicoogle.sdk.task.Task; @@ -125,6 +126,16 @@ public List indexBlocking(URI path) { return null; } + @Override + public ImageWorkerInterface getImageWorkerByName(String name, boolean onlyEnabled) { + return null; + } + + @Override + public Collection getImageWorkers(boolean onlyEnabled) { + return null; + } + @Override public ServerSettingsReader getSettings() { return null; diff --git a/sdk/src/main/java/pt/ua/dicoogle/sdk/core/DicooglePlatformInterface.java b/sdk/src/main/java/pt/ua/dicoogle/sdk/core/DicooglePlatformInterface.java index ac3fac299..a253e74d4 100644 --- a/sdk/src/main/java/pt/ua/dicoogle/sdk/core/DicooglePlatformInterface.java +++ b/sdk/src/main/java/pt/ua/dicoogle/sdk/core/DicooglePlatformInterface.java @@ -29,6 +29,7 @@ import pt.ua.dicoogle.sdk.datastructs.Report; import pt.ua.dicoogle.sdk.datastructs.SearchResult; import pt.ua.dicoogle.sdk.datastructs.dim.DimLevel; +import pt.ua.dicoogle.sdk.imageworker.ImageWorkerInterface; import pt.ua.dicoogle.sdk.settings.server.ServerSettingsReader; import pt.ua.dicoogle.sdk.task.JointQueryTask; import pt.ua.dicoogle.sdk.task.Task; @@ -213,6 +214,21 @@ public JointQueryTask query(JointQueryTask holder, List querySources, Di */ public List indexBlocking(URI path); + /** Gets the image worker with the given name. + * + * @param name the unique name of the worker + * @param onlyEnabled whether only enabled plugins should be retrieved (all are retrieved if {@code false}) + * @return the image worker with the given name or null if it doesn't exist + */ + public ImageWorkerInterface getImageWorkerByName(String name, boolean onlyEnabled); + + /** Gets all the image workers available. + * + * @param onlyEnabled whether only enabled plugins should be retrieved (all are retrieved if {@code false}) + * @return a collection with all image workers available + */ + public Collection getImageWorkers(boolean onlyEnabled); + /** Obtain access to the server's settings. * @return an object for read-only access to the settings */