Class InstallationManager
- Namespace
- TimeCockpit.Data.Database
- Assembly
- TimeCockpit.Data.dll
Handles installation issues on a given database client
public class InstallationManager
- Inheritance
-
ObjectInstallationManager
- 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
featuresIEnumerable<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
clientDbClientDatabase client that the installation manager has to work with
writableModelModelOptional, preprovided writable model.
dataModelLanguageStringThe 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
contextDataContextContext that the installation manager has to work with
writableModelModelOptional, preprovided writable model.
dataModelLanguageStringThe 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
featureGuidGuidGuid 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
featureGuidGuidGuid of the feature to check
installedFeaturesIEnumerable<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
featureFeatureFeature 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
installBatchIEnumerable<InstallationComponent>Installation components to check
installedBatchFilterFunc<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
installBatchIEnumerable<InstallationComponent>List of installation components for which to check if they have already been installed on the client db.
guidOfLastBatchToBeCheckedNullable<Guid>Guid of the last batch that should be returned. See remarks for details.
Returns
- IEnumerable<InstallationComponent>
Those components from
installBatchthat 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
featureFeatureFeature to check
Returns
- IEnumerable<InstallationComponent>
Those installation components from the
featurethat 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
featureFeatureFeature 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
installBatchIEnumerable<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.
guidOfLastBatchToBeExecutedNullable<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
featuresIEnumerable<Feature>features to install.
uninstallBooleantrue 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
featuresIEnumerable<Feature>Features to uninstall
ignoreNotInstalledBooleanAllows features to no be in installed state.
Remarks
Orders the features by prerequisites and uninstalls them in reversed order.