01: package com.mockrunner.example.struts;
02:
03: /**
04: * Example implementation of {@link AuthenticationStrategy}.
05: * Does nothing.
06: */
07: public class MySQLAuthenticationStrategy implements
08: AuthenticationStrategy {
09: private boolean isUserKnown;
10: private boolean isPasswordOk;
11:
12: public boolean authenticate(String username, String password) {
13: //do database stuff here
14: isUserKnown = false;
15: isPasswordOk = false;
16: return false;
17: }
18:
19: public boolean wasLastUserKnown() {
20: return isUserKnown;
21: }
22:
23: public boolean wasLastPasswordOk() {
24: return isPasswordOk;
25: }
26:
27: }
|