[java-identity-provider] 06/09: IDP-2106 Remove all API interfaces from the installer

Rod Widdowson rdw at steadingsoftware.com
Thu May 18 10:21:52 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=11b5d071b77909c7489234b7bc042f34d565454c

commit 11b5d071b77909c7489234b7bc042f34d565454c
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Wed May 17 14:00:40 2023 +0100

    IDP-2106 Remove all API interfaces from the installer
    
    https://shibboleth.atlassian.net/browse/IDP-2106
    
    Rename and move InstallerProperties
---
 .../java/net/shibboleth/idp/installer/BuildWar.java     |  3 ++-
 .../net/shibboleth/idp/installer/CopyDistribution.java  |  5 +++--
 .../java/net/shibboleth/idp/installer/V4Install.java    |  9 +++++----
 .../idp/installer/ant/impl/V4InstallTask.java           |  4 ++--
 .../idp/installer/impl/CurrentInstallState.java         |  3 +--
 .../net/shibboleth/idp/installer/impl/Installer.java    |  3 +--
 .../InstallerProperties.java}                           | 17 ++++++++---------
 .../test/java/net/shibboleth/idp/installer/Test.java    | 13 +++++++------
 8 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/BuildWar.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/BuildWar.java
index f2be3cd0c..8105375b5 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/BuildWar.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/BuildWar.java
@@ -31,6 +31,7 @@ import org.slf4j.Logger;
 import net.shibboleth.idp.Version;
 import net.shibboleth.idp.installer.impl.CurrentInstallState;
 import net.shibboleth.idp.installer.impl.InstallationLogger;
