01: /*
02: * CoadunationLib: The coaduntion implementation library.
03: * Copyright (C) 2006 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18: *
19: * SessionLogin.java
20: *
21: * This class is responsible for setting up a session for a user.
22: */
23:
24: // The package path for the session
25: package com.rift.coad.lib.security.login;
26:
27: // coadunation imports
28: import com.rift.coad.lib.security.UserSession;
29:
30: /**
31: * This class is responsible for setting up a session for a user.
32: *
33: * @author Brett Chaldecott
34: */
35: public class SessionLogin {
36:
37: // The classes private member variables.
38: private LoginInfoHandler infoHandler = null;
39: private UserSession user = null;
40:
41: /**
42: * Creates a new instance of SessionLogin
43: *
44: * @param infoHandler The reference to the class that will gather the
45: * information required for the authentication request.
46: */
47: public SessionLogin(LoginInfoHandler infoHandler) {
48: this .infoHandler = infoHandler;
49: }
50:
51: /**
52: * This method will process the login request.
53: *
54: * @exception LoginException
55: * @exception AuthenticationException
56: */
57: public void login() throws LoginException, AuthenticationException {
58: user = LoginManager.getInstance().authenticate(infoHandler);
59: }
60:
61: /**
62: * This method returns the user session login object.
63: *
64: * @return The reference to the user session.
65: */
66: public UserSession getUser() {
67: return user;
68: }
69: }
|