FileDocCategorySizeDatePackage
SecurityServiceImpl.javaAPI DocExample896Sun Sep 05 16:28:44 BST 2004com.oreilly.strutsckbk.ch11.ams

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[]{"manager"}));
        users.put("bsiggelkow", new User("bsiggelkow", "crazybill",new String[]{"manager"}));
        users.put("jmitchell", new User("jmitchell", "helga",new String[]{"admin"}));
        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;