Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class DefaultSecurityAuthority
extends Object
implements SecurityAuthority

Utility class that can be used in cases where components other than the main user interface may need to launch provider registration. At the time I am writing this, the DefaultSecurityAuthority is being used by the systray and uri handlers.

Author:
Yana Stamcheva, Emil Ivov

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.protocol.SecurityAuthority
AUTHENTICATION_REQUIRED, CONNECTION_FAILED, WRONG_PASSWORD, WRONG_USERNAME
 
Constructor Summary
DefaultSecurityAuthority(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

DefaultSecurityAuthority

public DefaultSecurityAuthority(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.