Class Logout

java.lang.Object
rife.authentication.elements.Logout
All Implemented Interfaces:
Element

public class Logout extends Object implements Element
Provides logout logic with an optional template that can be printed for configuration.

To customize the behavior of the authentication, it's the easiest to override one of the hook methods.

Since:
1.0
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    This constructor is meant to be used when extending the Logout element with your custom logout class.
     
    This constructor is meant to be used when the Logout element is used directly as a route in your site.
     
    Logout(AuthConfig config, Template template)
    This constructor is meant to be used when the Logout element is used directly as a route in your site.
  • Method Summary

    Modifier and Type
    Method
    Description
    Hook method that is called to retrieve the AuthConfig to use.
    protected Template
    Hook method that is called to create the template instance.
    protected void
    Hook method that is called at the start of the element's processing.
    protected void
    loggedOut(Template template)
    Hook method that is called after logging out and before printing the template.
    void
    Process the provided Context with this element.

    Methods inherited from class java.lang.Object

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

    • Logout

      protected Logout()
      This constructor is meant to be used when extending the Logout element with your custom logout class.

      Don't forget to also override the `getAuthConfig()` and `getTemplate()` methods.

      Since:
      1.0
    • Logout

      public Logout(AuthConfig config)
      This constructor is meant to be used when the Logout element is used directly as a route in your site.

      When extending this element, use the default constructor instead and override the `getAuthConfig()` and `getTemplate()` methods.

      Parameters:
      config - the auth config to use
      Since:
      1.0
    • Logout

      public Logout(AuthConfig config, Template template)
      This constructor is meant to be used when the Logout element is used directly as a route in your site.

      When extending this element, use the default constructor instead and override the `getAuthConfig()` and `getTemplate()` methods.

      Parameters:
      config - the auth config to use
      template - the template instance blueprint to use
      Since:
      1.0
  • Method Details

    • getAuthConfig

      public AuthConfig getAuthConfig()
      Hook method that is called to retrieve the AuthConfig to use.
      Returns:
      the config to use for authentication
      Since:
      1.0
    • getTemplate

      protected Template getTemplate()
      Hook method that is called to create the template instance.
      Returns:
      the template to use for logout
      Since:
      1.0
    • initializeLogout

      protected void initializeLogout(Context c)
      Hook method that is called at the start of the element's processing.
      Parameters:
      c - the element processing context
      Since:
      1.0
    • loggedOut

      protected void loggedOut(Template template)
      Hook method that is called after logging out and before printing the template.
      Parameters:
      template - the template that will be printed; or null if no template was set up
      Since:
      1.0
    • process

      public void process(Context c) throws Exception
      Description copied from interface: Element
      Process the provided Context with this element.
      Specified by:
      process in interface Element
      Parameters:
      c - the provided request/response context
      Throws:
      Exception - when an error occurs