Commits

Sebastian Sdorra  committed 66917fb

javadoc for AbstractAuthenticationManager

  • Participants
  • Parent commits 39de652

Comments (0)

Files changed (1)

File scm-core/src/main/java/sonia/scm/web/security/AbstractAuthenticationManager.java

 
 //~--- non-JDK imports --------------------------------------------------------
 
+import com.google.common.collect.Sets;
+
+import sonia.scm.event.ScmEventBus;
 import sonia.scm.user.User;
 
 //~--- JDK imports ------------------------------------------------------------
 
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.Set;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import sonia.scm.event.ScmEventBus;
 
 /**
+ * Abstract base class for {@link AuthenticationManager} implementations. This
+ * class implements the listener methods of the {@link AuthenticationManager}
+ * interface.
  *
  * @author Sebastian Sdorra
  */
 {
 
   /**
-   * Method description
+   * Register a {@link AuthenticationListener}.
    *
    *
-   * @param listener
+   * @param listener {@link AuthenticationListener} to register
    */
   @Override
   public void addListener(AuthenticationListener listener)
   }
 
   /**
-   * Method description
+   * Register a {@link java.util.Collection} of {@link AuthenticationListener}s.
    *
    *
-   * @param listeners
+   * @param listeners listeners to register
    */
   @Override
   public void addListeners(Collection<AuthenticationListener> listeners)
   }
 
   /**
-   * Method description
+   * Remove specified {@link AuthenticationListener}.
    *
    *
-   * @param listener
+   * @param listener to remove
    */
   @Override
   public void removeListener(AuthenticationListener listener)
   }
 
   /**
-   * Method description
    *
+   * Calls the {@link AuthenticationListener#onAuthentication(HttpServletRequest,HttpServletResponse,User)}
+   * method of all registered listeners and send a {@link AuthenticationEvent}
+   * to the {@link ScmEventBus}.
    *
-   * @param request
-   * @param response
-   * @param user
+   * @param request current http request
+   * @param response current http response
+   * @param user successful authenticated user
    */
   protected void fireAuthenticationEvent(HttpServletRequest request,
     HttpServletResponse response, User user)
     {
       listener.onAuthentication(request, response, user);
     }
-    
+
     ScmEventBus.getInstance().post(new AuthenticationEvent(user));
   }
 
   //~--- fields ---------------------------------------------------------------
 
-  /** Field description */
-  private Set<AuthenticationListener> listeners =
-    new HashSet<AuthenticationListener>();
+  /** authentication listeners */
+  private Set<AuthenticationListener> listeners = Sets.newHashSet();
 }