package jp.co.y_net.amm;

import jp.co.y_net.amm.dao.Usr;

import org.apache.wicket.Page;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebSession;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.mapper.parameter.PageParameters;

public class AppSession extends WebSession {
//AuthenticatedWebSession {
    private static final long serialVersionUID = 1L;
    
    public AppSession(Request request) {
        super(request);
    }
    public static AppSession get() {
        return (AppSession) Session.get();
    }
    
    private LoginUser loginUser;
    public boolean isLogin() {
        return ((this.loginUser == null) == false);
    }
    public LoginUser getLoginUser() {
        return this.loginUser;
    }
    public void setLoginUser(LoginUser loginUser) {
        this.loginUser = loginUser;
    }
    public void clearLoginUser() {
        this.loginUser = null;
    }
    public static class LoginUser extends Usr{
        /* 拡張無し */
    }
    public void setLoginUser(Usr usr) {
        loginUser = new LoginUser();
        usr.copy(loginUser);

    }

    public Class<? extends Page> returnPageClass;
    public PageParameters returnPageParameters;



    
    


}

