org.appng.appngizer.client

## Class AppNGizerClient.Config

- java.lang.Object
- - org.appng.appngizer.client.AppNGizerClient.Config

- Enclosing interface:
    AppNGizerClient

      public static class AppNGizerClient.Config
      extends Object

  Utility class to read and write `Properties` from/to YAML or JSON files.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AppNGizerClient.Config.Format`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Config()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Map<String,AppNGizerClient.PropertyWrapper>` | `read(InputStream in, AppNGizerClient.Config.Format format)` Reads a stream and parses it to a map of `AppNGizerClient.PropertyWrapper`s
    `static Properties` | `readPlatformProperties(AppNGizerClient appNGizer, OutputStream out, AppNGizerClient.Config.Format format, boolean nonDefaultOnly)` Reads the platform's `Properties` with the given `AppNGizerClient` and writes these to the given `OutputStream` using YAML format.
    `static Map<String,AppNGizerClient.SiteConfig>` | `readSite(InputStream in, AppNGizerClient.Config.Format format)` Reads a stream and parses it to a map of `AppNGizerClient.SiteConfig`s
    `static Properties` | `readSiteApplicationProperties(AppNGizerClient appNGizer, String site, String app, OutputStream out, AppNGizerClient.Config.Format format, boolean nonDefaultOnly)` Reads an `Application`'s `Properties` with the given `AppNGizerClient` and writes these to the given `OutputStream` using YAML format.
    `static Properties` | `readSiteProperties(AppNGizerClient appNGizer, String name, OutputStream out, AppNGizerClient.Config.Format format, boolean nonDefaultOnly)` Reads a `Site`'s `Properties` with the given `AppNGizerClient` and writes these to the given `OutputStream` using YAML format.
    `static void` | `write(String name, OutputStream out, AppNGizerClient.Config.Format format, AppNGizerClient.PropertyWrapper wrapper)` Writes the given `AppNGizerClient.PropertyWrapper` to the given `OutputStream`
    `static Properties` | `writePlatformProperties(AppNGizerClient appNGizer, InputStream in, AppNGizerClient.Config.Format format)` Writes the platform's `Properties` defined by the given `InputStream` with the given `AppNGizerClient`
    `static Properties` | `writeSiteApplicationProperties(AppNGizerClient appNGizer, String site, String app, InputStream in, AppNGizerClient.Config.Format format)` Writes an `Application`'s `Properties` defined by the given `InputStream` with the given `AppNGizerClient`
    `static Properties` | `writeSiteProperties(AppNGizerClient appNGizer, String site, InputStream in, AppNGizerClient.Config.Format format)` Writes a `Site`'s `Properties` defined by the given `InputStream` with the given `AppNGizerClient`

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

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

