Class InstallBuilder
- Direct Known Subclasses:
DirectoryInstallBuilder
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a kab source to the builder.void
build()
Build aResolvedDeviceManifest
from the builder.Return the list of kabs referenced by the manifest but are not available from any of the sources.boolean
Return true if the resulting install is incomplete.setManifestId
(String manifestId) Set the identifier of the manifest.setManifestKab
(KabFile manifestKab) Set the manifest kab.
-
Constructor Details
-
InstallBuilder
public InstallBuilder()
-
-
Method Details
-
setManifestId
Set the identifier of the manifest. The kab will be fetched from the specified sources.- Parameters:
manifestId
- identifier of the manifest kab
-
setManifestKab
Set the manifest kab. If set,setManifestId()
will be ignored.- Parameters:
manifestKab
- the manifest kab to use
-
addSource
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 aResolvedDeviceManifest
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 callingbuild()
. -
getMissingArtifacts
Return the list of kabs referenced by the manifest but are not available from any of the sources. Can only be called after callingbuild()
. -
getManifestId
-
getManifestKab
-