tigase.jaxmpp.core.client.xmpp.modules.auth

## Class AuthModule

- java.lang.Object
- - tigase.jaxmpp.core.client.xmpp.modules.auth.AuthModule

- All Implemented Interfaces:
    ContextAware, InitializingModule, XmppModule

      public class AuthModule
      extends Object
      implements XmppModule, ContextAware, InitializingModule

  Module used for authentication. This module automatically selects better authentication module to use. Currently it choose between SaslModule and NonSaslAuthModule.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `AuthModule.AuthFailedHandler`
    `static interface` | `AuthModule.AuthStartHandler`
    `static interface` | `AuthModule.AuthSuccessHandler`
    `static class` | `AuthModule.DefaultCredentialsCallback`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `AUTHORIZED`
    `static String` | `CREDENTIALS_CALLBACK`
    `static String` | `FORCE_NON_SASL` If `true` then Non-SASL (XEP-0078) mechanism is used.
    `static String` | `LOGIN_USER_NAME_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AuthModule()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAuthFailedHandler(AuthModule.AuthFailedHandler handler)`
    `void` | `addAuthStartHandler(AuthModule.AuthStartHandler handler)`
    `void` | `addAuthSuccessHandler(AuthModule.AuthSuccessHandler handler)`
    `<H extends EventHandler> void` | `addListener(Class<? extends Event<H>> type, EventListener listener)`
    `<H extends EventHandler> void` | `addListener(EventListener listener)`
    `void` | `afterRegister()` Called when module is registered.
    `void` | `beforeRegister()` Called just before registration module in XmppModulesManager .
    `void` | `beforeUnregister()` Called when module is unregistered.
    `Criteria` | `getCriteria()` Criteria
    `String[]` | `getFeatures()` Returns features what are implemented by Module.
    `static boolean` | `isAuthAvailable(SessionObject sessionObject)`
    `void` | `login()`
    `void` | `process(Element element)` Main method of module.
    `void` | `remove(Class<? extends Event<?>> type, EventHandler handler)`
    `void` | `remove(EventHandler handler)`
    `void` | `removeAuthFailedHandler(AuthModule.AuthFailedHandler handler)`
    `void` | `removeAuthStartHandler(AuthModule.AuthStartHandler handler)`
    `void` | `removeAuthSuccessHandler(AuthModule.AuthSuccessHandler handler)`
    `void` | `setContext(Context context)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### AUTHORIZED

          public static final String AUTHORIZED

      See Also:
        Constant Field Values

    - #### CREDENTIALS_CALLBACK

          public static final String CREDENTIALS_CALLBACK

      See Also:
        Constant Field Values

    - #### FORCE_NON_SASL

          public static final String FORCE_NON_SASL

      If `true` then Non-SASL (XEP-0078) mechanism is used.
      Type: `Boolean`
      See Also:
        Constant Field Values

    - #### LOGIN_USER_NAME_KEY

          public static final String LOGIN_USER_NAME_KEY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AuthModule

          public AuthModule()

  - ### Method Detail

    - #### isAuthAvailable

          public static boolean isAuthAvailable(SessionObject sessionObject)
                                         throws XMLException

      Throws:
        `XMLException`

    - #### addAuthFailedHandler

          public void addAuthFailedHandler(AuthModule.AuthFailedHandler handler)

    - #### addAuthStartHandler

          public void addAuthStartHandler(AuthModule.AuthStartHandler handler)

    - #### addAuthSuccessHandler

          public void addAuthSuccessHandler(AuthModule.AuthSuccessHandler handler)

    - #### addListener

          public <H extends EventHandler> void addListener(Class<? extends Event<H>> type,
                                                           EventListener listener)

    - #### addListener

          public <H extends EventHandler> void addListener(EventListener listener)

    - #### afterRegister

          public void afterRegister()

      Description copied from interface: `InitializingModule`
      Called when module is registered. At this moment module is formally registered and it is part of client.
      Specified by:
        `afterRegister` in interface `InitializingModule`

    - #### beforeRegister

          public void beforeRegister()

      Description copied from interface: `InitializingModule`
      Called just before registration module in XmppModulesManager . It is good place to check if module is initialized properly.
      Specified by:
        `beforeRegister` in interface `InitializingModule`

    - #### beforeUnregister

          public void beforeUnregister()

      Description copied from interface: `InitializingModule`
      Called when module is unregistered.
      Specified by:
        `beforeUnregister` in interface `InitializingModule`

    - #### getCriteria

          public Criteria getCriteria()

      Description copied from interface: `XmppModule`
      Criteria
      Specified by:
        `getCriteria` in interface `XmppModule`
      Returns:

    - #### getFeatures

          public String[] getFeatures()

      Description copied from interface: `XmppModule`

      Returns features what are implemented by Module.

      See Service Discovery Features

      Specified by:
        `getFeatures` in interface `XmppModule`
      Returns:
        array of features

    - #### login

          public void login()
                     throws JaxmppException

      Throws:
        `JaxmppException`

    - #### process

          public void process(Element element)
                       throws JaxmppException

      Description copied from interface: `XmppModule`
      Main method of module. Module will process incoming stanza by call this method.
      Specified by:
        `process` in interface `XmppModule`
      Parameters:
        `element` - incoming XMPP stanza
      Throws:
        `JaxmppException`

    - #### remove

          public void remove(Class<? extends Event<?>> type,
                             EventHandler handler)

    - #### remove

          public void remove(EventHandler handler)

    - #### removeAuthFailedHandler

          public void removeAuthFailedHandler(AuthModule.AuthFailedHandler handler)

    - #### removeAuthStartHandler

          public void removeAuthStartHandler(AuthModule.AuthStartHandler handler)

    - #### removeAuthSuccessHandler

          public void removeAuthSuccessHandler(AuthModule.AuthSuccessHandler handler)

    - #### setContext

          public void setContext(Context context)

      Specified by:
        `setContext` in interface `ContextAware`

Copyright © 2006–2020 Tigase. All rights reserved.