com.atlassian.jira.bc.security.login
Class LoginResultImpl

java.lang.Object
  extended by com.atlassian.jira.bc.security.login.LoginResultImpl
All Implemented Interfaces:
LoginResult

public class LoginResultImpl
extends Object
implements LoginResult

Simple Implementation of LoginResult

Since:
v4.0.1

Constructor Summary
LoginResultImpl(LoginReason reason, LoginInfo loginInfo, String userName)
           
LoginResultImpl(LoginReason reason, LoginInfo loginInfo, String userName, Set<DeniedReason> deniedReasons)
           
 
Method Summary
 Set<DeniedReason> getDeniedReasons()
          Returns a Set of DenialReason objects, which can be used to determine the reason why a login request has been denied.
 LoginInfo getLoginInfo()
           
 LoginReason getReason()
          If the login fails then this enum describes why
 String getUserName()
           
 boolean isOK()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoginResultImpl

public LoginResultImpl(LoginReason reason,
                       LoginInfo loginInfo,
                       String userName)

LoginResultImpl

public LoginResultImpl(LoginReason reason,
                       LoginInfo loginInfo,
                       String userName,
                       Set<DeniedReason> deniedReasons)
Method Detail

isOK

public boolean isOK()
Specified by:
isOK in interface LoginResult
Returns:
true if all is OK. In this case LoginResult.getReason() will equals LoginReason.OK

getUserName

public String getUserName()
Specified by:
getUserName in interface LoginResult
Returns:
the name of the user that the login was performed for or null if its not known

getReason

public LoginReason getReason()
Description copied from interface: LoginResult
If the login fails then this enum describes why

Specified by:
getReason in interface LoginResult
Returns:
the LoginReason

getLoginInfo

public LoginInfo getLoginInfo()
Specified by:
getLoginInfo in interface LoginResult
Returns:
The LoginInfo associated with the user or null if the LoginResult.getUserName() returns null.

getDeniedReasons

public Set<DeniedReason> getDeniedReasons()
Description copied from interface: LoginResult
Returns a Set of DenialReason objects, which can be used to determine the reason why a login request has been denied. This method returns an empty set when LoginResult.getReason() != LoginReason.AUTHENTICATION_DENIED.

Specified by:
getDeniedReasons in interface LoginResult
Returns:
a Set of DenialReason

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2012 Atlassian. All Rights Reserved.