|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
LoginManager.java | 0% | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
* Joey and its relative products are published under the terms
|
|
3 |
* of the Apache Software License.
|
|
4 |
*/
|
|
5 |
/*
|
|
6 |
* Created on 2004/01/12
|
|
7 |
*/
|
|
8 |
package org.asyrinx.brownie.core.user;
|
|
9 |
|
|
10 |
import org.apache.commons.lang.exception.NestableRuntimeException;
|
|
11 |
import org.asyrinx.brownie.core.lang.ClassUtils;
|
|
12 |
|
|
13 |
/**
|
|
14 |
* @author akima
|
|
15 |
*/
|
|
16 |
public class LoginManager { |
|
17 |
|
|
18 |
/**
|
|
19 |
*
|
|
20 |
*/
|
|
21 | 0 |
public LoginManager(IUserCertifier certifier) {
|
22 | 0 |
super();
|
23 | 0 |
this.certifier = certifier;
|
24 |
} |
|
25 |
|
|
26 |
/**
|
|
27 |
*
|
|
28 |
*/
|
|
29 | 0 |
public LoginManager(String certifierClassName) {
|
30 | 0 |
this(newCertifier(certifierClassName));
|
31 |
} |
|
32 |
|
|
33 | 0 |
private static IUserCertifier newCertifier(String certifierClassName) { |
34 | 0 |
try {
|
35 | 0 |
return (IUserCertifier) ClassUtils.newObject(certifierClassName,
|
36 |
IUserCertifier.class);
|
|
37 |
} catch (InstantiationException e) {
|
|
38 | 0 |
throw new NestableRuntimeException(e); |
39 |
} |
|
40 |
} |
|
41 |
|
|
42 |
protected final IUserCertifier certifier;
|
|
43 |
|
|
44 | 0 |
public IUser tryLogin(String userId, String password) {
|
45 | 0 |
if (certifier == null) |
46 | 0 |
return null; |
47 | 0 |
return certifier.canLogin(userId, password);
|
48 |
} |
|
49 |
|
|
50 |
} |
|