SPT Core API

com.sptci.echo.login
Class LoginListener

java.lang.Object
  extended by com.sptci.echo.login.AbstractListener
      extended by com.sptci.echo.login.LoginListener
All Implemented Interfaces:
Serializable, EventListener, ActionListener
Direct Known Subclasses:
JaasLoginListener

public abstract class LoginListener
extends AbstractListener

An action listener for implementing the login action for LoginPane. Sub-classes must implement the login(java.lang.String, java.lang.String) method.

© Copyright 2008 Sans Pareil Technologies, Inc.

Version:
$Id: LoginListener.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2008-04-12
See Also:
Serialized Form

Field Summary
protected  boolean displayError
          A flag used to track whether an error message is to be displayed or not.
 
Constructor Summary
LoginListener()
           
 
Method Summary
 void actionPerformed(ActionEvent event)
          The default action listener implementation.
protected  void displayError(String title, String message)
          Display an error message indicating that the login failed.
abstract  Component getContent()
          Fetch the container component that is to be used to replace the current window contents after a successful login.
protected  LoginPane getView()
           
protected abstract  boolean login(String userName, String password)
          The method that implements the login mechanism.
protected  void replaceContent()
          Proceed after a successful login.
 
Methods inherited from class com.sptci.echo.login.AbstractListener
checkPassword, checkText, checkUserName, checkView, getLoginPane
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

displayError

protected boolean displayError
A flag used to track whether an error message is to be displayed or not. This flag should be set/cleared from the login(java.lang.String, java.lang.String) method. The actionPerformed(nextapp.echo.app.event.ActionEvent) method checks this flag and displays a standard error message or not depending upon the value of this flag.

Constructor Detail

LoginListener

public LoginListener()
Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)
The default action listener implementation. Sub-classes usually need only over-ride the other methods in this listener for precise control.

See Also:
login(java.lang.String, java.lang.String), replaceContent(), displayError

replaceContent

protected void replaceContent()
Proceed after a successful login.


displayError

protected void displayError(String title,
                            String message)
Display an error message indicating that the login failed.

Parameters:
title - The title to display for the error message.
message - The message content to display for the error message.

login

protected abstract boolean login(String userName,
                                 String password)
The method that implements the login mechanism.

Parameters:
userName - The user/login name to log on with.
password - The password to log on with.
Returns:
Return true if the login succeeds.

getContent

public abstract Component getContent()
Fetch the container component that is to be used to replace the current window contents after a successful login. Implementations may also perform any other component initialisation required to initiate the container or any other parent containers in the component hierarchy.

Returns:
The appropriate container component.

getView

protected LoginPane getView()
Returns:
Returns the login pane from which this action listener was triggered.

SPT Core API