Class InstallManifest

java.lang.Object
com.tccc.kos.commons.manifest.DeviceManifestVersion
com.tccc.kos.commons.manifest.install.InstallManifest
Direct Known Subclasses:
BaseDeviceManifest, ChainedManifest

public class InstallManifest extends DeviceManifestVersion
Class used to extract information from a manifest that identifies the minimum information required to correctly install an update on the primary node of a device such that the primary and all child nodes in the device can be properly updated.

This class exists to decouple the installer logic from a given manifest implementation as manifests may evolve over time. So long as any future manifest can return this information, a device can continue to be updated.

Care must be taken such that old code can extract this data from future manifests, even when the manifest format changes, otherwise it will be impossible to update as the old code will not know how to determine what to install. This can be handled by defining this data in all manifest formats, even when it's artificially created by tooling and is technically redundant.

The proper way to use this class is for every future manifest to extend it and regardless of internal format, populate the installArtifacts list with every artifact in the manifest. This way the installer can create instances of this class for any manifest json and retrieve the list of all artifacts without the need to understand the particular manifest format.

DO NOT CHANGE THIS WITHOUT KNOWING WHAT YOU'RE DOING AS YOU WILL BREAK THE ABILITY TO MIGRATE TO NEW MANIFEST FORMATS!

If the manifest is a chained manifest, the deviceType is optional (null means any device). A chained manifest must specify nextManifestId which is either another chained manifest or the root manifest of the chain. A root manifest will have a null nextManifestId and a valid deviceType which ensures the manifest is compatible with the device it is being installed onto.

installLayers should return all layers in the manifest. Layers are installed differently and thus need to be identified separately from non-layer artifacts. installArtifacts is a list of all non-layer artifacts in the manifest.

All manifests contain a top level map of properties. These are not used internally by kOS and exist to facilitate external tooling. There are several properties that can be used by convention:

  • kos.install.summary: This should contain a message suitable to display to a user that indicate what is contained within the manifest. This may be shown during the install process or as an indication of what is about to be installed. This property name is available as PROP_INSTALL_SUMMARY.
  • kos.install.detail.*: These can contain additional information to show to the user during the install process in addition to the summary. This property prefix is available as PROP_INSTALL_DETAIL.
These properties merely provide a convention that can be used to make install data available, but is subject to developers creating ui that leverages these properties.
Version:
2023-10-01
  • Field Details

  • Constructor Details

    • InstallManifest

      public InstallManifest()
  • Method Details

    • getInstallSummary

      public String getInstallSummary()
      Return the summary property which should contain information that indicates what is being installed with this manifest.
    • getInstallDetails

      public List<String> getInstallDetails()
      Return detail properties which can be displayed to the user to indicate which is being installed with this manifest.
    • getDeviceType

      public String getDeviceType()
    • getManifestType

      public String getManifestType()
    • getNextManifestId

      public String getNextManifestId()
    • getProperties

      public Map<String,String> getProperties()
    • getInstallLayers

      public Set<BaseManifestArtifact> getInstallLayers()
    • getInstallArtifacts

      public Set<BaseManifestArtifact> getInstallArtifacts()
    • setDeviceType

      public void setDeviceType(String deviceType)
    • setManifestType

      public void setManifestType(String manifestType)
    • setNextManifestId

      public void setNextManifestId(String nextManifestId)
    • setProperties

      public void setProperties(Map<String,String> properties)
    • setInstallLayers

      public void setInstallLayers(Set<BaseManifestArtifact> installLayers)
    • setInstallArtifacts

      public void setInstallArtifacts(Set<BaseManifestArtifact> installArtifacts)