[java-identity-provider] branch main updated: IDP-2110 List plugins ordered by version

Rod Widdowson rdw at steadingsoftware.com
Fri May 19 13:21:37 UTC 2023


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=d37cd26b4752c9e7590e204d6a48aedd194386c7

The following commit(s) were added to refs/heads/main by this push:
     new d37cd26b4 IDP-2110 List plugins ordered by version
d37cd26b4 is described below

commit d37cd26b4752c9e7590e204d6a48aedd194386c7
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Fri May 19 14:21:04 2023 +0100

    IDP-2110 List plugins ordered by version
    
    https://shibboleth.atlassian.net/browse/IDP-2110
---
 .../installer/plugin/impl/PluginInstallerCLI.java   | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java
index 304e148c5..617db4586 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java
@@ -26,6 +26,8 @@ import java.net.URL;
 import java.nio.file.Path;
 import java.security.Security;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.List;
@@ -268,21 +270,24 @@ public final class PluginInstallerCLI extends AbstractIdPHomeAwareCommandLine<Pl
             log.error("Could not interrogate plugin {}", plugin.getPluginId(), e);
             return;
         }
-        final Map<PluginVersion, VersionInfo> versions = state.getPluginInfo().getAvailableVersions();
+        final Map<PluginVersion, VersionInfo> versionMap = state.getPluginInfo().getAvailableVersions();
+        final List<PluginVersion> versionList = new ArrayList<>(versionMap.keySet());
+        versionList.sort(null);
         outOrLog("\tVersions ");
-        for (final Entry<PluginVersion, VersionInfo> entry  : versions.entrySet()) {
+        for (final PluginVersion version:versionList) {
             final String downLoadDetails;
-            if (state.getPluginInfo().getUpdateBaseName(entry.getKey()) == null ||
-                state.getPluginInfo().getUpdateURL(entry.getKey())==null ) {
+            if (state.getPluginInfo().getUpdateBaseName(version) == null ||
+                state.getPluginInfo().getUpdateURL(version)==null ) {
                 downLoadDetails = " - No download available";
             } else {
                 downLoadDetails = "";
             }
+            final VersionInfo info = versionMap.get(version);
             outOrLog(String.format("\t%s:\tMin=%s\tMax=%s\tSupport level: %s%s",
-                    entry.getKey(),
-                    entry.getValue().getMinSupported(),
-                    entry.getValue().getMaxSupported(),
-                    entry.getValue().getSupportLevel(),
+                    version,
+                    info.getMinSupported(),
+                    info.getMaxSupported(),
+                    info.getSupportLevel(),
                     downLoadDetails));
         }
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list