litesoft
@ 947
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
// This Source Code is in the Public Domain per: http://unlicense.org package org.litesoft.GWT.eventbus.server; import org.litesoft.GWT.eventbus.client.nonpublic.*; import org.litesoft.*; import org.litesoft.orsup.base.*; public interface IAuthenticationService { public static final String AUTHENTICATION_ERROR_MESSAGE = "Invalid credentials"; /** * Authenticate (find a SystemUser) based on the pLoginName, pPlainTextPassword. * * @return found SystemUser * * @throws AuthenticationException if No SystemUser or SystemUser not allowed to Login, Exception message is the text to the user */ public ISystemUser authenticate( String pLoginName, String pPlainTextPassword ) throws AuthenticationException; /** * @param pSystemUser !null */ public ClientWindowInstanceDataManager createNewClientWindowInstanceData( ISystemUser pSystemUser ); /** * No modification to the pDataManager is allowed unless there is going to be NO PROBLEMS! * @param pDataManager !null * @param pSystemUser !null */ public void adjustExistingClientWindowInstanceDataForNewUser( ClientWindowInstanceDataManager pDataManager, ISystemUser pSystemUser ); public static class Null implements IAuthenticationService { public static final IAuthenticationService INSTANCE = new Null(); public ISystemUser authenticate( String pLoginName, String pPlainTextPassword ) throws AuthenticationException { throw new AuthenticationException( "Null AuthenticationService" ); } public ClientWindowInstanceDataManager createNewClientWindowInstanceData( ISystemUser pSystemUser ) { return null; } public void adjustExistingClientWindowInstanceDataForNewUser( ClientWindowInstanceDataManager pDataManager, ISystemUser pSystemUser ) { } } } |