Class FhirCacheService
Manager for package caches.
Inheritance
Namespace: Microsoft.Health.Fhir.SpecManager.PackageManager
Assembly: Microsoft.Health.Fhir.SpecManager.dll
Syntax
public class FhirCacheService : IDisposable
Properties
| Improve this Doc View SourceCurrent
Gets the current singleton.
Declaration
public static FhirCacheService Current { get; }
Property Value
Type | Description |
---|---|
Fhir |
PackagesByDirective
Gets the packages by directive.
Declaration
public Dictionary<string, PackageCacheRecord> PackagesByDirective { get; }
Property Value
Type | Description |
---|---|
Dictionary<System. |
Methods
| Improve this Doc View SourceDeletePackage(String)
Deletes the package described by packageDirective.
Declaration
public void DeletePackage(string packageDirective)
Parameters
Type | Name | Description |
---|---|---|
System. |
packageDirective | The package directive. |
Dispose(Boolean)
Releases the unmanaged resources used by the Fhir
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System. |
disposing | True to release both managed and unmanaged resources; false to release only unmanaged resources. |
FindOrDownload(String, out String, Boolean, String)
Searches for the first or download.
Declaration
public bool FindOrDownload(string directive, out string directory, bool offlineMode, string branchName = "")
Parameters
Type | Name | Description |
---|---|---|
System. |
directive | The directive. |
System. |
directory | [out] Pathname of the directory. |
System. |
offlineMode | True to enable offline mode, false to disable it. |
System. |
branchName | (Optional) Name of the branch. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
GetCachedPackages()
Gets the cached packages in this collection.
Declaration
public IEnumerable<NpmPackageDetails> GetCachedPackages()
Returns
Type | Description |
---|---|
IEnumerable<Npm |
An enumerator that allows foreach to be used to process the cached packages in this collection. |
Init(String)
Initializes the FhirCacheService.
Declaration
public static void Init(string cacheDirectory)
Parameters
Type | Name | Description |
---|---|---|
System. |
cacheDirectory | Pathname of the cache directory. |
StateHasChanged()
State has changed.
Declaration
public void StateHasChanged()
TryDownloadCoreViaCI(String, String, out String)
Attempts to download core via ci a string from the given string.
Declaration
public bool TryDownloadCoreViaCI(string name, string branchName, out string directory)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | The name. |
System. |
branchName | Name of the branch. |
System. |
directory | [out] Pathname of the directory. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
TryDownloadGuideViaCI(String, String, out String)
Attempts to download guide via ci a string from the given string.
Declaration
public bool TryDownloadGuideViaCI(string name, string branchName, out string directory)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | The name. |
System. |
branchName | Name of the branch. |
System. |
directory | [out] Pathname of the directory. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
TryDownloadGuideViaCI(String, out String, out String)
Attempts to download guide via ci a string from the given string.
Declaration
public bool TryDownloadGuideViaCI(string branchName, out string name, out string directory)
Parameters
Type | Name | Description |
---|---|---|
System. |
branchName | Name of the branch. |
System. |
name | [out] The name. |
System. |
directory | [out] Pathname of the directory. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
TryDownloadViaCI(String, String, out String)
Attempts to download via ci a string from the given string.
Declaration
public bool TryDownloadViaCI(string name, string branchName, out string directory)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | The name. |
System. |
branchName | Name of the branch. |
System. |
directory | [out] Pathname of the directory. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
TryGetCoreCiPackageDetails(String, out NpmPackageDetails)
Attempts to get core ci package details.
Declaration
public bool TryGetCoreCiPackageDetails(string branchName, out NpmPackageDetails details)
Parameters
Type | Name | Description |
---|---|---|
System. |
branchName | Name of the branch. |
Npm |
details | [out] The details. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
TryGetGuideCiPackageDetails(String, out NpmPackageDetails)
Attempts to get guide ci package details the NpmPackageDetails from the given string.
Declaration
public bool TryGetGuideCiPackageDetails(string branchName, out NpmPackageDetails details)
Parameters
Type | Name | Description |
---|---|---|
System. |
branchName | Name of the branch. |
Npm |
details | [out] The details. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
TryGetPackageManifests(String, out IEnumerable<RegistryPackageManifest>)
Attempts to get a package manifest for a given package.
Declaration
public bool TryGetPackageManifests(string packageName, out IEnumerable<RegistryPackageManifest> manifests)
Parameters
Type | Name | Description |
---|---|---|
System. |
packageName | Name of the package. |
IEnumerable<Registry |
manifests | [out] The manifest. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
TryGetPackageState(String, out PackageLoadStateEnum)
Attempts to get a package state, returning a default value rather than throwing an exception if it fails.
Declaration
public bool TryGetPackageState(string directive, out PackageLoadStateEnum state)
Parameters
Type | Name | Description |
---|---|---|
System. |
directive | The directive. |
Package |
state | [out] The state. |
Returns
Type | Description |
---|---|
System. |
True if it succeeds, false if it fails. |
UpdatePackageState(String, String, String, PackageLoadStateEnum)
Updates the package state.
Declaration
public void UpdatePackageState(string directive, string resolvedName, string resolvedVersion, PackageLoadStateEnum toState)
Parameters
Type | Name | Description |
---|---|---|
System. |
directive | The directive. |
System. |
resolvedName | Name of the resolved. |
System. |
resolvedVersion | The resolved version. |
Package |
toState | State of to. |
Events
| Improve this Doc View SourceOnChanged
Occurs when On Changed.
Declaration
public event EventHandler<EventArgs> OnChanged
Event Type
Type | Description |
---|---|
Event |