Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

java.lang.Object
  extended by net.java.sip.communicator.impl.gui.main.login.LoginManager
All Implemented Interfaces:
EventListener, AccountManagerListener, RegistrationStateChangeListener, org.osgi.framework.ServiceListener

public class LoginManager
extends Object
implements org.osgi.framework.ServiceListener, RegistrationStateChangeListener, AccountManagerListener

The LoginManager manages the login operation. Here we obtain the ProtocolProviderFactory, we make the account installation and we handle all events related to the registration state.

The LoginManager is the one that opens one or more LoginWindows for each ProtocolProviderFactory. The LoginWindow is where user could enter an identifier and password.

Note that the behavior of this class will be changed when the Configuration Service is ready.

Author:
Yana Stamcheva

Constructor Summary
LoginManager(MainFrame mainFrame)
          Creates an instance of the LoginManager, by specifying the main application window.
 
Method Summary
 void handleAccountManagerEvent(AccountManagerEvent event)
          Notifies that the loading of the stored accounts of a specific ProtocolProviderFactory has finished.
 boolean isManuallyDisconnected()
           
 void login(ProtocolProviderService protocolProvider)
          Registers the given protocol provider.
 void logoff(ProtocolProviderService protocolProvider)
          Unregisters the given protocol provider.
 void registrationStateChanged(RegistrationStateChangeEvent evt)
          The method is called by a ProtocolProvider implementation whenever a change in the registration state of the corresponding provider had occurred.
 void runLogin(MainFrame parent)
          Shows login window for each registered account.
 void serviceChanged(org.osgi.framework.ServiceEvent event)
          Implements the ServiceListener method.
 void setManuallyDisconnected(boolean manuallyDisconnected)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginManager

public LoginManager(MainFrame mainFrame)
Creates an instance of the LoginManager, by specifying the main application window.

Parameters:
mainFrame - the main application window
Method Detail

login

public void login(ProtocolProviderService protocolProvider)
Registers the given protocol provider.

Parameters:
protocolProvider - the ProtocolProviderService to register.

logoff

public void logoff(ProtocolProviderService protocolProvider)
Unregisters the given protocol provider.

Parameters:
protocolProvider - the ProtocolProviderService to unregister

runLogin

public void runLogin(MainFrame parent)
Shows login window for each registered account.

Parameters:
parent - The parent MainFrame window.

handleAccountManagerEvent

public void handleAccountManagerEvent(AccountManagerEvent event)
Notifies that the loading of the stored accounts of a specific ProtocolProviderFactory has finished.

Specified by:
handleAccountManagerEvent in interface AccountManagerListener
Parameters:
event - the AccountManagerEvent describing the AccountManager firing the notification and the other details of the specific notification.

registrationStateChanged

public void registrationStateChanged(RegistrationStateChangeEvent evt)
The method is called by a ProtocolProvider implementation whenever a change in the registration state of the corresponding provider had occurred.

Specified by:
registrationStateChanged in interface RegistrationStateChangeListener
Parameters:
evt - ProviderStatusChangeEvent the event describing the status change.

serviceChanged

public void serviceChanged(org.osgi.framework.ServiceEvent event)
Implements the ServiceListener method. Verifies whether the passed event concerns a ProtocolProviderService and adds the corresponding UI controls.

Specified by:
serviceChanged in interface org.osgi.framework.ServiceListener
Parameters:
event - The ServiceEvent object.

isManuallyDisconnected

public boolean isManuallyDisconnected()

setManuallyDisconnected

public void setManuallyDisconnected(boolean manuallyDisconnected)

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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