- - ### Constructor Detail

    - #### Config

          public Config()

  - ### Method Detail

    - #### readSiteProperties

          public static Properties readSiteProperties(AppNGizerClient appNGizer,
                                                      String name,
                                                      OutputStream out,
                                                      AppNGizerClient.Config.Format format,
                                                      boolean nonDefaultOnly)
                                               throws IOException

      Reads a `Site`'s `Properties` with the given `AppNGizerClient` and writes these to the given `OutputStream` using YAML format.
      Parameters:
        `appNGizer` - the `AppNGizerClient` to use
        `name` - the name of the `Site`
        `format` - the format to use
        `out` - the target to write to
        `nonDefaultOnly` - write only those properties where the value differs from the default value
      Returns:
        the `Site`'s `Properties`
      Throws:
        `IOException` - if an error occurred while writing the output

    - #### readSiteApplicationProperties

          public static Properties readSiteApplicationProperties(AppNGizerClient appNGizer,
                                                                 String site,
                                                                 String app,
                                                                 OutputStream out,
                                                                 AppNGizerClient.Config.Format format,
                                                                 boolean nonDefaultOnly)
                                                          throws IOException

      Reads an `Application`'s `Properties` with the given `AppNGizerClient` and writes these to the given `OutputStream` using YAML format.
      Parameters:
        `appNGizer` - the `AppNGizerClient` to use
        `site` - the `Site` where the `Application` is installed on
        `app` - the `Application`'s name
        `out` - the target to write to
        `format` - the `AppNGizerClient.Config.Format` to use
        `nonDefaultOnly` - write only those properties where the value differs from the default value
      Returns:
        the `Application`'s `Properties`
      Throws:
        `IOException`

    - #### readPlatformProperties

          public static Properties readPlatformProperties(AppNGizerClient appNGizer,
                                                          OutputStream out,
                                                          AppNGizerClient.Config.Format format,
                                                          boolean nonDefaultOnly)
                                                   throws IOException

      Reads the platform's `Properties` with the given `AppNGizerClient` and writes these to the given `OutputStream` using YAML format.
      Parameters:
        `appNGizer` - the `AppNGizerClient` to use
        `out` - the target to write to
        `format` - the `AppNGizerClient.Config.Format` to use
        `nonDefaultOnly` - write only those properties where the value differs from the default value
      Returns:
        the platform's `Properties`
      Throws:
        `IOException` - if an error occurred while writing the output

    - #### write

          public static void write(String name,
                                   OutputStream out,
                                   AppNGizerClient.Config.Format format,
                                   AppNGizerClient.PropertyWrapper wrapper)
                            throws IOException

      Writes the given `AppNGizerClient.PropertyWrapper` to the given `OutputStream`
      Parameters:
        `out` - the stream to write to
        `name` - the name to use
        `format` -
        `wrapper` - the wrapper to read from
      Throws:
        `IOException` - if an error occurs while writing

    - #### writeSiteProperties

          public static Properties writeSiteProperties(AppNGizerClient appNGizer,
                                                       String site,
                                                       InputStream in,
                                                       AppNGizerClient.Config.Format format)
                                                throws IOException

      Writes a `Site`'s `Properties` defined by the given `InputStream` with the given `AppNGizerClient`
      Parameters:
        `appNGizer` - the `AppNGizerClient` to use
        `in` - the `InputStream` to read from
        `format` - the `AppNGizerClient.Config.Format` to use
      Returns:
        the `Site`'s `Properties`
      Throws:
        `IOException` - if an error occurred while reading the input

    - #### readSite

          public static Map<String,AppNGizerClient.SiteConfig> readSite(InputStream in,
                                                                        AppNGizerClient.Config.Format format)
                                                                 throws IOException

      Reads a stream and parses it to a map of `AppNGizerClient.SiteConfig`s
      Parameters:
        `in` - the stream to read from
        `format` - the `AppNGizerClient.Config.Format` to use
      Returns:
        the map
      Throws:
        `IOException` - if an error occurred while reading the input

    - #### read

          public static Map<String,AppNGizerClient.PropertyWrapper> read(InputStream in,
                                                                         AppNGizerClient.Config.Format format)
                                                                  throws IOException

      Reads a stream and parses it to a map of `AppNGizerClient.PropertyWrapper`s
      Parameters:
        `in` - the stream to read from
        `format` - the `AppNGizerClient.Config.Format` to use
      Returns:
        the map
      Throws:
        `IOException` - if an error occurred while reading the input

    - #### writePlatformProperties

          public static Properties writePlatformProperties(AppNGizerClient appNGizer,
                                                           InputStream in,
                                                           AppNGizerClient.Config.Format format)
                                                    throws IOException

      Writes the platform's `Properties` defined by the given `InputStream` with the given `AppNGizerClient`
      Parameters:
        `appNGizer` - the `AppNGizerClient` to use
        `in` - the `InputStream` to read from
        `format` - the `AppNGizerClient.Config.Format` to use
      Returns:
        the platform's `Properties`
      Throws:
        `IOException` - if an error occurred while reading the input

    - #### writeSiteApplicationProperties

          public static Properties writeSiteApplicationProperties(AppNGizerClient appNGizer,
                                                                  String site,
                                                                  String app,
                                                                  InputStream in,
                                                                  AppNGizerClient.Config.Format format)
                                                           throws IOException

      Writes an `Application`'s `Properties` defined by the given `InputStream` with the given `AppNGizerClient`
      Parameters:
        `appNGizer` - the `AppNGizerClient` to use
        `site` - the `Site` where the `Application` is installed on
        `app` - the `Application`'s name
        `in` - the `InputStream` to read from
        `format` - the `AppNGizerClient.Config.Format` to use
      Returns:
        the `Application`'s `Properties`
      Throws:
        `IOException` - if an error occurred while reading the input

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