+import net.shibboleth.idp.installer.impl.InstallerProperties;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.component.UninitializedComponentException;
@@ -61,7 +62,7 @@ public final class BuildWar extends AbstractInitializableComponent {
      * @param props The environment for the work.
      * @param installState  Where we are right now.
      */
-    public BuildWar(@Nonnull final InstallerPropertiesImpl props, @Nonnull final CurrentInstallState installState) {
+    public BuildWar(@Nonnull final InstallerProperties props, @Nonnull final CurrentInstallState installState) {
         if (!props.isInitialized()) {
             throw new UninitializedComponentException("Installer Properties not initialized");
         }
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/CopyDistribution.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/CopyDistribution.java
index 6dd2d336b..fd688037f 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/CopyDistribution.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/CopyDistribution.java
@@ -28,6 +28,7 @@ import org.slf4j.Logger;
 
 import net.shibboleth.idp.installer.impl.CurrentInstallState;
 import net.shibboleth.idp.installer.impl.InstallationLogger;
+import net.shibboleth.idp.installer.impl.InstallerProperties;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
 import net.shibboleth.shared.component.UninitializedComponentException;
 import net.shibboleth.shared.logic.Constraint;
@@ -43,7 +44,7 @@ public final class CopyDistribution extends AbstractInitializableComponent {
     private final Logger log = InstallationLogger.getLogger(CopyDistribution.class);
 
     /** Properties for the job. */
-    @Nonnull private final InstallerPropertiesImpl installerProps;
+    @Nonnull private final InstallerProperties installerProps;
 
     /** The state of the current install. */
     @Nonnull private final CurrentInstallState installState;
@@ -52,7 +53,7 @@ public final class CopyDistribution extends AbstractInitializableComponent {
      * @param props The environment for the work.
      * @param state  Where we are right now.
      */
-    public CopyDistribution(@Nonnull final InstallerPropertiesImpl props, @Nonnull final CurrentInstallState state) {
+    public CopyDistribution(@Nonnull final InstallerProperties props, @Nonnull final CurrentInstallState state) {
         if (!props.isInitialized()) {
             throw new UninitializedComponentException("Installer Properties not Initialized");
         }
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java
index e7b53e04a..9261558e3 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java
@@ -49,6 +49,7 @@ import org.springframework.core.io.Resource;
 import net.shibboleth.idp.Version;
 import net.shibboleth.idp.installer.impl.CurrentInstallState;
 import net.shibboleth.idp.installer.impl.InstallationLogger;
+import net.shibboleth.idp.installer.impl.InstallerProperties;
 import net.shibboleth.idp.installer.plugin.impl.PluginState;
 import net.shibboleth.idp.module.IdPModule;
 import net.shibboleth.idp.module.ModuleContext;
@@ -75,7 +76,7 @@ public class V4Install extends AbstractInitializableComponent {
     private final Logger log = InstallationLogger.getLogger(V4Install.class);
 
     /** Installer Properties. */
-    @Nonnull private final InstallerPropertiesImpl installerProps;
+    @Nonnull private final InstallerProperties installerProps;
 
     /** Current Install. */
     @Nonnull private final CurrentInstallState currentState;
@@ -90,7 +91,7 @@ public class V4Install extends AbstractInitializableComponent {
      * @param props The properties to drive the installs.
      * @param installState The current install.
      */
-    public V4Install(@Nonnull final InstallerPropertiesImpl props, @Nonnull final CurrentInstallState installState) {
+    public V4Install(@Nonnull final InstallerProperties props, @Nonnull final CurrentInstallState installState) {
         if (!props.isInitialized()) {
             throw new UninitializedComponentException("Installer Properties not Initialized");
         }
@@ -533,7 +534,7 @@ public class V4Install extends AbstractInitializableComponent {
     private class KeyManagement extends AbstractInitializableComponent {
 
         /** Properties for the job. */
-        @Nonnull private final InstallerPropertiesImpl installerProps;
+        @Nonnull private final InstallerProperties installerProps;
 
         /** Current Install. */
         @Nonnull private final CurrentInstallState currentState;
@@ -554,7 +555,7 @@ public class V4Install extends AbstractInitializableComponent {
          * @param props The properties to drive the installs. 
          * @param installState - about where we installing into.
          */
-        protected KeyManagement(@Nonnull final InstallerPropertiesImpl props,
+        protected KeyManagement(@Nonnull final InstallerProperties props,
                 @Nonnull final CurrentInstallState installState) {
             if (!props.isInitialized()) {
                 throw new UninitializedComponentException("Installer Properties not Initialized");
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/impl/V4InstallTask.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/impl/V4InstallTask.java
index 4e64bdc44..542abb2cd 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/impl/V4InstallTask.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/impl/V4InstallTask.java
@@ -28,9 +28,9 @@ import org.slf4j.Logger;
 
 import net.shibboleth.idp.installer.BuildWar;
 import net.shibboleth.idp.installer.CopyDistribution;
-import net.shibboleth.idp.installer.InstallerPropertiesImpl;
 import net.shibboleth.idp.installer.V4Install;
 import net.shibboleth.idp.installer.impl.CurrentInstallState;
+import net.shibboleth.idp.installer.impl.InstallerProperties;
 import net.shibboleth.idp.installer.metadata.impl.MetadataGeneratorImpl;
 import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
@@ -67,7 +67,7 @@ public class V4InstallTask extends Task {
             throw new BuildException("Invalid parameter to task");
         }
         try {
-            final InstallerPropertiesImpl ip = new InstallerPropertiesImpl(!copyInstall);
+            final InstallerProperties ip = new InstallerProperties(!copyInstall);
 
             // Grab the ant properties and plug in.  Note Java V2 to V11 conversion.
             ip.setInheritedProperties(
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java
index bf649224b..cd1a0f6b1 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/CurrentInstallState.java
@@ -47,7 +47,6 @@ import javax.annotation.Nullable;
 import org.apache.tools.ant.BuildException;
 import org.slf4j.Logger;
 
-import net.shibboleth.idp.installer.InstallerPropertiesImpl;
 import net.shibboleth.idp.installer.InstallerSupport;
 import net.shibboleth.idp.module.IdPModule;
 import net.shibboleth.idp.module.ModuleContext;
@@ -97,7 +96,7 @@ public final class CurrentInstallState extends AbstractInitializableComponent {
     /** Constructor.
      * @param installerProps the installer situation.
      */
-    public CurrentInstallState(final InstallerPropertiesImpl installerProps) {
+    public CurrentInstallState(final InstallerProperties installerProps) {
         targetDir = installerProps.getTargetDir();
         enabledModules = CollectionSupport.emptySet();
     }
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/Installer.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/Installer.java
index 20b7818c2..bb055d5eb 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/Installer.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/Installer.java
@@ -21,7 +21,6 @@ import org.slf4j.Logger;
 
 import net.shibboleth.idp.installer.BuildWar;
 import net.shibboleth.idp.installer.CopyDistribution;
-import net.shibboleth.idp.installer.InstallerPropertiesImpl;
 import net.shibboleth.idp.installer.V4Install;
 import net.shibboleth.shared.component.ComponentInitializationException;
 
@@ -54,7 +53,7 @@ public final class Installer {
             log.error("Parameter must be \"install\", \"install-nocopy\" or \"build-war\" was \"{}\"", args[0]);
             return;
         }
-        final InstallerPropertiesImpl ip = new InstallerPropertiesImpl(!copyInstall);
+        final InstallerProperties ip = new InstallerProperties(!copyInstall);
         ip.initialize();
         final CurrentInstallState is = new CurrentInstallState(ip);
         is.initialize();
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/InstallerPropertiesImpl.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/InstallerProperties.java
similarity index 98%
rename from idp-installer/src/main/java/net/shibboleth/idp/installer/InstallerPropertiesImpl.java
rename to idp-installer/src/main/java/net/shibboleth/idp/installer/impl/InstallerProperties.java
index d255b80bd..a5202bf3f 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/InstallerPropertiesImpl.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/InstallerProperties.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package net.shibboleth.idp.installer;
+package net.shibboleth.idp.installer.impl;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -43,7 +43,6 @@ import org.apache.tools.ant.launch.Launcher;
 import org.slf4j.Logger;
 
 import net.shibboleth.idp.installer.ant.impl.PasswordHandler;
-import net.shibboleth.idp.installer.impl.InstallationLogger;
 import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.annotation.constraint.NotLive;
 import net.shibboleth.shared.annotation.constraint.Unmodifiable;
@@ -58,7 +57,7 @@ import net.shibboleth.shared.primitive.StringSupport;
  NOTE Updated to this properties should be reflected in the "PropertyDriverInstallation" wiki page."/
 
 */
-public class InstallerPropertiesImpl extends AbstractInitializableComponent {
+public class InstallerProperties extends AbstractInitializableComponent {
 
     /** The base directory, inherited and shared with ant. */
     public static final String ANT_BASE_DIR = Launcher.ANTHOME_PROPERTY;
@@ -125,7 +124,7 @@ public class InstallerPropertiesImpl extends AbstractInitializableComponent {
     public static final int DEFAULT_KEY_SIZE = 3072;
 
     /** Class logger. */
-    @Nonnull private final Logger log = InstallationLogger.getLogger(InstallerPropertiesImpl.class);
+    @Nonnull private final Logger log = InstallationLogger.getLogger(InstallerProperties.class);
 
     /** The base directory. */
     @NonnullAfterInit private Path baseDir;
@@ -192,7 +191,7 @@ public class InstallerPropertiesImpl extends AbstractInitializableComponent {
      * Constructor.
      * @param copiedDistribution Has the distribution been copied? If no we don't need the source dir.
      */
-    public InstallerPropertiesImpl(final boolean copiedDistribution) {
+    public InstallerProperties(final boolean copiedDistribution) {
         needSourceDir = !copiedDistribution;
         inputHandler = getInputHandler();
         inheritedProperties = CollectionSupport.emptyMap();
@@ -567,7 +566,7 @@ public class InstallerPropertiesImpl extends AbstractInitializableComponent {
     @Nonnull  @NotLive @Unmodifiable public Set<String> getModulesToEnable() {
         String prop = StringSupport.trimOrNull(installerProperties.getProperty(INITIAL_INSTALL_MODULES));
         if (prop == null) {
-            return InstallerPropertiesImpl.DEFAULT_MODULES;
+            return InstallerProperties.DEFAULT_MODULES;
         }
         final boolean additive = prop.startsWith("+");
         if (additive) {
@@ -579,8 +578,8 @@ public class InstallerPropertiesImpl extends AbstractInitializableComponent {
             final Set<String> result = CollectionSupport.copyToSet(CollectionSupport.arrayAsList(modules));
             return result;
         }
-        final Set<String> result = new HashSet<>(modules.length + InstallerPropertiesImpl.DEFAULT_MODULES.size());
-        result.addAll(InstallerPropertiesImpl.DEFAULT_MODULES);
+        final Set<String> result = new HashSet<>(modules.length + InstallerProperties.DEFAULT_MODULES.size());
+        result.addAll(InstallerProperties.DEFAULT_MODULES);
         result.addAll(Arrays.asList(modules));
         return CollectionSupport.copyToSet(result);
     }
@@ -589,7 +588,7 @@ public class InstallerPropertiesImpl extends AbstractInitializableComponent {
      * @return the modules
      */
     @Nonnull  @NotLive @Unmodifiable public Set<String> getCoreModules() {
-        return InstallerPropertiesImpl.CORE_MODULES;
+        return InstallerProperties.CORE_MODULES;
     }
 
 
diff --git a/idp-installer/src/test/java/net/shibboleth/idp/installer/Test.java b/idp-installer/src/test/java/net/shibboleth/idp/installer/Test.java
index 8b76314d6..a4991a1ab 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/installer/Test.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/installer/Test.java
@@ -20,6 +20,7 @@ package net.shibboleth.idp.installer;
 import java.io.IOException;
 
 import net.shibboleth.idp.installer.impl.CurrentInstallState;
+import net.shibboleth.idp.installer.impl.InstallerProperties;
 import net.shibboleth.idp.installer.metadata.impl.MetadataGeneratorImpl;
 import net.shibboleth.shared.component.ComponentInitializationException;
 /**
@@ -36,15 +37,15 @@ public class Test {
     public static void main(String[] args) throws IOException, ComponentInitializationException {
 
         //System.setProperty(InstallerPropertiesImpl.TARGET_DIR,"H:\\Downloads\\idp");
-        System.setProperty(InstallerPropertiesImpl.SOURCE_DIR,
+        System.setProperty(InstallerProperties.SOURCE_DIR,
                 "h:\\Perforce\\Juno\\V5\\java-identity-provider\\idp-distribution\\target\\shibboleth-identity-provider-5.0.0-SNAPSHOT");
-        System.setProperty(InstallerPropertiesImpl.ANT_BASE_DIR,
+        System.setProperty(InstallerProperties.ANT_BASE_DIR,
                 "h:\\Perforce\\Juno\\V5\\java-identity-provider\\idp-distribution\\target\\shibboleth-identity-provider-5.0.0-SNAPSHOT\\bin");
-        System.setProperty(InstallerPropertiesImpl.KEY_STORE_PASSWORD, "p1");
-        System.setProperty(InstallerPropertiesImpl.SEALER_PASSWORD, "p1");
-        System.setProperty(InstallerPropertiesImpl.HOST_NAME, "machine.org.uk");
+        System.setProperty(InstallerProperties.KEY_STORE_PASSWORD, "p1");
+        System.setProperty(InstallerProperties.SEALER_PASSWORD, "p1");
+        System.setProperty(InstallerProperties.HOST_NAME, "machine.org.uk");
 
-        final InstallerPropertiesImpl ip = new InstallerPropertiesImpl(false);
+        final InstallerProperties ip = new InstallerProperties(false);
         ip.initialize();
         final CurrentInstallState is = new CurrentInstallState(ip);
         is.initialize();

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


More information about the commits mailing list