org.appng.api

## Interface ApplicationConfigProvider

- All Superinterfaces:
    AutoCloseable, Closeable
  All Known Implementing Classes:
    ApplicationConfigProviderImpl

      public interface ApplicationConfigProvider
      extends Closeable

  Provides the basic configuration of a `Application`, which is the `ApplicationInfo` parsed from the `application-info.xml` and all defined `PageDefinition`s, `Event`s, `Action`s, `Datasource`s and also the `ApplicationRootConfig`.
  Author:
    Matthias Müller

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ApplicationConfigProvider` | `cloneConfig(MarshallService marshallService)` Clones this `ApplicationConfigProvider`, which is necessary because the
    `void` | `close()`
    `Action` | `getAction(String eventId, String actionId)` Returns the `Action` with the given `actionId`, which belongs to the `Event` with the given `eventId`.
    `Map<String,Action>` | `getActions(String eventId)` Returns a map of all `Action`s for the `Event` with the given id, using the id as the key.
    `ApplicationInfo` | `getApplicationInfo()` Returns the `ApplicationInfo` for the `Application`, parsed from `application-info.xml`
    `ApplicationRootConfig` | `getApplicationRootConfig()` Returns the `ApplicationRootConfig`.
    `Datasource` | `getDatasource(String id)` Returns the `Datasource` with the given id, if present.
    `Map<String,Datasource>` | `getDataSources()` Returns a map of all `Datasource`s, using the id as the key.
    `String` | `getDefaultPage()` Returns the id of the default-page, which is the `PageDefinition` with the type '`index`'.
    `Event` | `getEvent(String id)` Returns the `Event` with the given id, if present.
    `Set<String>` | `getEventIds()` Returns all ids from all known `Event`s
    `PageDefinition` | `getPage(String id)` Returns the `PageDefinition` with the given id, if present.
    `Map<String,PageDefinition>` | `getPages()` Returns a map of all `PageDefinition`s, using the id as the key.
    `String` | `getResourceNameForApplicationRootConfig()` Returns the name of the `Resource` where the `ApplicationRootConfig` was defined.
    `String` | `getResourceNameForDataSource(String dataSourceId)` Returns the name of the `Resource` where the `Datasource` with the given id was defined.
    `String` | `getResourceNameForEvent(String eventId)` Returns the name of the `Resource` where the `Event` with the given id was defined.
    `String` | `getResourceNameForPage(String pageId)` Returns the name of the `Resource` where the `PageDefinition` with the given id was defined.
    `Resources` | `getResources()`

- - ### Method Detail

    - #### cloneConfig

          ApplicationConfigProvider cloneConfig(MarshallService marshallService)
                                         throws InvalidConfigurationException

      Clones this `ApplicationConfigProvider`, which is necessary because the
      Parameters:
        `marshallService` - a `MarshallService` to read the configuration files, only needed if appNG is in development-mode
      Returns:
        a new ApplicationConfigProvider
      Throws:
        `InvalidConfigurationException` - if there is some configuration error inside the application

    - #### getApplicationRootConfig

          ApplicationRootConfig getApplicationRootConfig()

      Returns the `ApplicationRootConfig`.
      Returns:
        the `ApplicationRootConfig`

    - #### getDefaultPage

          String getDefaultPage()

      Returns the id of the default-page, which is the `PageDefinition` with the type '`index`'.
      Returns:
        the id of the default-page

    - #### getPage

          PageDefinition getPage(String id)

      Returns the `PageDefinition` with the given id, if present.
      Parameters:
        `id` - the id of the `PageDefinition` to get
      Returns:
        the `PageDefinition` with the given id, or `null` if no such `PageDefinition` exists

    - #### getPages

          Map<String,PageDefinition> getPages()

      Returns a map of all `PageDefinition`s, using the id as the key.
      Returns:
        a map of all `PageDefinition`s

    - #### getEvent

          Event getEvent(String id)

      Returns the `Event` with the given id, if present.
      Parameters:
        `id` - the id of the `Event` to get
      Returns:
        the `Event` with the given id, or `null` if no such `Event` exists

    - #### getDatasource

          Datasource getDatasource(String id)

      Returns the `Datasource` with the given id, if present.
      Parameters:
        `id` - the id of the `Datasource` to get
      Returns:
        the `Datasource` with the given id, or `null` if no such `Datasource` exists

    - #### getAction

          Action getAction(String eventId,
                           String actionId)

      Returns the `Action` with the given `actionId`, which belongs to the `Event` with the given `eventId`.
      Parameters:
        `eventId` - the id of the `Event`
        `actionId` - the id of the `Action`
      Returns:
        the `Action`, or `null` if there is no such `Event` or `Action`

    - #### getActions

          Map<String,Action> getActions(String eventId)

      Returns a map of all `Action`s for the `Event` with the given id, using the id as the key.
      Parameters:
        `eventId` - the id of the `Event` to get the `Action`s for
      Returns:
        a map of all `Action`s for the given `Event`, or `null` if there is no such event

    - #### getDataSources

          Map<String,Datasource> getDataSources()

      Returns a map of all `Datasource`s, using the id as the key.
      Returns:
        a map of all `Datasource`s

    - #### getResourceNameForEvent

          String getResourceNameForEvent(String eventId)

      Returns the name of the `Resource` where the `Event` with the given id was defined.
      Parameters:
        `eventId` - the id of the `Event`
      Returns:
        the name of the `Resource` where the `Event` with the given id was defined, or `null` if there is no such `Event`

    - #### getResourceNameForPage

          String getResourceNameForPage(String pageId)

      Returns the name of the `Resource` where the `PageDefinition` with the given id was defined.
      Parameters:
        `pageId` - the id of the `PageDefinition`
      Returns:
        the name of the `Resource` where the `PageDefinition` with the given id was defined, or `null` if there is no such `PageDefinition`

    - #### getResourceNameForDataSource

          String getResourceNameForDataSource(String dataSourceId)

      Returns the name of the `Resource` where the `Datasource` with the given id was defined.
      Parameters:
        `dataSourceId` - the id of the `Datasource`
      Returns:
        the name of the `Resource` where the `Datasource` with the given id was defined, or `null` if there is no such `Datasource`

    - #### getResourceNameForApplicationRootConfig

          String getResourceNameForApplicationRootConfig()

      Returns the name of the `Resource` where the `ApplicationRootConfig` was defined.
      Returns:
        the name of the `Resource` where the `ApplicationRootConfig` was defined.

    - #### getApplicationInfo

          ApplicationInfo getApplicationInfo()

      Returns the `ApplicationInfo` for the `Application`, parsed from `application-info.xml`
      Returns:
        the `ApplicationInfo`

    - #### getResources

          Resources getResources()

    - #### close

          void close()
              throws IOException

      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `Closeable`
      Throws:
        `IOException`

    - #### getEventIds

          Set<String> getEventIds()

      Returns all ids from all known `Event`s
      Returns:

Copyright © 2011–2023 aiticon GmbH. All rights reserved.