Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.login
Class SecurityAuthorityImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.gui.main.login.SecurityAuthorityImpl
All Implemented Interfaces:
SecurityAuthority

public class SecurityAuthorityImpl
extends Object
implements SecurityAuthority

The SecurityAuthorityImpl is an implementation of the SecurityAuthority interface.

Author:
Yana Stamcheva

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.protocol.SecurityAuthority
AUTHENTICATION_REQUIRED, CONNECTION_FAILED, WRONG_PASSWORD, WRONG_USERNAME
 
Constructor Summary
SecurityAuthorityImpl(ProtocolProviderService protocolProvider)
          Creates an instance of SecurityAuthorityImpl.
 
Method Summary
 boolean isUserNameEditable()
          Indicates if the user name is currently editable, i.e.
 UserCredentials obtainCredentials(String realm, UserCredentials userCredentials)
          Implements the SecurityAuthority.obtainCredentials method.
 UserCredentials obtainCredentials(String realm, UserCredentials userCredentials, int reasonCode)
          Implements the SecurityAuthority.obtainCredentials method.
 void setUserNameEditable(boolean isUserNameEditable)
          Sets the userNameEditable property, which indicates if the user name could be changed by user or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityAuthorityImpl

public SecurityAuthorityImpl(ProtocolProviderService protocolProvider)
Creates an instance of SecurityAuthorityImpl.

Parameters:
protocolProvider - The ProtocolProviderService for this SecurityAuthority.
Method Detail

obtainCredentials

public UserCredentials obtainCredentials(String realm,
                                         UserCredentials userCredentials,
                                         int reasonCode)
Implements the SecurityAuthority.obtainCredentials method. Creates and show an AuthenticationWindow, where user could enter its password.

Specified by:
obtainCredentials in interface SecurityAuthority
Parameters:
realm - The realm that the credentials are needed for.
userCredentials - the values to propose the user by default
reasonCode - indicates the reason for which we're obtaining the credentials.
Returns:
The credentials associated with the specified realm or null if none could be obtained.

obtainCredentials

public UserCredentials obtainCredentials(String realm,
                                         UserCredentials userCredentials)
Implements the SecurityAuthority.obtainCredentials method. Creates and show an AuthenticationWindow, where user could enter its password.

Specified by:
obtainCredentials in interface SecurityAuthority
Parameters:
realm - The realm that the credentials are needed for.
userCredentials - the values to propose the user by default
Returns:
The credentials associated with the specified realm or null if none could be obtained.

setUserNameEditable

public void setUserNameEditable(boolean isUserNameEditable)
Sets the userNameEditable property, which indicates if the user name could be changed by user or not.

Specified by:
setUserNameEditable in interface SecurityAuthority
Parameters:
isUserNameEditable - indicates if the user name could be changed by user

isUserNameEditable

public boolean isUserNameEditable()
Indicates if the user name is currently editable, i.e. could be changed by user or not.

Specified by:
isUserNameEditable in interface SecurityAuthority
Returns:
true if the user name could be changed, false - otherwise.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.