Class ProsperoMetadataUtils

java.lang.Object
org.wildfly.prospero.metadata.ProsperoMetadataUtils

public class ProsperoMetadataUtils extends Object
  • Field Details

  • Constructor Details

    • ProsperoMetadataUtils

      public ProsperoMetadataUtils()
  • Method Details

    • generate

      public static void generate(Path serverDir, List<org.wildfly.channel.Channel> channels, org.wildfly.channel.ChannelManifest manifest, ManifestVersionRecord versionRecord) throws IOException
      Generate installer metadata inside serverDir. The generated metadata files allow the server to be managed by Prospero. The metadata directory must not contain any metadata files.
      Parameters:
      serverDir - - base path of the provisioned servers
      channels - - list of channels the server should be subscribed to
      manifest - - channel manifest containing streams used to provision a server.
      versionRecord - - provisioned versions of manifests. Can be null
      Throws:
      IOException - - if unable to write the metadata files
      IllegalArgumentException - - if any of metadata files are already present.
    • writeChannelsConfiguration

      public static void writeChannelsConfiguration(Path channelPath, List<org.wildfly.channel.Channel> channels) throws IOException
      record channels to the file at . If the file already exist, it will be overwritten. If the file doesn't exist, the parent directory needs to be present, otherwise an exception is thrown.
      Parameters:
      channelPath - - Path where the data should be saved
      channels - - Channels to record
      Throws:
      IOException - - if unable to write the file
      IllegalArgumentException - - if the parent folder does not exist.
    • writeManifest

      public static void writeManifest(Path manifestPath, org.wildfly.channel.ChannelManifest manifest) throws IOException
      record ChannelManifest to the file at . If the file already exist, it will be overwritten. If the file doesn't exist, the parent directory needs to be present, otherwise an exception is thrown.
      Parameters:
      manifestPath - - Path where the data should be saved
      manifest - - ChannelManifest to record
      Throws:
      IOException - - if unable to write the file
      IllegalArgumentException - - if the parent folder does not exist.
    • writeVersionRecord

      public static void writeVersionRecord(Path versionsPath, ManifestVersionRecord versionRecord) throws IOException
      record ManifestVersionRecord to the file at . If the file already exist, it will be overwritten. If the file doesn't exist, the parent directory needs to be present, otherwise an exception is thrown.
      Parameters:
      versionsPath - - Path where the data should be saved
      versionRecord - - ManifestVersionRecord to record
      Throws:
      IOException - - if unable to write the file
      IllegalArgumentException - - if the parent folder does not exist.
    • writeWarningReadme

      public static void writeWarningReadme(Path readmeFile) throws IOException
      Throws:
      IOException
    • manifestPath

      public static Path manifestPath(Path serverDir)
    • configurationPath

      public static Path configurationPath(Path serverDir)
    • recordProvisioningDefinition

      public static void recordProvisioningDefinition(Path sourceServer) throws IOException
      creates a copy of Galleon provisioning configuration from Constants.PROVISIONED_STATE_DIR/Constants.PROVISIONING_XML in the METADATA_DIR. If the source file doesn't exist no copy is created. If the provisioning configuration is the same as saved copy, the file is not overwritten.
      Parameters:
      sourceServer - - root folder of the server
      Throws:
      IOException - - if the file cannot be copied.
    • writeToFile

      protected static void writeToFile(Path path, String text) throws IOException
      Throws:
      IOException