Table of Contents

Class FireflyService

Namespace
Phoesion.Glow.SDK.Firefly
Assembly
Phoesion.Glow.SDK.Firefly.dll
public abstract class FireflyService : IFireflyService, IHost, IDisposable, IFireflyServiceEfCoreExtensions
Inheritance
object
FireflyService
Implements
Derived

Constructors

FireflyService()

public FireflyService()

Properties

AppCacheService

public IAppCacheService AppCacheService { get; }

Property Value

IAppCacheService

AppFeatureFlags

public IAppFeatureFlagsService AppFeatureFlags { get; }

Property Value

IAppFeatureFlagsService

AppJobService

public IAppJobService AppJobService { get; }

Property Value

IAppJobService

AppMutexService

public IAppMutexService AppMutexService { get; }

Property Value

IAppMutexService

AppStateMachineService

public IAppStateMachineService AppStateMachineService { get; }

Property Value

IAppStateMachineService

Configuration

public IConfiguration Configuration { get; }

Property Value

IConfiguration

DataPath

Persistent storage directory for the service. (contents will persist across new deployments of the service) The Data directory is a local directory and it's contents are unique to the machine the service runs on.

public string DataPath { get; }

Property Value

string

DeploymentDirectoryPath

The directory where service files are deployed

public string DeploymentDirectoryPath { get; }

Property Value

string

EnvironmentName

public string EnvironmentName { get; }

Property Value

string

HostingEnvironment

public IHostEnvironment HostingEnvironment { get; }

Property Value

IHostEnvironment

Info

public InfoContainer Info { get; }

Property Value

InfoContainer

IsRunning

public bool IsRunning { get; }

Property Value

bool

QuantumSpaceDataProtectionProvider

A QuantumSpace-wide data protector. All services in the same QuantumSpace will use the same key

public IFireflyDataProtectionProvider QuantumSpaceDataProtectionProvider { get; }

Property Value

IFireflyDataProtectionProvider

ServiceDataProtectionProvider

A Service-wide data protector. All replicas of this service in the same QuantumSpace will use the same key

public IFireflyDataProtectionProvider ServiceDataProtectionProvider { get; }

Property Value

IFireflyDataProtectionProvider

ServiceName

public string ServiceName { get; }

Property Value

string

ServiceTags

public IServiceTagManager ServiceTags { get; }

Property Value

IServiceTagManager

Services

Gets the services configured for the program (for example, using HostBuilder.ConfigureServices(Action)).

public IServiceProvider Services { get; }

Property Value

IServiceProvider

State

public FireflyServiceStates State { get; }

Property Value

FireflyServiceStates

logger

protected ILogger logger { get; }

Property Value

ILogger

Methods

BuildServiceProvider(IServiceCollection)

protected virtual IServiceProvider BuildServiceProvider(IServiceCollection services)

Parameters

services IServiceCollection

Returns

IServiceProvider

ConfigurationBuilder(IConfigurationBuilder)

Configure service-wide configurations/setting loading and handling

protected virtual void ConfigurationBuilder(IConfigurationBuilder configBuilder)

Parameters

configBuilder IConfigurationBuilder

Configure(IGlowApplicationBuilder)

Configure middleware

protected virtual void Configure(IGlowApplicationBuilder app)

Parameters

app IGlowApplicationBuilder

ConfigureHost(IHostBuilder)

protected virtual void ConfigureHost(IHostBuilder hostBuilder)

Parameters

hostBuilder IHostBuilder

ConfigureInterop(IGlowApplicationInteropBuilder)

Configure interop middleware

protected virtual void ConfigureInterop(IGlowApplicationInteropBuilder app)

Parameters

app IGlowApplicationInteropBuilder

ConfigureLogging(ILoggingBuilder)

Configure logging

protected virtual void ConfigureLogging(ILoggingBuilder loggingBuilder)

Parameters

loggingBuilder ILoggingBuilder

ConfigureServices(IServiceCollection)

Configure Dependency-Injected services

protected virtual void ConfigureServices(IServiceCollection services)

Parameters

services IServiceCollection

ConfigureServicesAsync(IServiceCollection)

Configure Dependency-Injected services (async)

protected virtual Task ConfigureServicesAsync(IServiceCollection services)

Parameters

services IServiceCollection

Returns

Task

ConfigureWebHostBuilder(IWebHostBuilderProxy)

Configure ASP.Net enabled libraries that use IWebHostBuilder. You need Phoesion.Glow.SDK.AspAdapter package to get an IWebHostBuilder from the IWebHostBuilderProxy using builder.AsAsp()

protected virtual void ConfigureWebHostBuilder(IWebHostBuilderProxy builder)

Parameters

builder IWebHostBuilderProxy

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetDBContexts(string[])

protected virtual IEnumerable<object> GetDBContexts(string[] args)

Parameters

args string[]

Returns

IEnumerable<object>

Initialize()

protected virtual void Initialize()

OnHoldingMode()

A new version has been deployed and the current version is set in holding mode (a short time before it starts shutdown)

protected virtual Task OnHoldingMode()

Returns

Task

OnStartAsync(CancellationToken)

OnStartAsync() will be invoked after initialization but before starting to handle requests

protected virtual Task OnStartAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

Remarks

at this point, HostedServices have been started.

OnStartedAsync(CancellationToken)

OnStartedAsync() will be invoked after full initialization is successfully completed

protected virtual Task OnStartedAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

Remarks

at this point, HostedServices have been started.

OnStartingAsync(CancellationToken)

OnStartingAsync() will be invoked after initialization but before starting HostedServices

protected virtual Task OnStartingAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

OnStopAsync(CancellationToken)

Will be invoked during service shutdown

protected virtual Task OnStopAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

OnStoppedAsync(CancellationToken)

Will be invoked after service shutdown completed

protected virtual Task OnStoppedAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

OnStoppingAsync(CancellationToken)

Will be invoked before service shutdown

protected virtual Task OnStoppingAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

ReportIncident(IncidentTypes, string, string, object, bool)

public Task<bool> ReportIncident(IncidentTypes type, string title, string description, object data, bool IsEntitySpecific = false)

Parameters

type IncidentTypes
title string
description string
data object
IsEntitySpecific bool

Returns

Task<bool>