Package org.wildfly.prospero.metadata
Class ProsperoMetadataUtils
java.lang.Object
org.wildfly.prospero.metadata.ProsperoMetadataUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringName of the file containing list of channels the server is subscribed to.static final StringName of the file containing channel manifest generated during provisioning.static final Stringstatic final StringFolder containing Prospero metadata inside the provisioned server.static final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PathconfigurationPath(Path serverDir) static voidgenerate(Path serverDir, List<org.wildfly.channel.Channel> channels, org.wildfly.channel.ChannelManifest manifest, ManifestVersionRecord versionRecord) Generate installer metadata insideserverDir.static PathmanifestPath(Path serverDir) static voidrecordProvisioningDefinition(Path sourceServer) creates a copy of Galleon provisioning configuration fromConstants.PROVISIONED_STATE_DIR/Constants.PROVISIONING_XMLin theMETADATA_DIR.static voidwriteChannelsConfiguration(Path channelPath, List<org.wildfly.channel.Channel> channels) recordchannelsto the file at .static voidwriteManifest(Path manifestPath, org.wildfly.channel.ChannelManifest manifest) recordChannelManifestto the file at .protected static voidwriteToFile(Path path, String text) static voidwriteVersionRecord(Path versionsPath, ManifestVersionRecord versionRecord) recordManifestVersionRecordto the file at .static voidwriteWarningReadme(Path readmeFile)
-
Field Details
-
METADATA_DIR
Folder containing Prospero metadata inside the provisioned server.- See Also:
-
MANIFEST_FILE_NAME
Name of the file containing channel manifest generated during provisioning.- See Also:
-
INSTALLER_CHANNELS_FILE_NAME
Name of the file containing list of channels the server is subscribed to.- See Also:
-
MAVEN_OPTS_FILE
- See Also:
-
CURRENT_VERSION_FILE
- See Also:
-
README_FILE_NAME
- See Also:
-
PROVISIONING_RECORD_XML
- See Also:
-
-
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 insideserverDir. 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 serverschannels- - list of channels the server should be subscribed tomanifest- - channel manifest containing streams used to provision a server.versionRecord- - provisioned versions of manifests. Can benull- Throws:
IOException- - if unable to write the metadata filesIllegalArgumentException- - if any of metadata files are already present.
-
writeChannelsConfiguration
public static void writeChannelsConfiguration(Path channelPath, List<org.wildfly.channel.Channel> channels) throws IOException recordchannelsto 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- -Pathwhere the data should be savedchannels- -Channels to record- Throws:
IOException- - if unable to write the fileIllegalArgumentException- - if the parent folder does not exist.
-
writeManifest
public static void writeManifest(Path manifestPath, org.wildfly.channel.ChannelManifest manifest) throws IOException recordChannelManifestto 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- -Pathwhere the data should be savedmanifest- -ChannelManifestto record- Throws:
IOException- - if unable to write the fileIllegalArgumentException- - if the parent folder does not exist.
-
writeVersionRecord
public static void writeVersionRecord(Path versionsPath, ManifestVersionRecord versionRecord) throws IOException recordManifestVersionRecordto 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- -Pathwhere the data should be savedversionRecord- -ManifestVersionRecordto record- Throws:
IOException- - if unable to write the fileIllegalArgumentException- - if the parent folder does not exist.
-
writeWarningReadme
- Throws:
IOException
-
manifestPath
-
configurationPath
-
recordProvisioningDefinition
creates a copy of Galleon provisioning configuration fromConstants.PROVISIONED_STATE_DIR/Constants.PROVISIONING_XMLin theMETADATA_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
- Throws:
IOException
-