tigase.component.modules

## Class ModulesManager

- java.lang.Object
- - tigase.component.modules.ModulesManager

- All Implemented Interfaces:
    ModuleProvider

      public class ModulesManager
      extends Object
      implements ModuleProvider

  Implementation of modules provider. It keeps all registered modules and decides what modules may handle incoming stanza.
  Author:
    bmalkow

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ModulesManager(Context context)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<String>` | `getAvailableFeatures()` Returns features offered by registered modules.
    `<T extends Module> T` | `getModule(String id)` Return module implementation by module identifier.
    `List<Module>` | `getModules()` Returns list of all registered `modules` in current component.
    `Collection<String>` | `getModulesId()` Returns collection of identifiers of registered `modules`.
    `void` | `initIfRequired()`
    `boolean` | `isRegistered(Module module)`
    `boolean` | `isRegistered(String id)`
    `boolean` | `process(Packet packet)`
    `<T extends Module> T` | `register(String id, T module)`
    `void` | `reset()`
    `void` | `unregister(Module module)`
    `void` | `unregister(String id)`

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

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

- - ### Constructor Detail

    - #### ModulesManager

          public ModulesManager(Context context)

  - ### Method Detail

    - #### getAvailableFeatures

          public Set<String> getAvailableFeatures()

      Description copied from interface: `ModuleProvider`
      Returns features offered by registered modules.
      Specified by:
        `getAvailableFeatures` in interface `ModuleProvider`
      Returns:
        collection of available features.

    - #### getModule

          public <T extends Module> T getModule(String id)

      Description copied from interface: `ModuleProvider`
      Return module implementation by module identifier.
      Specified by:
        `getModule` in interface `ModuleProvider`
      Parameters:
        `id` - identifier
      Returns:
        module implementation.

    - #### getModules

          public List<Module> getModules()

      Description copied from interface: `ModuleProvider`
      Returns list of all registered `modules` in current component.
      Specified by:
        `getModules` in interface `ModuleProvider`
      Returns:
        list of modules.

    - #### getModulesId

          public Collection<String> getModulesId()

      Description copied from interface: `ModuleProvider`
      Returns collection of identifiers of registered `modules`.
      Specified by:
        `getModulesId` in interface `ModuleProvider`
      Returns:
        list of modules ID.

    - #### initIfRequired

          public void initIfRequired()

    - #### isRegistered

          public boolean isRegistered(Module module)

    - #### isRegistered

          public boolean isRegistered(String id)

    - #### process

          public boolean process(Packet packet)
                          throws ComponentException,
                                 TigaseStringprepException

      Throws:
        `ComponentException`
        `TigaseStringprepException`

    - #### register

          public <T extends Module> T register(String id,
                                               T module)

    - #### reset

          public void reset()

    - #### unregister

          public void unregister(Module module)

    - #### unregister

          public void unregister(String id)

Copyright © 2018 "Tigase, Inc.". All rights reserved.