FileDocCategorySizeDatePackage
SecurityServiceImpl.javaAPI DocExample1005Mon Sep 06 23:01:02 BST 2004com.oreilly.strutsckbk.ch11.sf

SecurityServiceImpl

public class SecurityServiceImpl extends Object implements SecurityService

Fields Summary
private Map
users
Constructors Summary
public SecurityServiceImpl()

    
      
        users.put("gpburdell", new User("gpburdell", "gotech",new String[]{"jscUser"}));
        users.put("bsiggelkow", new User("bsiggelkow", "crazybill",new String[]{"jscUser","jscAdmin"}));
        users.put("jmitchell", new User("jmitchell", "helga",new String[]{"jscAdmin"}));
        users.put("thusted", new User("thusted", "thebear"));
	
Methods Summary
public Userauthenticate(java.lang.String username, java.lang.String password)

        User user = (User) users.get(username);
        if (user == null) throw new UnknownUserException();
        if (!user.matchPassword(password)) throw new AuthenticationException();
        return user;
	
public UserfindUser(java.lang.String username)

        return (User) users.get(username);