Package org.wildfly.prospero.api
Class InstallationMetadata
- java.lang.Object
-
- org.wildfly.prospero.api.InstallationMetadata
-
- All Implemented Interfaces:
AutoCloseable
public class InstallationMetadata extends Object implements AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description static StringGALLEON_INSTALLATION_DIRstatic StringPROVISIONING_FILE_NAME
-
Constructor Summary
Constructors Modifier Constructor Description protectedInstallationMetadata(Path base, org.wildfly.channel.ChannelManifest manifest, ProsperoConfig prosperoConfig, GitStorage gitStorage, Optional<ManifestVersionRecord> currentVersions, org.jboss.galleon.config.ProvisioningConfig provisioningConfig)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()PathexportMetadataBundle(Path location)org.eclipse.aether.artifact.Artifactfind(org.eclipse.aether.artifact.Artifact gav)static InstallationMetadatafromMetadataBundle(Path archiveLocation)read the metadata from an exported zip containing configuration filesList<org.eclipse.aether.artifact.Artifact>getArtifacts()InstallationChangesgetChangesSince(SavedState savedState)org.jboss.galleon.config.ProvisioningConfiggetGalleonProvisioningConfig()org.wildfly.channel.ChannelManifestgetManifest()Optional<ManifestVersionRecord>getManifestVersions()ProsperoConfiggetProsperoConfig()org.jboss.galleon.config.ProvisioningConfiggetRecordedProvisioningConfig()galleon configuration used to provision current state of the server.List<SavedState>getRevisions()InstallationMetadatagetSavedState(SavedState savedState)static InstallationMetadataloadInstallation(Path base)load the metadata of an existing installation.static InstallationMetadatanewInstallation(Path base, org.wildfly.channel.ChannelManifest manifest, ProsperoConfig prosperoConfig, Optional<ManifestVersionRecord> currentVersions)create an in-memory installation metadata.voidrecordProvision(boolean overrideProsperoConfig)voidrecordProvision(boolean overrideProsperoConfig, boolean gitRecord)voidsetManifest(org.wildfly.channel.ChannelManifest resolvedChannel)voidupdateProsperoConfig(ProsperoConfig config)voidupdateProvisioningConfiguration()check if the provisioning definition is present.
-
-
-
Field Detail
-
PROVISIONING_FILE_NAME
public static final String PROVISIONING_FILE_NAME
- See Also:
- Constant Field Values
-
GALLEON_INSTALLATION_DIR
public static final String GALLEON_INSTALLATION_DIR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InstallationMetadata
protected InstallationMetadata(Path base, org.wildfly.channel.ChannelManifest manifest, ProsperoConfig prosperoConfig, GitStorage gitStorage, Optional<ManifestVersionRecord> currentVersions, org.jboss.galleon.config.ProvisioningConfig provisioningConfig) throws MetadataException
- Throws:
MetadataException
-
-
Method Detail
-
loadInstallation
public static InstallationMetadata loadInstallation(Path base) throws MetadataException
load the metadata of an existing installation. If the history is not available, it will be started.- Parameters:
base-- Returns:
- Throws:
MetadataException
-
newInstallation
public static InstallationMetadata newInstallation(Path base, org.wildfly.channel.ChannelManifest manifest, ProsperoConfig prosperoConfig, Optional<ManifestVersionRecord> currentVersions) throws MetadataException
create an in-memory installation metadata. No information is recorded untilrecordProvision(boolean)is called.- Parameters:
base-manifest-prosperoConfig-currentVersions- - manifest versions used to provision the installation- Returns:
- Throws:
MetadataException
-
fromMetadataBundle
public static InstallationMetadata fromMetadataBundle(Path archiveLocation) throws IOException, MetadataException
read the metadata from an exported zip containing configuration files- Parameters:
archiveLocation- path to the exported zip- Returns:
- Throws:
IOExceptionMetadataException
-
exportMetadataBundle
public Path exportMetadataBundle(Path location) throws IOException
- Throws:
IOException
-
getManifest
public org.wildfly.channel.ChannelManifest getManifest()
-
getGalleonProvisioningConfig
public org.jboss.galleon.config.ProvisioningConfig getGalleonProvisioningConfig()
-
recordProvision
public void recordProvision(boolean overrideProsperoConfig) throws MetadataException- Throws:
MetadataException
-
recordProvision
public void recordProvision(boolean overrideProsperoConfig, boolean gitRecord) throws MetadataException- Throws:
MetadataException
-
updateProvisioningConfiguration
public void updateProvisioningConfiguration() throws MetadataExceptioncheck if the provisioning definition is present. If not add it to the history- Throws:
MetadataException
-
getRevisions
public List<SavedState> getRevisions() throws MetadataException
- Throws:
MetadataException
-
getSavedState
public InstallationMetadata getSavedState(SavedState savedState) throws MetadataException
- Throws:
MetadataException
-
getChangesSince
public InstallationChanges getChangesSince(SavedState savedState) throws MetadataException
- Throws:
MetadataException
-
setManifest
public void setManifest(org.wildfly.channel.ChannelManifest resolvedChannel)
-
getArtifacts
public List<org.eclipse.aether.artifact.Artifact> getArtifacts()
-
find
public org.eclipse.aether.artifact.Artifact find(org.eclipse.aether.artifact.Artifact gav)
-
getProsperoConfig
public ProsperoConfig getProsperoConfig()
-
updateProsperoConfig
public void updateProsperoConfig(ProsperoConfig config) throws MetadataException
- Throws:
MetadataException
-
getManifestVersions
public Optional<ManifestVersionRecord> getManifestVersions()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
getRecordedProvisioningConfig
public org.jboss.galleon.config.ProvisioningConfig getRecordedProvisioningConfig()
galleon configuration used to provision current state of the server.- Returns:
-
-