Class InstallManifest

java.lang.Object
com.kosdev.kos.commons.manifest.DeviceManifestVersion
com.kosdev.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.

Api version 10 introduced the concept of reverse manifest linking. While a typical chain builds manifests one at a time, passing the id of the previous manifest to the next in order to create the chain, this has a side effect of forcing upstream manifests to be rebuilt any time an earlier manifest changes due to the need to include the id of the previously generated manifest to link them. Reverse linking allows upstream manifests to be created without populating the nextManifestId property as the reverse linked manifest will include all upstream manifest id's in the new reverseLinkedManifestIds list. This requires that all upstream manifests be created first so the id's can be identified for inclusion in the reverse linked manifest. Practically speaking, this allows a single aggregator to query multiple external systems for manifests and add them to a single reverse linked manifest which is then chained normally to the device manifest. This can drastically reduce the creation of unique manifest kabs.

To use reverse linked manifests, the manifests being reverse linked to must have nextManifestId set to null.

Since:
1
Version:
10
  • 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.
      Since:
      1
    • getInstallDetails

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

      public String getDeviceType()
    • getManifestType

      public String getManifestType()
    • getNextManifestId

      public String getNextManifestId()
    • getReverseLinkedManifestIds

      public List<String> getReverseLinkedManifestIds()
    • 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)
    • setReverseLinkedManifestIds

      public void setReverseLinkedManifestIds(List<String> reverseLinkedManifestIds)
    • setProperties

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

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

      public void setInstallArtifacts(Set<BaseManifestArtifact> installArtifacts)