com.quadrique.jbuildingblocks.gui
Class JbbLogin

java.lang.Object
  extended by com.quadrique.jbuildingblocks.gui.JbbLogin

public class JbbLogin
extends Object

This class provides common services for handling the login information of a user It is typically used in the context of a client application where a user has to to log in...

Author:
Hervé Rivere

Constructor Summary
JbbLogin()
          constructor
 
Method Summary
 void addListener(JbbLoginListener zListener)
          Call this method to register to be notified of application login changes
 boolean askUserToLogIn(DlgLogin zDlg)
           
 boolean askUserToLogIn(JComponent zParent, String zLogoImage, boolean zDisplayServerUrl)
           
static JbbLogin getInstance()
          This method returns an instance of the Login class.
 String getServerUrl()
           
 JbbUser getUser()
           
 void removeListener(JbbLoginListener zListener)
          Call this method to remove a previously registered listener
 void setServerUrl(String zServerUrl)
           
 void setUser(JbbUser zUser)
           
 void setUserName(String zUserName)
           
 void usePreferences(boolean zUsePreferences)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JbbLogin

public JbbLogin()
constructor

Method Detail

getInstance

public static final JbbLogin getInstance()
This method returns an instance of the Login class. If there has been already one instantiation, the same instance is returned so that it can be shared accross the application. A typical usage would be: Login.getInstance().getXxxx() or Login lConfig = Login.getInstance();


usePreferences

public void usePreferences(boolean zUsePreferences)
                    throws Exception
Parameters:
zUsePreferences - true to use them, false otherwise
Throws:
Exception

addListener

public void addListener(JbbLoginListener zListener)
Call this method to register to be notified of application login changes

Parameters:
zListener - a reference to an instance of a class that implements the LoginListener interface.

removeListener

public void removeListener(JbbLoginListener zListener)
Call this method to remove a previously registered listener

Parameters:
zListener - a reference to an instance of a class that implements the LoginListener interface.

getUser

public JbbUser getUser()

getServerUrl

public String getServerUrl()

setUserName

public void setUserName(String zUserName)
                 throws Exception
Parameters:
zUserName -
Throws:
Exception

setServerUrl

public void setServerUrl(String zServerUrl)
Parameters:
zServerUrl - the server Url

setUser

public void setUser(JbbUser zUser)
             throws Exception
Parameters:
zUser -
Throws:
Exception

askUserToLogIn

public boolean askUserToLogIn(JComponent zParent,
                              String zLogoImage,
                              boolean zDisplayServerUrl)
                       throws Exception
Parameters:
zParent -
zLogoImage -
zDisplayServerUrl -
Returns:
true if the login was change successfully
Throws:
Exception

askUserToLogIn

public boolean askUserToLogIn(DlgLogin zDlg)
                       throws Exception
Parameters:
zDlg - the login dialog to use
Returns:
true if the login was change successfully
Throws:
Exception


Copyright © 2001-2009 Quadrique Corporation. All Rights Reserved.