Clean up AAAShiroProvider 32/100932/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 3 May 2022 08:22:16 +0000 (10:22 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 3 May 2022 08:42:07 +0000 (10:42 +0200)
AAAShiroProvider has a ton of constructor arguments, which are not
really used anywhere. Remove them along with their fields and accessors.

Change-Id: I49112e08c9af629c5ba62fe19a01d6306229dae8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
aaa-shiro/impl/src/main/java/org/opendaylight/aaa/AAAShiroProvider.java
aaa-shiro/impl/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml

index 2b99ec27a721642686e8c445f8d754a2f6aef9e2..040f75bc007b1a3f356265cf7d3b604ce0e9b101 100644 (file)
@@ -10,21 +10,16 @@ package org.opendaylight.aaa;
 import static java.util.Objects.requireNonNull;
 
 import javax.servlet.ServletException;
-import org.opendaylight.aaa.api.AuthenticationService;
 import org.opendaylight.aaa.api.IDMStoreException;
 import org.opendaylight.aaa.api.IIDMStore;
 import org.opendaylight.aaa.api.PasswordCredentialAuth;
 import org.opendaylight.aaa.api.StoreBuilder;
 import org.opendaylight.aaa.api.TokenStore;
-import org.opendaylight.aaa.api.password.service.PasswordHashService;
-import org.opendaylight.aaa.cert.api.ICertificateManager;
 import org.opendaylight.aaa.datastore.h2.H2TokenStore;
 import org.opendaylight.aaa.shiro.moon.MoonTokenEndpoint;
 import org.opendaylight.aaa.tokenauthrealm.auth.HttpBasicAuth;
 import org.opendaylight.aaa.tokenauthrealm.auth.TokenAuthenticators;
-import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.DatastoreConfig;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.ShiroConfiguration;
 import org.osgi.service.http.HttpService;
 import org.osgi.service.http.NamespaceException;
 import org.slf4j.Logger;
@@ -36,36 +31,21 @@ import org.slf4j.LoggerFactory;
 public final class AAAShiroProvider {
     private static final Logger LOG = LoggerFactory.getLogger(AAAShiroProvider.class);
 
-    private final DataBroker dataBroker;
-    private final ICertificateManager certificateManager;
     private final HttpService httpService;
     private final TokenStore tokenStore;
-    private final ShiroConfiguration shiroConfiguration;
     private final String moonEndpointPath;
     private final TokenAuthenticators tokenAuthenticators;
-    private final AuthenticationService authenticationService;
-    private final PasswordHashService passwordHashService;
 
     /**
      * Constructor.
      */
-    public AAAShiroProvider(final DataBroker dataBroker,
-                            final ICertificateManager certificateManager,
-                            final PasswordCredentialAuth credentialAuth,
-                            final ShiroConfiguration shiroConfiguration,
+    public AAAShiroProvider(final PasswordCredentialAuth credentialAuth,
                             final HttpService httpService,
                             final String moonEndpointPath,
                             final DatastoreConfig datastoreConfig,
-                            final IIDMStore iidmStore,
-                            final AuthenticationService authenticationService,
-                            final PasswordHashService passwordHashService) {
-        this.dataBroker = dataBroker;
-        this.certificateManager = certificateManager;
-        this.shiroConfiguration = shiroConfiguration;
+                            final IIDMStore iidmStore) {
         this.httpService = httpService;
         this.moonEndpointPath = moonEndpointPath;
-        this.authenticationService = authenticationService;
-        this.passwordHashService = passwordHashService;
 
         if (datastoreConfig == null || !datastoreConfig.getStore().equals(DatastoreConfig.Store.H2DataStore)) {
             LOG.info("AAA Datastore has not been initialized");
@@ -119,33 +99,6 @@ public final class AAAShiroProvider {
         }
     }
 
-    /**
-     * Extract the data broker.
-     *
-     * @return the data broker
-     */
-    public DataBroker getDataBroker() {
-        return dataBroker;
-    }
-
-    /**
-     * Extract the certificate manager.
-     *
-     * @return the certificate manager.
-     */
-    public ICertificateManager getCertificateManager() {
-        return certificateManager;
-    }
-
-    /**
-     * Extract Shiro related configuration.
-     *
-     * @return Shiro related configuration.
-     */
-    public ShiroConfiguration getShiroConfiguration() {
-        return shiroConfiguration;
-    }
-
     public TokenStore getTokenStore() {
         return tokenStore;
     }
@@ -153,12 +106,4 @@ public final class AAAShiroProvider {
     public TokenAuthenticators getTokenAuthenticators() {
         return tokenAuthenticators;
     }
-
-    public AuthenticationService getAuthenticationService() {
-        return authenticationService;
-    }
-
-    public PasswordHashService getPasswordHashService() {
-        return passwordHashService;
-    }
 }
index d35d964145e4131882c1b0964d85fd3a65bea9a4..b20cf73781c65c8c74bb94318369547e2e0cbc76 100644 (file)
@@ -38,19 +38,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <reference id="httpService"
              interface="org.osgi.service.http.HttpService"/>
 
-  <bean id="provider"
-        class="org.opendaylight.aaa.AAAShiroProvider"
-        init-method="init" destroy-method="close">
-    <argument ref="dataBroker" />
-    <argument ref="certManager" />
+  <bean id="provider" class="org.opendaylight.aaa.AAAShiroProvider" init-method="init" destroy-method="close">
     <argument ref="passwordCredentialAuth" />
-    <argument ref="shiroConfiguration" />
     <argument ref="httpService" />
     <argument value="/moon" />
     <argument ref="datastoreConfig" />
     <argument ref="idmStore" />
-    <argument ref="authService" />
-    <argument ref="passwordService" />
   </bean>
 
   <bean id="shiroWebEnvLoader" class="org.opendaylight.aaa.shiro.web.env.ShiroWebEnvironmentLoaderListener">