[java-identity-provider] 01/09: IDP-2103 Redo installer to accomodate new layout
Rod Widdowson
rdw at steadingsoftware.com
Thu May 18 10:21:47 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=642fa59fe24db9dc2b52ba91c7ec95dafaefb9b4
commit 642fa59fe24db9dc2b52ba91c7ec95dafaefb9b4
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue May 16 15:46:58 2023 +0100
IDP-2103 Redo installer to accomodate new layout
https://shibboleth.atlassian.net/browse/IDP-2103
More tidy - mostly arround annotations
---
.../idp/installer/InstallerProperties.java | 8 ++++++--
.../idp/installer/InstallerPropertiesImpl.java | 20 +++++++-------------
2 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/InstallerProperties.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/InstallerProperties.java
index 9b724609b..e459a0396 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/InstallerProperties.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/InstallerProperties.java
@@ -25,6 +25,8 @@ import javax.annotation.Nullable;
import org.apache.tools.ant.BuildException;
+import net.shibboleth.shared.annotation.constraint.NotLive;
+import net.shibboleth.shared.annotation.constraint.Unmodifiable;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.InitializableComponent;
@@ -135,25 +137,27 @@ public interface InstallerProperties extends InitializableComponent {
* @return the path or null if non specified.
* @throws BuildException if badness happens
*/
+ @Deprecated
@Nullable public Path getConfPreOverlay() throws BuildException;
/** Get a path to use to do the initial edit-webapp populate.
* @return the path or null if non specified.
* @throws BuildException if badness happens
*/
+ @Deprecated
@Nullable public Path getInitialEditWeb() throws BuildException;
/** Get the modules to enable after first install.
* @return the modules
*/
- @Nonnull public default Set<String> getModulesToEnable() {
+ @Nonnull @NotLive @Unmodifiable public default Set<String> getModulesToEnable() {
return DEFAULT_MODULES;
}
/** Get the modules to enable before ant install.
* @return the modules
*/
- @Nonnull public default Set<String> getCoreModules() {
+ @Nonnull @NotLive @Unmodifiable public default Set<String> getCoreModules() {
return CORE_MODULES;
}
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/InstallerPropertiesImpl.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/InstallerPropertiesImpl.java
index f41b10550..6c6480365 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/InstallerPropertiesImpl.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/InstallerPropertiesImpl.java
@@ -45,6 +45,8 @@ 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;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.AbstractInitializableComponent;
import net.shibboleth.shared.component.ComponentInitializationException;
@@ -536,7 +538,7 @@ public class InstallerPropertiesImpl extends AbstractInitializableComponent impl
}
/** {@inheritDoc} */
- @Override @Nonnull public Set<String> getModulesToEnable() {
+ @Override @Nonnull @NotLive @Unmodifiable public Set<String> getModulesToEnable() {
String prop = StringSupport.trimOrNull(installerProperties.getProperty(INITIAL_INSTALL_MODULES));
if (prop == null) {
return InstallerProperties.DEFAULT_MODULES;
@@ -546,15 +548,15 @@ public class InstallerPropertiesImpl extends AbstractInitializableComponent impl
prop = prop.substring(1);
}
final String[] modules = prop.split(",");
+ assert modules != null;
if (!additive) {
- final Set<String> result = Set.copyOf(Arrays.asList(modules));
- assert result != null;
+ final Set<String> result = CollectionSupport.copyToSet(CollectionSupport.arrayAsList(modules));
return result;
}
final Set<String> result = new HashSet<>(modules.length + InstallerProperties.DEFAULT_MODULES.size());
result.addAll(InstallerProperties.DEFAULT_MODULES);
result.addAll(Arrays.asList(modules));
- return result;
+ return CollectionSupport.copyToSet(result);
}
/** {@inheritDoc}. */
@@ -574,15 +576,6 @@ public class InstallerPropertiesImpl extends AbstractInitializableComponent impl
return keySize;
}
- /** Get the directory specified as the property as a File, or null if it doesn't exist.
- * @param propName the name to lookup;
- * @return null if the property is not provided a {@link File} otherwise
- * @throws BuildException if the property is supplied but the file doesn't exist.
- */
- protected Path getMergeDir(final String propName) throws BuildException {
- return getMergePath(propName, true);
- }
-
/** Get the file specified as the property as a File, or null if it doesn't exist.
* @param propName the name to lookup;
* @return null if the property is not provided a {@link File} otherwise
@@ -637,6 +630,7 @@ public class InstallerPropertiesImpl extends AbstractInitializableComponent impl
}
/** {@inheritDoc}. */
+ @Deprecated
@Override public Path getConfPreOverlay() throws BuildException {
return getMergeFile(CONF_PRE_OVERLAY);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list