java.lang.Object
com.tccc.kos.core.primary.service.nodemgr.install.InstallBuilder
Direct Known Subclasses:
DirectoryInstallBuilder

public class InstallBuilder extends Object
Builder used to define a kOS installation. All installations within kOS are driven by a manifest kab which contains some form of DeviceManifest. Different implementations of DeviceManifest can exist and the installer need not understand the entire format to perform an installation.

Fundamentally, a manifest defines all the kabs required to get kOS into the state defined by the manifest, which in turn, defines the list of kabs that need to be installed. A DeviceManifest can define the state of multiple nodes in a multi-node device, and all kabs across all nodes must be installed on the primary node of the device. This means that all installations occur on the primary node of the device and kOS will handle installation of all other nodes in the device, even if they are added after the installation has occurred.

This builder defines the manifest to install and a list of kabs (via KabSource) that correspond to the kabs listed in the manifest. It is ok for the kab sources to include more kabs than are required by the manifest as only those kabs listed in the manifest will be considered. The install process will also factor in kabs that are already installed on the device and only install kabs that are missing.

Since an installation is defined by the DeviceManifest, the builder must have a manifest to initiate the install. There are two options to satisfy this requirement:

  • Specify the actual manifest kab. Since the actual KabFile is specified, The kab does not need to be visible in any of the provided sources.
  • Specify the identifier of the manifest kab. This requires that the manifest kab be visible through the specified sources.
Version:
2023-10-12
  • Constructor Details

    • InstallBuilder

      public InstallBuilder()
  • Method Details

    • setManifestId

      public InstallBuilder setManifestId(String manifestId)
      Set the identifier of the manifest. The kab will be fetched from the specified sources.
      Parameters:
      manifestId - identifier of the manifest kab
    • setManifestKab

      public InstallBuilder setManifestKab(KabFile manifestKab)
      Set the manifest kab. If set, setManifestId() will be ignored.
      Parameters:
      manifestKab - the manifest kab to use
    • addSource

      public InstallBuilder addSource(KabSource source)
      Add a kab source to the builder. Sources will be examined in the order in which they are added allowing for composite sources to be used.
      Parameters:
      source - the kab source to add
    • build

      public void build()
      Build a ResolvedDeviceManifest from the builder.
    • isIncomplete

      public boolean isIncomplete()
      Return true if the resulting install is incomplete. This indicates that some number of kabs referenced in the manifest were not found in any of the sources. Can only be called after calling build() .
    • getMissingArtifacts

      public List<ManifestArtifact> getMissingArtifacts()
      Return the list of kabs referenced by the manifest but are not available from any of the sources. Can only be called after calling build() .
    • getManifestId

      public String getManifestId()
    • getManifestKab

      public KabFile getManifestKab()