Package 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 writeProperties
from/to YAML or JSON files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AppNGizerClient.Config.Format
-
Constructor Summary
Constructors Constructor Description Config()
-
Method Summary
-
-
-
Method Detail
-
readSiteProperties
public static Properties readSiteProperties(AppNGizerClient appNGizer, String name, OutputStream out, AppNGizerClient.Config.Format format, boolean nonDefaultOnly) throws IOException
Reads aSite
'sProperties
with the givenAppNGizerClient
and writes these to the givenOutputStream
using YAML format.- Parameters:
appNGizer
- theAppNGizerClient
to usename
- the name of theSite
format
- the format to useout
- the target to write tononDefaultOnly
- write only those properties where the value differs from the default value- Returns:
- the
Site
'sProperties
- 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 anApplication
'sProperties
with the givenAppNGizerClient
and writes these to the givenOutputStream
using YAML format.- Parameters:
appNGizer
- theAppNGizerClient
to usesite
- theSite
where theApplication
is installed onapp
- theApplication
's nameout
- the target to write toformat
- theAppNGizerClient.Config.Format
to usenonDefaultOnly
- write only those properties where the value differs from the default value- Returns:
- the
Application
'sProperties
- Throws:
IOException
-
readPlatformProperties
public static Properties readPlatformProperties(AppNGizerClient appNGizer, OutputStream out, AppNGizerClient.Config.Format format, boolean nonDefaultOnly) throws IOException
Reads the platform'sProperties
with the givenAppNGizerClient
and writes these to the givenOutputStream
using YAML format.- Parameters:
appNGizer
- theAppNGizerClient
to useout
- the target to write toformat
- theAppNGizerClient.Config.Format
to usenonDefaultOnly
- 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 givenAppNGizerClient.PropertyWrapper
to the givenOutputStream
- Parameters:
out
- the stream to write toname
- the name to useformat
-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
- Parameters:
appNGizer
- theAppNGizerClient
to usein
- theInputStream
to read fromformat
- theAppNGizerClient.Config.Format
to use- Returns:
- the
Site
'sProperties
- 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 ofAppNGizerClient.SiteConfig
s- Parameters:
in
- the stream to read fromformat
- theAppNGizerClient.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 ofAppNGizerClient.PropertyWrapper
s- Parameters:
in
- the stream to read fromformat
- theAppNGizerClient.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
- Parameters:
appNGizer
- theAppNGizerClient
to usein
- theInputStream
to read fromformat
- theAppNGizerClient.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
- Parameters:
appNGizer
- theAppNGizerClient
to usesite
- theSite
where theApplication
is installed onapp
- theApplication
's namein
- theInputStream
to read fromformat
- theAppNGizerClient.Config.Format
to use- Returns:
- the
Application
'sProperties
- Throws:
IOException
- if an error occurred while reading the input
-
-