package me.chyxion.tigon.shiro;

import org.apache.shiro.subject.Subject;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.AuthenticationException;

/**
 * @version 0.0.1
 * @since 0.0.1
 * @author Shaun Chyxion <br>
 * chyxion@163.com <br>
 * Apr 7, 2015 3:57:08 PM
 */
public interface AuthCallback {

    /**
     * @param token token
     * @param info info
     * @param subject subject
     */
    void onSuccessfulLogin(AuthenticationToken token, AuthenticationInfo info, Subject subject);
    
    /**
     * @param token token
     * @param ae authentication exception
     * @param subject subject
     */
    void onFailedLogin(AuthenticationToken token, AuthenticationException ae, Subject subject);
    
    /**
     * @param subject subject
     */
    void beforeLogout(Subject subject); 
}
