org.caleigo.security
Interface ILoginService

All Superinterfaces:
IDistributable, IService, java.io.Serializable
All Known Implementing Classes:
LoginService

public interface ILoginService
extends IService

Service that is used to handle the verification of users. There are three login methods which can be used.

Version:
1.00
Author:
Mattias Hagstrand

Nested Class Summary
static class ILoginService.LoginMessage
           
static class ILoginService.LoginServiceReturnMessage
           
static class ILoginService.LogoutMessage
           
static class ILoginService.UserLoginInfo
           
 
Method Summary
 void addLoginHandler(java.lang.Class loginInfoClass, ILoginHandler loginHandler)
          Add a login handler to the loginInfo class.
 int getMaximumNumberOfLoginTries()
          Returns the maximum number of times a user is allowed to try to login before the application exits.
 void handleError(java.lang.String message)
           
 UserInfo login()
          Tries to log in a user without supplying any login information.
 UserInfo login(java.lang.Object loginInfo)
          This method takes login information supplied in the loginInfo object.
 UserInfo login(java.lang.String username, java.lang.String password)
          This is a helper method that logs in a user based on the supplied username-password pair.
 boolean logout(UserInfo userInfo)
           
 void removeLoginHandler(java.lang.Class loginInfoClass)
          Removes a login handler
 void setLoginInfoProvider(ILoginInfoProvider provider)
          Registers an ILoginInfoProvider to use to provide login information to the login() method.
 void updateUserInfo(UserInfo userInfo)
          Updates an UserInfo object that represents an allready logged in user with relevante user information.
 
Methods inherited from interface org.caleigo.service.IService
finalizeService, getCustomProxyService, getServiceIdentity, getServiceInterface, getServiceInterfaceClass, getServiceType, hasCustomProxyService, initializeService, ping
 

Method Detail

setLoginInfoProvider

public void setLoginInfoProvider(ILoginInfoProvider provider)
Registers an ILoginInfoProvider to use to provide login information to the login() method.


addLoginHandler

public void addLoginHandler(java.lang.Class loginInfoClass,
                            ILoginHandler loginHandler)
Add a login handler to the loginInfo class. This handler will then be used to authenticate a user when the login(loginInfo) method is called with a parameter of the specific class.


removeLoginHandler

public void removeLoginHandler(java.lang.Class loginInfoClass)
Removes a login handler


login

public UserInfo login()
Tries to log in a user without supplying any login information. This method preferably uses descendants of ILoginInfoProvider to figure out the login information for the user. Returns null if the login was canceled.


login

public UserInfo login(java.lang.Object loginInfo)
This method takes login information supplied in the loginInfo object. There should be a corresponding ILoginHandler that is registered to handle the specific loginInfo class. Returns null if the login was canceled.


login

public UserInfo login(java.lang.String username,
                      java.lang.String password)
This is a helper method that logs in a user based on the supplied username-password pair. Returns null if the login was canceled.


logout

public boolean logout(UserInfo userInfo)

updateUserInfo

public void updateUserInfo(UserInfo userInfo)
Updates an UserInfo object that represents an allready logged in user with relevante user information.


handleError

public void handleError(java.lang.String message)

getMaximumNumberOfLoginTries

public int getMaximumNumberOfLoginTries()
Returns the maximum number of times a user is allowed to try to login before the application exits.



Copyright © 2005 Caleigo. All Rights Reserved.