Fix findbugs violations in aaa-authn-api
[aaa.git] / aaa-authn-api / src / main / java / org / opendaylight / aaa / api / StoreBuilder.java
index dba449f5d6bb62343004f49ef471323543061250..76c1f0a9a5c3a3b88b9867fc5e27cbadb6df805c 100644 (file)
@@ -39,7 +39,6 @@ import org.slf4j.LoggerFactory;
  * <ol>
  * <li>admin with admin role on sdn</li>
  * <li>admin with user role on sdn</li>
- * <li>user with user role on sdn</li>
  * </ol>
  *
  * @author peter.mellquist@hp.com
@@ -76,7 +75,6 @@ public class StoreBuilder {
      *
      * @param domainID ID (same as name) of the "authentication domain"
      * @return ID of the just newly created Domain, or null if no new one had to be created
-     * @return true if initialization took place, false if it wasn't needed
      * @throws IDMStoreException for issues coming from the IIDMStore
      */
     public String initDomainAndRolesWithoutUsers(String domainID) throws IDMStoreException {
@@ -106,14 +104,14 @@ public class StoreBuilder {
         adminRole.setName("admin");
         adminRole.setDomainid(newDomainID);
         adminRole.setDescription("a role for admins");
-        adminRole = store.writeRole(adminRole);
+        store.writeRole(adminRole);
         LOG.info("Created 'admin' role");
 
         Role userRole = new Role();
         userRole.setName("user");
         userRole.setDomainid(newDomainID);
         userRole.setDescription("a role for users");
-        userRole = store.writeRole(userRole);
+        store.writeRole(userRole);
         LOG.info("Created 'user' role");
 
         return newDomainID;
@@ -121,7 +119,8 @@ public class StoreBuilder {
 
     /**
      * Initialize IIDMStore with the default domain and the 'user' and 'admin'
-     * roles AND 2 default user accounts (with default passwords, which is bad practice).
+     * roles AND a default admin account (with default password, which is bad practice).
+     *
      * @param domainID ID (same as name) of the "authentication domain"
      * @throws IDMStoreException for issues coming from the IIDMStore
      */
@@ -129,7 +128,6 @@ public class StoreBuilder {
         String newDomainID = initDomainAndRolesWithoutUsers(domainID);
         if (newDomainID != null) {
             createUser(newDomainID, "admin", "admin", true);
-            createUser(newDomainID, "user", "user", false);
         }
     }
 
@@ -209,7 +207,7 @@ public class StoreBuilder {
         grant.setDomainid(domainID);
         grant.setUserid(userID);
         grant.setRoleid(roleID);
-        grant = store.writeGrant(grant);
+        store.writeGrant(grant);
         LOG.debug("Granted '" + userID + "' user the '" + roleID + "' role in domain '" + domainID + "'");
     }
 }