Table of Contents

Class InstallationManager

Namespace
TimeCockpit.Data.Database
Assembly
TimeCockpit.Data.dll

Handles installation issues on a given database client

public class InstallationManager
Inheritance
Object
InstallationManager
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()

Methods

ActivateAndInstallFeatures(IEnumerable<Feature>)

Activates and installs a given features.

public void ActivateAndInstallFeatures(IEnumerable<Feature> features)

Parameters

features IEnumerable<Feature>

Features to install

Remarks

The method orders the features by prerequisites and installs them in order.

Create(DbClient, Model, String)

Creates a new installation manager that fits to the specified client

public static InstallationManager Create(DbClient client, Model writableModel = null, string dataModelLanguage = null)

Parameters

client DbClient

Database client that the installation manager has to work with

writableModel Model

Optional, preprovided writable model.

dataModelLanguage String

The language of the datamodel that is to be upgraded.

Returns

InstallationManager

New instance of the InstallationManager class

Create(DataContext, Model, String)

Creates a new installation manager that fits to the specified client

public static InstallationManager Create(DataContext context, Model writableModel = null, string dataModelLanguage = null)

Parameters

context DataContext

Context that the installation manager has to work with

writableModel Model

Optional, preprovided writable model.

dataModelLanguage String

The language of the datamodel that is to be upgraded.

Returns

InstallationManager

New instance of the InstallationManager class

GetFeatureStatus(Guid)

Returns the status of a given feature

public FeatureStatus GetFeatureStatus(Guid featureGuid)

Parameters

featureGuid Guid

Guid of the feature to check

Returns

FeatureStatus

Status of a given feature

GetFeatureStatus(Guid, IEnumerable<Guid>)

Returns the status of a given feature

public static FeatureStatus GetFeatureStatus(Guid featureGuid, IEnumerable<Guid> installedFeatures)

Parameters

featureGuid Guid

Guid of the feature to check

installedFeatures IEnumerable<Guid>

Installed feature uuids.

Returns

FeatureStatus

Status of a given feature

GetFeatureStatus(Feature)

Returns the status of a given feature

public FeatureStatus GetFeatureStatus(Feature feature)

Parameters

feature Feature

Feature to check

Returns

FeatureStatus

Status of a given feature

GetInstallationComponentStatus(IEnumerable<InstallationComponent>, Func<InstalledBatchInformation, Boolean>)

Gets the installation status for a specified collection of installation components

public InstallationComponentStatus GetInstallationComponentStatus(IEnumerable<InstallationComponent> installBatch, Func<InstalledBatchInformation, bool> installedBatchFilter)

Parameters

installBatch IEnumerable<InstallationComponent>

Installation components to check

installedBatchFilter Func<InstalledBatchInformation, Boolean>

Optional filter function for installed components stored in the database (see remarks for details)

Returns

InstallationComponentStatus

Installation status for a specified collection of installation components

Remarks

installedBatchFilter can be null if all installed components stored in the database should be taken into account.

GetMissingComponents(IEnumerable<InstallationComponent>, Nullable<Guid>)

Gets a list of missing installation components.

public IEnumerable<InstallationComponent> GetMissingComponents(IEnumerable<InstallationComponent> installBatch, Guid? guidOfLastBatchToBeChecked)

Parameters

installBatch IEnumerable<InstallationComponent>

List of installation components for which to check if they have already been installed on the client db.

guidOfLastBatchToBeChecked Nullable<Guid>

Guid of the last batch that should be returned. See remarks for details.

Returns

IEnumerable<InstallationComponent>

Those components from installBatch that have not already been installed on the client db.

Remarks

If guidOfLastBatchToBeChecked is null all batches in installBatch are returned.

GetMissingComponents(Feature)

Gets a list of missing installation components for a given feature.

public IEnumerable<InstallationComponent> GetMissingComponents(Feature feature)

Parameters

feature Feature

Feature to check

Returns

IEnumerable<InstallationComponent>

Those installation components from the feature that have not already been installed on the client db.

HasNecessaryPrerequisites(Feature)

Gets a value indicating whether the underlying database has all necessary prerequisites for a given feature

public bool HasNecessaryPrerequisites(Feature feature)

Parameters

feature Feature

Feature to check

Returns

Boolean

value indicating whether the underlying database has all necessary prerequisites for a given feature

InstallMissingUpdateBatches(IEnumerable<InstallationComponent>, Nullable<Guid>)

Installes missing installation components.

public void InstallMissingUpdateBatches(IEnumerable<InstallationComponent> installBatch, Guid? guidOfLastBatchToBeExecuted)

Parameters

installBatch IEnumerable<InstallationComponent>

List of installation components for which to check if they have already been installed on the client db. Those that have not been installed yet will be installed.

guidOfLastBatchToBeExecuted Nullable<Guid>

Guid of the last batch that should be installed. See remarks for details.

Remarks

Note that this function adds the installed components to TcSys_InstalledBatches even if the corresponding batch has not been executed because of not meeting the match criteria.

If guidOfLastBatchToBeExecuted is null all batches in installBatch are installed.

OrderByDependencies(IEnumerable<Feature>, Boolean)

Orders features by its dependencies. To get an uninstall order, reverse the returned collection.

public IEnumerable<Feature> OrderByDependencies(IEnumerable<Feature> features, bool uninstall)

Parameters

features IEnumerable<Feature>

features to install.

uninstall Boolean

true if ordered for uninstall (does not check if prerequisites are in the features.

Returns

IEnumerable<Feature>

returns the enumeration of features, sorted by dependencies.

RemoveFeatures(IEnumerable<Feature>, Boolean)

Removes and installs a set of features

public void RemoveFeatures(IEnumerable<Feature> features, bool ignoreNotInstalled = false)

Parameters

features IEnumerable<Feature>

Features to uninstall

ignoreNotInstalled Boolean

Allows features to no be in installed state.

Remarks

Orders the features by prerequisites and uninstalls them in reversed order.