com.tibbo.aggregate.common.plugin

## Interface AggreGatePlugin

- All Known Subinterfaces:
    AuthenticationPlugin, ContextPlugin, DeviceDriver
  All Known Implementing Classes:
    AbstractAuthenticationPlugin, AbstractContextPlugin, AbstractDeviceDriver, AuthenticationPluginDecorator, BasePlugin, DemoDeviceDriver, DemoServerPlugin, ExtensionsPlugin

      public interface AggreGatePlugin

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Context` | `createGlobalConfigContext(Context rootContext, boolean requestReboot, VariableDefinition... properties)` This method creates and returns context containing plugin's global configuration.
    `Context` | `createUserConfigContext(Context userContext, boolean requestReboot, VariableDefinition... properties)` This method creates and returns context containing plugin's user-level configuration.
    `java.lang.String` | `getDescription()` Returns plugin description
    `Context` | `getGlobalConfigContext()` Returns plugin's global configuration context
    `java.lang.String` | `getId()` Returns plugin ID
    `java.lang.String` | `getShortId()` Returns plugin short ID (last "segment" of full ID).
    `int` | `getSortIndex()` Returns sort index used to sort plugins in the list.
    `Context` | `getUserConfigContext(java.lang.String username)` Returns plugin's user-level configuration context or NULL if user-level configuration is disabled for the user.
    `void` | `globalDeinit(Context rootContext)` This method is called once during server shutdown.
    `void` | `globalInit(Context rootContext)` This method is called once during server startup.
    `void` | `globalStart()` This method is called once for every plugin at the moment when server context tree is fully initialized and all contexts are available.
    `void` | `globalStop()` This method is called once for every plugin upon server shutdown.
    `void` | `userDeinit(Context userContext)` This method is called once for every system user upon its deletion or server shutdown.
    `void` | `userInit(Context userContext)` This method is called once for every system user upon its creation or server startup.

- - ### Method Detail

    - #### getId

          java.lang.String getId()

      Returns plugin ID
      Returns:
        Plugin ID

    - #### getShortId

          java.lang.String getShortId()

      Returns plugin short ID (last "segment" of full ID).
      Returns:
        Plugin short ID

    - #### getDescription

          java.lang.String getDescription()

      Returns plugin description
      Returns:
        Plugin description

    - #### getSortIndex

          int getSortIndex()

      Returns sort index used to sort plugins in the list. Plugins with zero sort index are used according to their descriptions.
      Returns:
        Plugin sort index

    - #### globalInit

          void globalInit(Context rootContext)
                   throws PluginException

      This method is called once during server startup. Its implementation will in most cases call createGlobalConfigContext() to create plugin global configuration. Another typical use is opening some listening server socket to accept connections or receive network datagrams. Note, that this method is called during server context tree initialization. Not all server contexts may be available at the time of its call. To access any server context during plugin startup, override globalStart() method.
      Throws:
        `PluginException` - If an error occurred during initialization

    - #### userInit

          void userInit(Context userContext)
                 throws PluginException

      This method is called once for every system user upon its creation or server startup. Its implementation will in most cases call createUserConfigContext() to create plugin user-level configuration. This method won't be called if user-level configuration is disabled for the user.
      Throws:
        `PluginException` - If an error occurred during initialization

    - #### globalDeinit

          void globalDeinit(Context rootContext)
                     throws PluginException

      This method is called once during server shutdown. It's usually used to terminate any threads created by the plugin and close all server sockets opened by it.
      Throws:
        `PluginException` - If an error occurred during de-initialization

    - #### userDeinit

          void userDeinit(Context userContext)
                   throws PluginException

      This method is called once for every system user upon its deletion or server shutdown. The method will be called even if user-level configuration is disabled for the user.
      Throws:
        `PluginException` - If an error occurred during de-initialization

    - #### globalStart

          void globalStart()
                    throws PluginException

      This method is called once for every plugin at the moment when server context tree is fully initialized and all contexts are available.
      Throws:
        `PluginException` - If an error occurred during plugin startup

    - #### globalStop

          void globalStop()
                   throws PluginException

      This method is called once for every plugin upon server shutdown.
      Throws:
        `PluginException` - If an error occurred during plugin shutdown

    - #### createGlobalConfigContext

          Context createGlobalConfigContext(Context rootContext,
                                            boolean requestReboot,
                                            VariableDefinition... properties)

      This method creates and returns context containing plugin's global configuration. There is no need to keep reference to this context for future use as it may be accessed via getGlobalConfigContext() method.
      Parameters:
        `rootContext` - Server root context
        `requestReboot` - Prompt an operator to reboot server after a global plugin property change
        `properties` - List of global plugin properties
      Returns:
        Plugin global config context

    - #### createUserConfigContext

          Context createUserConfigContext(Context userContext,
                                          boolean requestReboot,
                                          VariableDefinition... properties)

      This method creates and returns context containing plugin's user-level configuration. There is no need to keep reference to this context for future use as it may be accessed via getUserConfigContext() method.
      Parameters:
        `userContext` - Context of user to associate the configuration with
        `requestReboot` - Prompt an operator to reboot server after a global plugin property change
        `properties` - List of user-level plugin properties
      Returns:
        Plugin user-level config context

    - #### getGlobalConfigContext

          Context getGlobalConfigContext()

      Returns plugin's global configuration context
      Returns:
        Global configuration context

    - #### getUserConfigContext

          Context getUserConfigContext(java.lang.String username)

      Returns plugin's user-level configuration context or NULL if user-level configuration is disabled for the user.
      Returns:
        User-level configuration context