Class LoginAssistantComponent


  • public class LoginAssistantComponent
    extends java.lang.Object

    Overview

    The Login Assistant component is a helper class that assist developers in creating a solid database-driven login system without the hassle of writing your own database access code.

    In a nutshell this is how it works:

    1. Configure the DBManager in your application's Zone
    2. Instantiate the component in the init() method of your Extension
    3. Configure the component

    Simple example of usage

    Supposing we have a database table called muppets containing a name and pword fields we can use this code:
     public class MuppetsExtension extends SFSExtension
     {
            private LoginAssistantComponent lac;
            
            public void init()
            {
                    lac = new LoginAssistantComponent(this);
                    
                    // Configure the component
                    lac.getConfig().loginTable = "muppets";
                    lac.getConfig().userNameField = "name";
                    lac.getConfig().passwordField = "pword";
            }
            
            public void destroy()
            {
                    lac.destroy();
            }
     }
     
    NOTE: Always make sure to call the component's destroy() method inside your Extension's destroy() in order to release the component's resources.
    See Also:
    LoginConfiguration
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()
      Releases the Component's resources.
      LoginConfiguration getConfig()
      Obtain the configuration object that allows to setup all the parameters of the Login process.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LoginAssistantComponent

        public LoginAssistantComponent​(ISFSExtension ext)
    • Method Detail

      • destroy

        public void destroy()
        Releases the Component's resources.

        NOTE: Always make sure to call the component's destroy() method inside your Extension's destroy() in order to release the component's resources.

      • getConfig

        public LoginConfiguration getConfig()
        Obtain the configuration object that allows to setup all the parameters of the Login process.
        Returns:
        the LoginAssistant's current configuration