org.appng.core.model

## Class ApplicationProvider

- java.lang.Object
- - org.appng.core.domain.SiteApplication
  - - org.appng.core.model.ApplicationProvider

- All Implemented Interfaces:
    Serializable, Application, Identifiable<Integer>, Identifier, Nameable, Named<Integer>, Versionable<Date>, AccessibleApplication

      public class ApplicationProvider
      extends SiteApplication
      implements AccessibleApplication

  An `ApplicationProvider` actually processes the `ApplicationRequest` by building and executing `CallableAction`s and `CallableDataSource`s.
  Author:
    Matthias Müller
  See Also:
    `process(ApplicationRequest, MarshallService, Path, PlatformConfig)`, `CallableAction.perform()`, `CallableDataSource.perform(String, boolean, boolean)`, Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `ApplicationProvider.DataSourceWrapper`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ApplicationProvider(Site site, Application application)`
    `ApplicationProvider(Site site, Application application, boolean monitorPerformance)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkConditionsAndPermissions(ApplicationRequest applicationRequest, PageDefinition page)`
    `void` | `closeContext()`
    `boolean` | `containsBean(String beanName)` Checks whether a bean with the given name exists for this `Application`.
    `boolean` | `equals(Object o)`
    `Application` | `getApplication()`
    `ApplicationConfigProvider` | `getApplicationConfig()`
    `ApplicationRequest` | `getApplicationRequest(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)`
    `ApplicationRequest` | `getApplicationRequest(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, boolean createNew)`
    `List<ApplicationSubject>` | `getApplicationSubjects()` Returns the `ApplicationSubject`s for this `Application`
    `String` | `getAppNGVersion()` Returns the version of appNG the `Application` is compatible with.
    `<T> T` | `getBean(Class<T> clazz)` Returns the single bean of the given type, if any.
    `Object` | `getBean(String beanName)` Returns the single bean with the given name, if any.
    `<T> T` | `getBean(String name, Class<T> clazz)` Retrieves the bean of the given name and type from the underlying `ApplicationContext`, if any.
    `String[]` | `getBeanNames(Class<?> clazz)` Returns the names for all beans of the given type.
    `org.springframework.context.ConfigurableApplicationContext` | `getContext()`
    `DatabaseConnection` | `getDatabaseConnection()`
    `String` | `getDescription()` Returns the description.
    `String` | `getDisplayName()` Returns the display name.
    `FeatureProvider` | `getFeatureProvider()` Returns the `FeatureProvider` for this `Application`.
    `Integer` | `getId()` Returns the id.
    `List<JarInfo>` | `getJarInfos()`
    `String` | `getLongDescription()` Returns the description.
    `String` | `getMessage(Locale locale, String key, Object... args)` Retrieves a message from the underlying `MessageSource`.
    `String` | `getName()` Returns the name.
    `String` | `getPackageVersion()` Returns the version.
    `Set<Permission>` | `getPermissions()` Returns the `Permission`s for this `Application`.
    `Properties` | `getProperties()` Returns the `Properties`s for this `Application`.
    `Resources` | `getResources()` the `Resources` for this `Application`.
    `Set<Resource>` | `getResourceSet()` Returns the `Resource`s for this `Application`.
    `Set<Role>` | `getRoles()` Returns `Role`s for this `Application`.
    `String` | `getSessionParamKey(Site site)` Returns the key to retrieve the session-parameters for this `Application` within the given `Site` from an `Environment`.
    `Map<String,String>` | `getSessionParams(Site site, Environment environment)` Retrieves the session-parameters for for this `Application` within the given `Site` from the given `Environment`.
    `Site` | `getSite()`
    `String` | `getTimestamp()` Returns the timestamp the `Application` was build.
    `Date` | `getVersion()` Returns the version.
    `int` | `hashCode()`
    `boolean` | `isCoreApplication()` Deprecated.
    `boolean` | `isFileBased()` Returns `true` if this `Application` is filebased, which means it's original `Resource`s are stored on disk, `false` if the `Resource`s are stored in the database.
    `boolean` | `isHidden()` Returns `true` if this `Application` is hidden, which means it does not appear in the navigation menu.
    `boolean` | `isInstalled()` Checks whether the `Application` is installed.
    `boolean` | `isPrivileged()` Returns `true` if this `Application` is a privileged application, which means it has access to the platform's root context and the platform-scoped `Environment`.
    `boolean` | `isSnapshot()` Checks whether the `Application` has a SNAPSHOT-version
    `ApplicationReference` | `process(ApplicationRequest applicationRequest, MarshallService marshallService, Path pathInfo, PlatformConfig platformConfig)` Processes the `ApplicationRequest` by building and executing `CallableAction`s and `CallableDataSource`s.
    `Action` | `processAction(javax.servlet.http.HttpServletResponse servletResponse, boolean applyPermissionsOnRef, ApplicationRequest applicationRequest, String actionId, String eventId, MarshallService marshallService)`
    `Datasource` | `processDataSource(javax.servlet.http.HttpServletResponse servletResponse, boolean applyPermissionsOnRef, ApplicationRequest applicationRequest, String dataSourceId, MarshallService marshallService)`
    `PageReference` | `processPage(ApplicationRequest applicationRequest, MarshallService marshallService, Path pathInfo, String pageId, List<String> sectionIds, List<String> applicationUrlParameters)`
    `void` | `setApplicationConfig(ApplicationConfigProvider applicationConfig)`
    `void` | `setContext(org.springframework.context.ConfigurableApplicationContext applicationContext)`
    `void` | `setDatabaseConnection(DatabaseConnection databaseConnection)`
    `void` | `setDescription(String description)`
    `void` | `setFeatureProvider(FeatureProvider featureProvider)`
    `void` | `setFileBased(boolean fileBased)`
    `void` | `setId(Integer id)`
    `void` | `setName(String name)`
    `protected void` | `setParamValues(ApplicationRequest applicationRequest, Params params)`
    `void` | `setPermissions(Set<Permission> permissions)`
    `void` | `setPlatformScope(boolean enabled, Environment env)`
    `void` | `setPlatformScope(Environment env)`
    `void` | `setPrivileged(boolean isPrivileged)`
    `void` | `setProperties(Properties properties)`
    `void` | `setResources(Resources applicationResourceHolder)`
    `void` | `setRoles(Set<Role> roles)`
    `protected void` | `setSectionTitle(Section section, Label title)`
    `void` | `setVersion(Date version)`
    `String` | `toString()`

    - ### Methods inherited from class org.appng.core.domain.SiteApplication

      `getGrantedSites, getSiteApplicationId, isActive, isMarkedForDeletion, isReloadRequired, setActive, setApplication, setGrantedSites, setMarkedForDeletion, setReloadRequired, setSite, setSiteApplicationId`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ApplicationProvider

          public ApplicationProvider(Site site,
                                     Application application,
                                     boolean monitorPerformance)

    - #### ApplicationProvider

          public ApplicationProvider(Site site,
                                     Application application)

  - ### Method Detail

    - #### process

          public ApplicationReference process(ApplicationRequest applicationRequest,
                                              MarshallService marshallService,
                                              Path pathInfo,
                                              PlatformConfig platformConfig)

      Processes the `ApplicationRequest` by building and executing `CallableAction`s and `CallableDataSource`s.
      Parameters:
        `applicationRequest` - the `ApplicationRequest` to process
        `marshallService` - a `MarshallService`
        `pathInfo` - the current `Path`
        `platformConfig` - the current `PlatformConfig`
      Returns:
        the `ApplicationReference` to be used for the `Content` of the `Platform`

    - #### checkConditionsAndPermissions

          protected void checkConditionsAndPermissions(ApplicationRequest applicationRequest,
                                                       PageDefinition page)

    - #### processPage

          public PageReference processPage(ApplicationRequest applicationRequest,
                                           MarshallService marshallService,
                                           Path pathInfo,
                                           String pageId,
                                           List<String> sectionIds,
                                           List<String> applicationUrlParameters)

    - #### setSectionTitle

          protected void setSectionTitle(Section section,
                                         Label title)

    - #### setApplicationConfig

          public void setApplicationConfig(ApplicationConfigProvider applicationConfig)
                                    throws InvalidConfigurationException

      Throws:
        `InvalidConfigurationException`

    - #### getId

          public Integer getId()

      Description copied from interface: `Identifiable`
      Returns the id.
      Specified by:
        `getId` in interface `Identifiable<Integer>`
      Returns:
        the id

    - #### setId

          public void setId(Integer id)

      Specified by:
        `setId` in interface `AccessibleApplication`

    - #### getName

          public String getName()

      Description copied from interface: `Nameable`
      Returns the name.
      Specified by:
        `getName` in interface `Nameable`
      Returns:
        the name

    - #### setName

          public void setName(String name)

      Specified by:
        `setName` in interface `AccessibleApplication`

    - #### getDescription

          public String getDescription()

      Description copied from interface: `Nameable`
      Returns the description.
      Specified by:
        `getDescription` in interface `Nameable`
      Returns:
        the description

    - #### setDescription

          public void setDescription(String description)

      Specified by:
        `setDescription` in interface `AccessibleApplication`

    - #### getDisplayName

          public String getDisplayName()

      Description copied from interface: `Identifier`
      Returns the display name.
      Specified by:
        `getDisplayName` in interface `Identifier`
      Returns:
        the display name

    - #### getPackageVersion

          public String getPackageVersion()

      Description copied from interface: `Identifier`
      Returns the version.
      Specified by:
        `getPackageVersion` in interface `Identifier`
      Returns:
        the version

    - #### getTimestamp

          public String getTimestamp()

      Description copied from interface: `Identifier`
      Returns the timestamp the `Application` was build.
      Specified by:
        `getTimestamp` in interface `Identifier`
      Returns:
        the timestamp the `Application` was build

    - #### getLongDescription

          public String getLongDescription()

      Description copied from interface: `Identifier`
      Returns the description.
      Specified by:
        `getLongDescription` in interface `Identifier`
      Returns:
        the description

    - #### getAppNGVersion

          public String getAppNGVersion()

      Description copied from interface: `Identifier`
      Returns the version of appNG the `Application` is compatible with.
      Specified by:
        `getAppNGVersion` in interface `Identifier`
      Returns:
        the version of appNG the `Application` is compatible with

    - #### isInstalled

          public boolean isInstalled()

      Description copied from interface: `Identifier`
      Checks whether the `Application` is installed.
      Specified by:
        `isInstalled` in interface `Identifier`
      Returns:
        `true` if the `Application` is installed, `false` otherwise

    - #### isSnapshot

          public boolean isSnapshot()

      Description copied from interface: `Identifier`
      Checks whether the `Application` has a SNAPSHOT-version
      Specified by:
        `isSnapshot` in interface `Identifier`
      Returns:
        `true` if the `Application` has a SNAPSHOT-version, `false` otherwise

    - #### isFileBased

          public boolean isFileBased()

      Description copied from interface: `Application`
      Returns `true` if this `Application` is filebased, which means it's original `Resource`s are stored on disk, `false` if the `Resource`s are stored in the database.
      Specified by:
        `isFileBased` in interface `Application`
      Returns:
        `true` if this `Application` is filebased, `false` otherwise

    - #### setFileBased

          public void setFileBased(boolean fileBased)

      Specified by:
        `setFileBased` in interface `AccessibleApplication`

    - #### getVersion

          public Date getVersion()

      Description copied from interface: `Versionable`
      Returns the version.
      Specified by:
        `getVersion` in interface `Versionable<Date>`
      Returns:
        the version

    - #### setVersion

          public void setVersion(Date version)

      Specified by:
        `setVersion` in interface `AccessibleApplication`

    - #### getPermissions

          public Set<Permission> getPermissions()

      Description copied from interface: `Application`
      Returns the `Permission`s for this `Application`.
      Specified by:
        `getPermissions` in interface `Application`
      Returns:
        the `Permission`s

    - #### setPermissions

          public void setPermissions(Set<Permission> permissions)

      Specified by:
        `setPermissions` in interface `AccessibleApplication`

    - #### getRoles

          public Set<Role> getRoles()

      Description copied from interface: `Application`
      Returns `Role`s for this `Application`.
      Specified by:
        `getRoles` in interface `Application`
      Returns:
        the `Role`s

    - #### setRoles

          public void setRoles(Set<Role> roles)

      Specified by:
        `setRoles` in interface `AccessibleApplication`

    - #### getProperties

          public Properties getProperties()

      Description copied from interface: `Application`
      Returns the `Properties`s for this `Application`.
      Specified by:
        `getProperties` in interface `Application`
      Returns:
        the `Properties`s

    - #### setProperties

          public void setProperties(Properties properties)

      Specified by:
        `setProperties` in interface `AccessibleApplication`

    - #### setContext

          public void setContext(org.springframework.context.ConfigurableApplicationContext applicationContext)

      Specified by:
        `setContext` in interface `AccessibleApplication`

    - #### getBean

          public <T> T getBean(String name,
                               Class<T> clazz)

      Description copied from interface: `Application`
      Retrieves the bean of the given name and type from the underlying `ApplicationContext`, if any.
      Specified by:
        `getBean` in interface `Application`
      Parameters:
        `name` - the name of the bean to retrieve
        `clazz` - the type of the bean to retrieve
      Returns:
        the bean with the given name of the given type, if any.

    - #### getBean

          public <T> T getBean(Class<T> clazz)

      Description copied from interface: `Application`
      Returns the single bean of the given type, if any.
      Specified by:
        `getBean` in interface `Application`
      Parameters:
        `clazz` - the type of the bean
      Returns:
        the bean of the given type, or `null` if no such bean exists.

    - #### getBean

          public Object getBean(String beanName)

      Description copied from interface: `Application`
      Returns the single bean with the given name, if any.
      Specified by:
        `getBean` in interface `Application`
      Parameters:
        `beanName` - the name of the bean
      Returns:
        the bean with the given name, or `null` if no such bean exists.

    - #### getBeanNames

          public String[] getBeanNames(Class<?> clazz)

      Description copied from interface: `Application`
      Returns the names for all beans of the given type.
      Specified by:
        `getBeanNames` in interface `Application`
      Parameters:
        `clazz` - the type to get the bean names for
      Returns:
        the bean names

    - #### isPrivileged

          public boolean isPrivileged()

      Description copied from interface: `Application`
      Returns `true` if this `Application` is a privileged application, which means it has access to the platform's root context and the platform-scoped `Environment`.
      Specified by:
        `isPrivileged` in interface `Application`
      Returns:
        `true` if this `Application` is a privileged application, `false` otherwise

    - #### isCoreApplication

          @Deprecated
          public boolean isCoreApplication()

      Deprecated.
      Description copied from interface: `Application`
      Returns `true` if this `Application` is a privileged application, which means it has access to the platform's root context and the platform-scoped `Environment`.
      Specified by:
        `isCoreApplication` in interface `Application`
      Returns:
        `true` if this `Application` is a privileged application, `false` otherwise

    - #### setPrivileged

          public void setPrivileged(boolean isPrivileged)

      Specified by:
        `setPrivileged` in interface `AccessibleApplication`

    - #### getMessage

          public String getMessage(Locale locale,
                                   String key,
                                   Object... args)

      Description copied from interface: `Application`
      Retrieves a message from the underlying `MessageSource`.
      Specified by:
        `getMessage` in interface `Application`
      Parameters:
        `locale` - the `Locale` for the message
        `key` - the message-key
        `args` - the arguments for the message
      Returns:
        the message
      See Also:
        `ResourceType.DICTIONARY`

    - #### getJarInfos

          public List<JarInfo> getJarInfos()

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### closeContext

          public void closeContext()

      Specified by:
        `closeContext` in interface `AccessibleApplication`

    - #### setResources

          public void setResources(Resources applicationResourceHolder)

      Specified by:
        `setResources` in interface `AccessibleApplication`

    - #### getResources

          public Resources getResources()

      Description copied from interface: `Application`
      the `Resources` for this `Application`.
      Specified by:
        `getResources` in interface `Application`
      Specified by:
        `getResources` in interface `AccessibleApplication`
      Returns:
        the `Resources` for this `Application`

    - #### isHidden

          public boolean isHidden()

      Description copied from interface: `Application`
      Returns `true` if this `Application` is hidden, which means it does not appear in the navigation menu.
      Specified by:
        `isHidden` in interface `Application`
      Returns:
        `true` if this `Application` is hidden

    - #### containsBean

          public boolean containsBean(String beanName)

      Description copied from interface: `Application`
      Checks whether a bean with the given name exists for this `Application`.
      Specified by:
        `containsBean` in interface `Application`
      Parameters:
        `beanName` - the name of the bean to check existence
      Returns:
        `true` if such a bean exists, `false` otherwise

    - #### getApplicationConfig

          public ApplicationConfigProvider getApplicationConfig()

    - #### getSessionParamKey

          public String getSessionParamKey(Site site)

      Description copied from interface: `Application`
      Returns the key to retrieve the session-parameters for this `Application` within the given `Site` from an `Environment`.
      Specified by:
        `getSessionParamKey` in interface `Application`
      Parameters:
        `site` - the `Site` to retrieve the key for
      Returns:
        the key to retrieve the session-parameters
      See Also:
        `Application.getSessionParams(Site, Environment)`

    - #### getSessionParams

          public Map<String,String> getSessionParams(Site site,
                                                     Environment environment)

      Description copied from interface: `Application`
      Retrieves the session-parameters for for this `Application` within the given `Site` from the given `Environment`.
      Specified by:
        `getSessionParams` in interface `Application`
      Parameters:
        `site` - the `Site` to retrieve the session parameters for
        `environment` - the current `Environment`
      Returns:
        the session-parameters for this `Application` within the given `Site`
      See Also:
        `Application.getSessionParamKey(Site)`

    - #### getFeatureProvider

          public FeatureProvider getFeatureProvider()

      Description copied from interface: `Application`
      Returns the `FeatureProvider` for this `Application`.
      Specified by:
        `getFeatureProvider` in interface `Application`
      Returns:
        the `FeatureProvider`

    - #### setFeatureProvider

          public void setFeatureProvider(FeatureProvider featureProvider)

      Specified by:
        `setFeatureProvider` in interface `AccessibleApplication`

    - #### getApplicationSubjects

          public List<ApplicationSubject> getApplicationSubjects()

      Description copied from interface: `Application`
      Returns the `ApplicationSubject`s for this `Application`
      Specified by:
        `getApplicationSubjects` in interface `Application`
      Returns:
        the `ApplicationSubject`s

    - #### getApplicationRequest

          public ApplicationRequest getApplicationRequest(javax.servlet.http.HttpServletRequest servletRequest,
                                                          javax.servlet.http.HttpServletResponse servletResponse)

    - #### getApplicationRequest

          public ApplicationRequest getApplicationRequest(javax.servlet.http.HttpServletRequest servletRequest,
                                                          javax.servlet.http.HttpServletResponse servletResponse,
                                                          boolean createNew)

    - #### processAction

          public Action processAction(javax.servlet.http.HttpServletResponse servletResponse,
                                      boolean applyPermissionsOnRef,
                                      ApplicationRequest applicationRequest,
                                      String actionId,
                                      String eventId,
                                      MarshallService marshallService)
                               throws InvalidConfigurationException,
                                      ProcessingException

      Throws:
        `InvalidConfigurationException`
        `ProcessingException`

    - #### setParamValues

          protected void setParamValues(ApplicationRequest applicationRequest,
                                        Params params)

    - #### processDataSource

          public Datasource processDataSource(javax.servlet.http.HttpServletResponse servletResponse,
                                              boolean applyPermissionsOnRef,
                                              ApplicationRequest applicationRequest,
                                              String dataSourceId,
                                              MarshallService marshallService)
                                       throws InvalidConfigurationException,
                                              ProcessingException

      Throws:
        `InvalidConfigurationException`
        `ProcessingException`

    - #### getContext

          public org.springframework.context.ConfigurableApplicationContext getContext()

      Specified by:
        `getContext` in interface `AccessibleApplication`

    - #### getApplication

          public Application getApplication()

      Overrides:
        `getApplication` in class `SiteApplication`

    - #### getSite

          public Site getSite()

      Overrides:
        `getSite` in class `SiteApplication`

    - #### getResourceSet

          public Set<Resource> getResourceSet()

      Description copied from interface: `Application`
      Returns the `Resource`s for this `Application`.
      Specified by:
        `getResourceSet` in interface `Application`
      Returns:
        the `Resource`s

    - #### setDatabaseConnection

          public void setDatabaseConnection(DatabaseConnection databaseConnection)

      Overrides:
        `setDatabaseConnection` in class `SiteApplication`

    - #### getDatabaseConnection

          public DatabaseConnection getDatabaseConnection()

      Overrides:
        `getDatabaseConnection` in class `SiteApplication`

    - #### setPlatformScope

          public void setPlatformScope(Environment env)

    - #### setPlatformScope

          public void setPlatformScope(boolean enabled,
                                       Environment env)

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