copyright messages updated in all java filees.
[utils] / security / src / main / java / org / wamblee / usermgt / UserAdminInitializer.java
index 2897d5e6f24b876a4d9b4925e44e2259cf844201..85f677ef3998fdb1fda35440c7c01f3a11563e3a 100644 (file)
@@ -1,50 +1,47 @@
 /*
- * Copyright 2005 the original author or authors.
- *
+ * Copyright 2005-2010 the original author or authors.
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *      http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
+ */ 
 package org.wamblee.usermgt;
 
 import org.apache.log4j.Logger;
 
 import java.security.NoSuchAlgorithmException;
 
-
 /**
- * User administration initializer. It populates the user administration
- * with a number of groups and users but only in case no users exist.
- *
+ * User administration initializer. It populates the user administration with a
+ * number of groups and users but only in case no users exist.
+ * 
  * @author Erik Brakkee
  */
 public class UserAdminInitializer {
-    /**
-     * DOCUMENT ME!
-     */
-    private static final Logger LOGGER = Logger.getLogger(UserAdminInitializer.class);
+    private static final Logger LOGGER = Logger
+        .getLogger(UserAdminInitializer.class);
 
-/**
+    /**
      * Initializes the user administration in case no users are present.
      * 
      */
     public UserAdminInitializer(UserAdministration aAdmin, String[] aUsers,
-        String[] aGroups, String[] aPasswords)
-        throws UserMgtException, NoSuchAlgorithmException {
-        if ((aUsers.length != aGroups.length)
-                || (aUsers.length != aPasswords.length)) {
+        String[] aGroups, String[] aPasswords) throws UserMgtException,
+        NoSuchAlgorithmException {
+        if ((aUsers.length != aGroups.length) ||
+            (aUsers.length != aPasswords.length)) {
             throw new IllegalArgumentException(
-                "Array sizes for users, groups, and passwords differ: "
-                + aUsers.length + "," + aGroups.length + ","
-                + aPasswords.length);
+                "Array sizes for users, groups, and passwords differ: " +
+                    aUsers.length + "," + aGroups.length + "," +
+                    aPasswords.length);
         }
 
         if (aAdmin.getUserCount() == 0) {
@@ -54,19 +51,24 @@ public class UserAdminInitializer {
 
     /**
      * Adds the specified users and groups to the user administration.
-     *
-     * @param aAdmin User administration.
-     * @param aUsers Users.
-     * @param aGroups Groups.
-     * @param aPasswords Passwords.
-     *
-     * @throws UserMgtException In case of a problem creating users or groups.
+     * 
+     * @param aAdmin
+     *            User administration.
+     * @param aUsers
+     *            Users.
+     * @param aGroups
+     *            Groups.
+     * @param aPasswords
+     *            Passwords.
+     * 
+     * @throws UserMgtException
+     *             In case of a problem creating users or groups.
      */
     private void initialize(UserAdministration aAdmin, String[] aUsers,
         String[] aGroups, String[] aPasswords) throws UserMgtException {
         for (int i = 0; i < aUsers.length; i++) {
-            String user     = aUsers[i];
-            String group    = aGroups[i];
+            String user = aUsers[i];
+            String group = aGroups[i];
             String password = aPasswords[i];
 
             if (aAdmin.getUser(user) == null) {
@@ -80,7 +82,8 @@ public class UserAdminInitializer {
                 }
                 assert groupObj != null;
 
-                LOGGER.info("Creating user: " + user + " password: " + password);
+                LOGGER
+                    .info("Creating user: " + user + " password: " + password);
                 aAdmin.createUser(user, password, groupObj);
             }
         }