[java-identity-provider] branch main updated: IDP-2121 Future Proofing the Module Plugin infrastructure for Future SP use
Rod Widdowson
rdw at steadingsoftware.com
Thu Jun 8 13:39:19 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=fc7bb261e1e64e3d15a552b78be3cf5f3995bbf7
The following commit(s) were added to refs/heads/main by this push:
new fc7bb261e IDP-2121 Future Proofing the Module Plugin infrastructure for Future SP use
fc7bb261e is described below
commit fc7bb261e1e64e3d15a552b78be3cf5f3995bbf7
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Jun 8 14:36:17 2023 +0100
IDP-2121 Future Proofing the Module Plugin infrastructure for Future SP use
https://shibboleth.atlassian.net/browse/IDP-2121
Having introduced a new Interface and base class
the IdP now uses them.
---
.../shibboleth/idp/plugin/AbstractIdPPlugin.java | 97 +---------------------
.../java/net/shibboleth/idp/plugin/IdPPlugin.java | 86 +------------------
2 files changed, 6 insertions(+), 177 deletions(-)
diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/AbstractIdPPlugin.java b/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/AbstractIdPPlugin.java
index 676d9cc64..e2825bb8c 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/AbstractIdPPlugin.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/AbstractIdPPlugin.java
@@ -17,104 +17,13 @@
package net.shibboleth.idp.plugin;
-import java.util.Set;
-
-import javax.annotation.Nonnegative;
-import javax.annotation.Nonnull;
-
import net.shibboleth.idp.module.IdPModule;
-import net.shibboleth.shared.annotation.constraint.NonnullElements;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.annotation.constraint.NotLive;
-import net.shibboleth.shared.annotation.constraint.Unmodifiable;
-import net.shibboleth.shared.collection.CollectionSupport;
+import net.shibboleth.profile.plugin.AbstractPlugin;
/**
* A base class implementing {@link IdPPlugin} that defaults common settings.
*
* @since 4.1.0
*/
-public abstract class AbstractIdPPlugin implements IdPPlugin {
-
- /** Modules to enable on install. */
- @Nonnull @NonnullElements private Set<IdPModule> enableModules;
-
- /** Modules to disable on removal. */
- @Nonnull @NonnullElements private Set<IdPModule> disableModules;
-
- /** Constructor. */
- public AbstractIdPPlugin() {
- enableModules = CollectionSupport.emptySet();
- disableModules = CollectionSupport.emptySet();
- }
-
- /** {@inheritDoc} */
- @Nonnull @NotEmpty public String getPluginId() {
- final String result = getClass().getPackageName();
- assert result != null;
- return result;
- }
-
- /** {@inheritDoc} */
- @Nonnegative public int getPatchVersion() {
- return 0;
- }
-
- /** {@inheritDoc} */
- @Nonnull @NonnullElements @Unmodifiable @NotLive public Set<String> getRequiredModules() {
- return CollectionSupport.emptySet();
- }
-
- /** {@inheritDoc} */
- @Nonnull @NonnullElements @Unmodifiable @NotLive public Set<IdPModule> getEnableOnInstall() {
- return enableModules;
- }
-
- /** {@inheritDoc} */
- public String getLicenseFileLocation() {
- return null;
- }
-
- /**
- * Set the modules to enable on install.
- *
- * @param modules modules to enable
- */
- protected void setEnableOnInstall(@Nonnull @NonnullElements final Set<IdPModule> modules) {
- enableModules = CollectionSupport.copyToSet(modules);
- }
-
- /** {@inheritDoc} */
- @Nonnull @NonnullElements @Unmodifiable @NotLive public Set<IdPModule> getDisableOnRemoval() {
- return disableModules;
- }
-
- /**
- * Set the modules to disable on removal.
- *
- * @param modules modules to disable
- */
- protected void setDisableOnRemoval(@Nonnull @NonnullElements final Set<IdPModule> modules) {
- disableModules = CollectionSupport.copyToSet(modules);
- }
-
- /** {@inheritDoc} */
- @Override
- public boolean equals(final Object obj) {
- return obj instanceof IdPModule && getPluginId().equals(((IdPPlugin) obj).getPluginId());
- }
-
-
- /** {@inheritDoc} */
- @Override
- public int hashCode() {
- return getPluginId().hashCode();
- }
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- return "IdPPlugin " + getPluginId();
- }
-
-}
\ No newline at end of file
+public abstract class AbstractIdPPlugin extends AbstractPlugin<IdPModule> implements IdPPlugin {
+}
diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/IdPPlugin.java b/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/IdPPlugin.java
index b719e6fa2..0bab2a40b 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/IdPPlugin.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/plugin/IdPPlugin.java
@@ -17,93 +17,13 @@
package net.shibboleth.idp.plugin;
-import java.io.IOException;
-import java.net.URL;
-import java.util.List;
-import java.util.Set;
-
-import javax.annotation.Nonnegative;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import net.shibboleth.idp.module.IdPModule;
-import net.shibboleth.shared.annotation.constraint.NonnullElements;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.annotation.constraint.NotLive;
-import net.shibboleth.shared.annotation.constraint.Unmodifiable;
+import net.shibboleth.profile.plugin.Plugin;
/**
* This interface is exported (via the service API) by every IdP plugin.
*
* @since 4.1.0
*/
-public interface IdPPlugin {
-
- /** Return the unique identifier for the plugin. This name <em>MUST</em> be
- * <ul>
- * <li> renderable in all file systems (for instance alphanumerics, '-' and '.' only)</li>
- * <li> unique. This is best done using java module guidance</li>
- * </ul>
- * For instance <code>org.example.plugins.myplugin</code>
- *
- * @return The id of this plugin.
- */
- @Nonnull @NotEmpty String getPluginId();
-
- /** Return the places to look for information for this plugin package.
- * The format of the (property) file at this location is fixed.
- *
- * @return Zero or more URLs
- * @throws IOException if the resource construction failed.
- */
- @Nonnull @NonnullElements @Unmodifiable @NotLive List<URL> getUpdateURLs() throws IOException;
-
- /** Return the major version, (as defined by the
- * <a href="https://wiki.shibboleth.net/confluence/display/DEV/Java+Product+Version+Policy">
- * Java Product Version Policy</a>.
- * @return The major version.
- */
- @Nonnegative int getMajorVersion();
-
- /** Return the minor version, (as defined by the
- * <a href="https://wiki.shibboleth.net/confluence/display/DEV/Java+Product+Version+Policy">
- * Java Product Version Policy</a>.
- * @return The minor version.
- */
- @Nonnegative int getMinorVersion();
-
- /** Return The patch version, (as defined by the
- * <a href="https://wiki.shibboleth.net/confluence/display/DEV/Java+Product+Version+Policy">
- * Java Product Version Policy</a>.
- * @return The patch version.
- */
- @Nonnegative int getPatchVersion();
-
- /** Return the classpath location of the license file to emit
- * when --license is specified.
- * @return the location
- */
- @Nullable String getLicenseFileLocation();
-
- /**
- * Get the IDs of any {@link IdPModule}s required for installation of this plugin.
- *
- * @return module IDs that are required
- */
- @Nonnull @NonnullElements @Unmodifiable @NotLive Set<String> getRequiredModules();
-
- /**
- * Get the modules to enable after plugin installation or upgrade.
- *
- * @return modules to enable
- */
- @Nonnull @NonnullElements @Unmodifiable @NotLive Set<IdPModule> getEnableOnInstall();
-
- /**
- * Get the modules to disable after plugin removal.
- *
- * @return modules to disable
- */
- @Nonnull @NonnullElements @Unmodifiable @NotLive Set<IdPModule> getDisableOnRemoval();
-
-}
\ No newline at end of file
+public interface IdPPlugin extends Plugin<IdPModule>{
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list