]> git.somenet.org - pub/jan/dst18.git/blob - ass2-service/auth/src/main/java/dst/ass2/service/auth/ICachingAuthenticationService.java
Add template for assignment 2
[pub/jan/dst18.git] / ass2-service / auth / src / main / java / dst / ass2 / service / auth / ICachingAuthenticationService.java
1 package dst.ass2.service.auth;
2
3 import dst.ass2.service.api.auth.AuthenticationException;
4 import dst.ass2.service.api.auth.IAuthenticationService;
5 import dst.ass2.service.api.auth.NoSuchUserException;
6
7 public interface ICachingAuthenticationService extends IAuthenticationService {
8
9     /**
10      * {@inheritDoc}
11      *
12      * <p>
13      * Instead of checking database records directly, the method first checks the cache for existing users. If the user
14      * is not in the cache, then the service checks the database for the given email address, and updates the cache if
15      * necessary.
16      * </p>
17      */
18     @Override
19     String authenticate(String email, String password) throws NoSuchUserException, AuthenticationException;
20
21     /**
22      * Loads user data from the database into memory.
23      */
24     void loadData();
25
26     /**
27      * Clears the data cached from the database.
28      */
29     void clearCache();
30 }