org.appng.api.model

## Interface Site

- All Superinterfaces:
    Identifiable<Integer>, Nameable, Named<Integer>, Serializable
  All Known Implementing Classes:
    SiteImpl

      public interface Site
      extends Named<Integer>

  A `Site` is the highest level entry-point to the platform. Besides a unique name, it needs to have a domain and a host. A site can use any of the several `Application`s which have been deployed to the platform.
  Author:
    Matthias Müller

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `Site.SiteState` The different states a site can have

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Application` | `getApplication(String name)` Returns the `Application` with the given name, if such a `Application` is assigned to this `Site`.
    `Set<Application>` | `getApplications()` Returns the `Application`s which are currently assigned to this `Site`.
    `String` | `getDomain()` Returns the domain for this `Site`.
    `Set<Named<Integer>>` | `getGroups()` Returns a set containing a `Named`-instance for each `Group` that exists within the platform.
    `String` | `getHost()` Returns the main hostname for this site
    `Set<String>` | `getHostAliases()` Returns alias hostnames for ths `Site`
    `PasswordPolicy` | `getPasswordPolicy()` Returns the `PasswordPolicy` used when creating `Subject`s for this `Site`.
    `Properties` | `getProperties()` Returns the `Properties` for this `Site`.
    `URLClassLoader` | `getSiteClassLoader()` Returns the `URLClassLoader` for this `Site`, which contains all the jars provided by the `Application`s that are assigned to this `Site`.
    `Date` | `getStartupTime()` Returns the time at which the site has been loaded during platform-startup.
    `Site.SiteState` | `getState()`
    `boolean` | `hasApplication(String name)` Checks whether the `Application` with the given name is assigned to this `Site`.
    `boolean` | `hasState(Site.SiteState... states)`
    `boolean` | `isActive()` Returns `true` if this `Site` is active, which means it is being loaded at platform startup.
    `boolean` | `isCreateRepository()` Returns `true` if a JSP-repository folder has been created for this `Site`.
    `File` | `readFile(String relativePath)` Returns the `File` defined by the given path, which is located relative to the site's repository-folder.
    `boolean` | `sendEvent(Event event)` If clustering is enabled, sends an `Event` to other appNG nodes
    `void` | `sendRedirect(Environment env, String target)` sends a redirect with HTTP-Status 301 (moved permanently)
    `void` | `sendRedirect(Environment env, String target, Integer statusCode)` redirects the request to the given target.

    - ### Methods inherited from interface org.appng.api.model.Nameable

      `getDescription, getName`

    - ### Methods inherited from interface org.appng.api.model.Identifiable

      `getId`

- - ### Method Detail

    - #### getApplications

          Set<Application> getApplications()

      Returns the `Application`s which are currently assigned to this `Site`.
      Returns:
        the `Application`s currently assigned to this `Site`

    - #### getApplication

          Application getApplication(String name)

      Returns the `Application` with the given name, if such a `Application` is assigned to this `Site`.
      Parameters:
        `name` - the name of the `Application`
      Returns:
        the `Application`, if such a `Application` is assigned to this `Site`, `null` otherwise

    - #### hasApplication

          boolean hasApplication(String name)

      Checks whether the `Application` with the given name is assigned to this `Site`.
      Parameters:
        `name` - the name of the `Application`
      Returns:
        `true` if the `Application` with the given name is assigned to this `Site`, `false` otherwise

    - #### getHost

          String getHost()

      Returns the main hostname for this site
      Returns:
        the host

    - #### getHostAliases

          Set<String> getHostAliases()

      Returns alias hostnames for ths `Site`
      Returns:
        the alias names

    - #### getDomain

          String getDomain()

      Returns the domain for this `Site`.
      Returns:
        the domain

    - #### getProperties

          Properties getProperties()

      Returns the `Properties` for this `Site`.
      Returns:
        the `Properties` for this `Site`
      See Also:
        `SiteProperties`

    - #### getSiteClassLoader

          URLClassLoader getSiteClassLoader()

      Returns the `URLClassLoader` for this `Site`, which contains all the jars provided by the `Application`s that are assigned to this `Site`.
      Returns:
        the `URLClassLoader`

    - #### isActive

          boolean isActive()

      Returns `true` if this `Site` is active, which means it is being loaded at platform startup.
      Returns:
        `true` if this `Site` is active, `false` otherwise

    - #### isCreateRepository

          boolean isCreateRepository()

      Returns `true` if a JSP-repository folder has been created for this `Site`.
      Returns:
        `true` if a JSP-repository folder has been created

    - #### sendRedirect

          void sendRedirect(Environment env,
                            String target)

      sends a redirect with HTTP-Status 301 (moved permanently)
      See Also:
        `sendRedirect(Environment, String, Integer)`

    - #### sendRedirect

          void sendRedirect(Environment env,
                            String target,
                            Integer statusCode)

      redirects the request to the given target. If the target not starts with a slash ("/"), the target has to be a relative path to a certain `Application` of this site (like "application/page"). If the target does start with a slash, it is expected to be a target relative to the domain of this site.
      Parameters:
        `env` - the actual `Environment`
        `target` - the redirect target
        `statusCode` - -the HTTP status code to send. Use constants from `HttpServletRequest`

    - #### readFile

          File readFile(String relativePath)

      Returns the `File` defined by the given path, which is located relative to the site's repository-folder.
      Parameters:
        `relativePath` - the relative path of the file
      Returns:
        the `File`, if such a path exists

    - #### getGroups

          Set<Named<Integer>> getGroups()

      Returns a set containing a `Named`-instance for each `Group` that exists within the platform.
      Returns:
        the `Named` groups

    - #### getPasswordPolicy

          PasswordPolicy getPasswordPolicy()

      Returns the `PasswordPolicy` used when creating `Subject`s for this `Site`.
      Returns:
        the `PasswordPolicy`

    - #### getStartupTime

          Date getStartupTime()

      Returns the time at which the site has been loaded during platform-startup.
      Returns:
        the time, or `null` if the site has (yet) not been loaded.

    - #### sendEvent

          boolean sendEvent(Event event)

      If clustering is enabled, sends an `Event` to other appNG nodes
      Parameters:
        `event` - the event to send
      Returns:
        `true` if the event was sent successfully

    - #### getState

          Site.SiteState getState()

    - #### hasState

          boolean hasState(Site.SiteState... states)

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