├── .gitignore ├── .nuget └── NuGet.exe ├── COPYING ├── COPYING.LESSER ├── DriverPackage.md ├── Hangfire.FluentNHibernate.ConsoleApplication ├── Hangfire.FluentNHibernate.ConsoleApplication.csproj └── Program.cs ├── Hangfire.FluentNHibernate.SampleStuff ├── Hangfire.FluentNHibernate.SampleStuff.csproj ├── HangfireActivator.cs ├── HangfireBootstrapper.cs ├── IJobMethods.cs ├── ILogPersistenceService.cs ├── ISqliteTempFileService.cs ├── JobMethods.cs ├── LogItem.cs ├── LogPersistenceService.cs ├── SqliteTempFileService.cs └── ThreadIDEnricher.cs ├── Hangfire.FluentNHibernate.WinformsApplication ├── App.config ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── Hangfire.FluentNHibernate.WinformsApplication.csproj ├── ILogEventEmitterService.cs ├── LogEventEmitterService.cs ├── LogEventRepositorySinkExtensions.cs ├── LogEventWrapper.cs ├── OnEmitHandler.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── packages.config ├── Hangfire.FluentNHibernateStorage.Tests ├── Base │ ├── Fixtures │ │ └── DatabaseFixtureBase.cs │ ├── JobQueue │ │ ├── FetchedJobTestsBase.cs │ │ ├── JobQueueMonitoringApiTests.cs │ │ ├── JobQueueTestsBase.cs │ │ └── PersistentJobQueueProviderCollectionTests.cs │ ├── Misc │ │ ├── Constants.cs │ │ ├── CountersAggregatorTestsBase.cs │ │ ├── DateHelperTests.cs │ │ ├── ExpirationManagerTestsBase.cs │ │ ├── FluentNHibernateStorageTests.cs │ │ ├── StorageConnectionTestsBase.cs │ │ ├── StorageOptionsTests.cs │ │ └── WriteOnlyTransactionTestsBase.cs │ ├── Monitoring │ │ └── MonitoringApiTestsBase.cs │ └── TestBase.cs ├── Hangfire.FluentNHibernateStorage.Tests.csproj ├── Hangfire.FluentNHibernateStorage.Tests.csproj.DotSettings ├── MySql │ ├── Fixtures │ │ ├── MySqlCollectionFixture.cs │ │ └── MySqlTestDatabaseFixture.cs │ ├── JobQueue │ │ ├── MySqlFetchedJobTests.cs │ │ ├── MySqlJobQueueMonitoringApiTests.cs │ │ └── MySqlJobQueueTests.cs │ ├── Misc │ │ ├── MySqlCounterAggregatorTests.cs │ │ ├── MySqlExpirationManagerTest.cs │ │ ├── MySqlFluentNHibernateStorageTests.cs │ │ ├── MySqlStorageConnectionTests.cs │ │ └── MySqlWriteOnlyTransactionTests.cs │ └── Monitoring │ │ └── MySqlMonitoringApiTests.cs ├── Properties │ └── AssemblyInfo.cs ├── SqlCe │ ├── Fixtures │ │ ├── SqlCeCollectionFixture.cs │ │ └── SqlCeTestDatabaseFixture.cs │ ├── JobQueue │ │ ├── SqlCeFetchedJobTests.cs │ │ ├── SqlCeJobQueueMonitoringApiTests.cs │ │ └── SqlCeJobQueueTests.cs │ ├── Misc │ │ ├── SqlCeCounterAggregatorTests.cs │ │ ├── SqlCeExpirationManagerTest.cs │ │ ├── SqlCeFluentNHibernateStorageTests.cs │ │ ├── SqlCeStorageConnectionTests.cs │ │ └── SqlCeWriteOnlyTransactionTests.cs │ └── Monitoring │ │ └── SqlCeMonitoringApiTests.cs ├── SqlServer │ ├── Fixtures │ │ ├── SqlServerCollectionFixture.cs │ │ └── SqlServerTestDatabaseFixture.cs │ ├── JobQueue │ │ ├── SqlServerFetchedJobTests.cs │ │ ├── SqlServerJobQueueMonitoringApiTests.cs │ │ └── SqlServerJobQueueTests.cs │ ├── Misc │ │ ├── SqlServerCounterAggregatorTests.cs │ │ ├── SqlServerExpirationManagerTest.cs │ │ ├── SqlServerFluentNHibernateStorageTests.cs │ │ ├── SqlServerStorageConnectionTests.cs │ │ └── SqlServerWriteOnlyTransactionTests.cs │ └── Monitoring │ │ └── SqlServerMonitoringApiTests.cs ├── Sqlite │ ├── Fixtures │ │ ├── SqliteCollectionFixture.cs │ │ └── SqliteTestDatabaseFixture.cs │ ├── JobQueue │ │ ├── SqliteFetchedJobTests.cs │ │ ├── SqliteJobQueueMonitoringApiTests.cs │ │ └── SqliteJobQueueTests.cs │ ├── Misc │ │ ├── SqliteCounterAggregatorTests.cs │ │ ├── SqliteExpirationManagerTests.cs │ │ ├── SqliteFluentNHibernateStorageTests.cs │ │ ├── SqliteStorageConnectionTests.cs │ │ └── SqliteWriteOnlyTransactionTests.cs │ └── Monitoring │ │ └── SqliteMonitoringApiTests.cs ├── StorageOptionsTests.cs ├── Utils │ └── JobInsertionHelper.cs ├── app.config └── packages.config ├── Hangfire.FluentNHibernateStorage.WebApplication ├── ChatHub.cs ├── ExtLogItem.cs ├── Hangfire.FluentNHibernateStorage.WebApplication.csproj ├── IChatHub.cs ├── IHub.cs ├── LogItemMap.cs ├── Pages │ ├── Error.cshtml │ ├── Error.cshtml.cs │ ├── Index.cshtml │ ├── Index.cshtml.cs │ ├── Privacy.cshtml │ ├── Privacy.cshtml.cs │ ├── Shared │ │ ├── _Layout.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── Program.cs ├── Properties │ └── launchSettings.json ├── SignalRSink.cs ├── SignalRSinkExtension.cs ├── SqliteSink.cs ├── SqliteSinkExtension.cs ├── Startup.cs ├── appsettings.Development.json ├── appsettings.json ├── libman.json └── wwwroot │ ├── css │ └── site.css │ ├── favicon.ico │ ├── js │ ├── signalr │ │ ├── README.md │ │ ├── dist │ │ │ ├── browser │ │ │ │ ├── signalr.js │ │ │ │ ├── signalr.js.map │ │ │ │ ├── signalr.min.js │ │ │ │ └── signalr.min.js.map │ │ │ ├── cjs │ │ │ │ ├── AbortController.js │ │ │ │ ├── AbortController.js.map │ │ │ │ ├── DefaultHttpClient.js │ │ │ │ ├── DefaultHttpClient.js.map │ │ │ │ ├── DefaultReconnectPolicy.js │ │ │ │ ├── DefaultReconnectPolicy.js.map │ │ │ │ ├── Errors.js │ │ │ │ ├── Errors.js.map │ │ │ │ ├── FetchHttpClient.js │ │ │ │ ├── FetchHttpClient.js.map │ │ │ │ ├── HandshakeProtocol.js │ │ │ │ ├── HandshakeProtocol.js.map │ │ │ │ ├── HeaderNames.js │ │ │ │ ├── HeaderNames.js.map │ │ │ │ ├── HttpClient.js │ │ │ │ ├── HttpClient.js.map │ │ │ │ ├── HttpConnection.js │ │ │ │ ├── HttpConnection.js.map │ │ │ │ ├── HubConnection.js │ │ │ │ ├── HubConnection.js.map │ │ │ │ ├── HubConnectionBuilder.js │ │ │ │ ├── HubConnectionBuilder.js.map │ │ │ │ ├── IConnection.js │ │ │ │ ├── IConnection.js.map │ │ │ │ ├── IHttpConnectionOptions.js │ │ │ │ ├── IHttpConnectionOptions.js.map │ │ │ │ ├── IHubProtocol.js │ │ │ │ ├── IHubProtocol.js.map │ │ │ │ ├── ILogger.js │ │ │ │ ├── ILogger.js.map │ │ │ │ ├── IRetryPolicy.js │ │ │ │ ├── IRetryPolicy.js.map │ │ │ │ ├── ITransport.js │ │ │ │ ├── ITransport.js.map │ │ │ │ ├── JsonHubProtocol.js │ │ │ │ ├── JsonHubProtocol.js.map │ │ │ │ ├── Loggers.js │ │ │ │ ├── Loggers.js.map │ │ │ │ ├── LongPollingTransport.js │ │ │ │ ├── LongPollingTransport.js.map │ │ │ │ ├── Polyfills.js │ │ │ │ ├── Polyfills.js.map │ │ │ │ ├── ServerSentEventsTransport.js │ │ │ │ ├── ServerSentEventsTransport.js.map │ │ │ │ ├── Stream.js │ │ │ │ ├── Stream.js.map │ │ │ │ ├── Subject.js │ │ │ │ ├── Subject.js.map │ │ │ │ ├── TextMessageFormat.js │ │ │ │ ├── TextMessageFormat.js.map │ │ │ │ ├── Utils.js │ │ │ │ ├── Utils.js.map │ │ │ │ ├── WebSocketTransport.js │ │ │ │ ├── WebSocketTransport.js.map │ │ │ │ ├── XhrHttpClient.js │ │ │ │ ├── XhrHttpClient.js.map │ │ │ │ ├── browser-index.js │ │ │ │ ├── browser-index.js.map │ │ │ │ ├── index.js │ │ │ │ └── index.js.map │ │ │ ├── esm │ │ │ │ ├── AbortController.d.ts │ │ │ │ ├── AbortController.js │ │ │ │ ├── AbortController.js.map │ │ │ │ ├── DefaultHttpClient.d.ts │ │ │ │ ├── DefaultHttpClient.js │ │ │ │ ├── DefaultHttpClient.js.map │ │ │ │ ├── DefaultReconnectPolicy.d.ts │ │ │ │ ├── DefaultReconnectPolicy.js │ │ │ │ ├── DefaultReconnectPolicy.js.map │ │ │ │ ├── Errors.d.ts │ │ │ │ ├── Errors.js │ │ │ │ ├── Errors.js.map │ │ │ │ ├── FetchHttpClient.d.ts │ │ │ │ ├── FetchHttpClient.js │ │ │ │ ├── FetchHttpClient.js.map │ │ │ │ ├── HandshakeProtocol.d.ts │ │ │ │ ├── HandshakeProtocol.js │ │ │ │ ├── HandshakeProtocol.js.map │ │ │ │ ├── HeaderNames.d.ts │ │ │ │ ├── HeaderNames.js │ │ │ │ ├── HeaderNames.js.map │ │ │ │ ├── HttpClient.d.ts │ │ │ │ ├── HttpClient.js │ │ │ │ ├── HttpClient.js.map │ │ │ │ ├── HttpConnection.d.ts │ │ │ │ ├── HttpConnection.js │ │ │ │ ├── HttpConnection.js.map │ │ │ │ ├── HubConnection.d.ts │ │ │ │ ├── HubConnection.js │ │ │ │ ├── HubConnection.js.map │ │ │ │ ├── HubConnectionBuilder.d.ts │ │ │ │ ├── HubConnectionBuilder.js │ │ │ │ ├── HubConnectionBuilder.js.map │ │ │ │ ├── IConnection.d.ts │ │ │ │ ├── IConnection.js │ │ │ │ ├── IConnection.js.map │ │ │ │ ├── IHttpConnectionOptions.d.ts │ │ │ │ ├── IHttpConnectionOptions.js │ │ │ │ ├── IHttpConnectionOptions.js.map │ │ │ │ ├── IHubProtocol.d.ts │ │ │ │ ├── IHubProtocol.js │ │ │ │ ├── IHubProtocol.js.map │ │ │ │ ├── ILogger.d.ts │ │ │ │ ├── ILogger.js │ │ │ │ ├── ILogger.js.map │ │ │ │ ├── IRetryPolicy.d.ts │ │ │ │ ├── IRetryPolicy.js │ │ │ │ ├── IRetryPolicy.js.map │ │ │ │ ├── ITransport.d.ts │ │ │ │ ├── ITransport.js │ │ │ │ ├── ITransport.js.map │ │ │ │ ├── JsonHubProtocol.d.ts │ │ │ │ ├── JsonHubProtocol.js │ │ │ │ ├── JsonHubProtocol.js.map │ │ │ │ ├── Loggers.d.ts │ │ │ │ ├── Loggers.js │ │ │ │ ├── Loggers.js.map │ │ │ │ ├── LongPollingTransport.d.ts │ │ │ │ ├── LongPollingTransport.js │ │ │ │ ├── LongPollingTransport.js.map │ │ │ │ ├── Polyfills.d.ts │ │ │ │ ├── Polyfills.js │ │ │ │ ├── Polyfills.js.map │ │ │ │ ├── ServerSentEventsTransport.d.ts │ │ │ │ ├── ServerSentEventsTransport.js │ │ │ │ ├── ServerSentEventsTransport.js.map │ │ │ │ ├── Stream.d.ts │ │ │ │ ├── Stream.js │ │ │ │ ├── Stream.js.map │ │ │ │ ├── Subject.d.ts │ │ │ │ ├── Subject.js │ │ │ │ ├── Subject.js.map │ │ │ │ ├── TextMessageFormat.d.ts │ │ │ │ ├── TextMessageFormat.js │ │ │ │ ├── TextMessageFormat.js.map │ │ │ │ ├── Utils.d.ts │ │ │ │ ├── Utils.js │ │ │ │ ├── Utils.js.map │ │ │ │ ├── WebSocketTransport.d.ts │ │ │ │ ├── WebSocketTransport.js │ │ │ │ ├── WebSocketTransport.js.map │ │ │ │ ├── XhrHttpClient.d.ts │ │ │ │ ├── XhrHttpClient.js │ │ │ │ ├── XhrHttpClient.js.map │ │ │ │ ├── browser-index.d.ts │ │ │ │ ├── browser-index.js │ │ │ │ ├── browser-index.js.map │ │ │ │ ├── index.d.ts │ │ │ │ ├── index.js │ │ │ │ └── index.js.map │ │ │ └── webworker │ │ │ │ ├── signalr.js │ │ │ │ ├── signalr.js.map │ │ │ │ ├── signalr.min.js │ │ │ │ └── signalr.min.js.map │ │ ├── package.json │ │ └── src │ │ │ ├── AbortController.ts │ │ │ ├── DefaultHttpClient.ts │ │ │ ├── DefaultReconnectPolicy.ts │ │ │ ├── Errors.ts │ │ │ ├── FetchHttpClient.ts │ │ │ ├── HandshakeProtocol.ts │ │ │ ├── HeaderNames.ts │ │ │ ├── HttpClient.ts │ │ │ ├── HttpConnection.ts │ │ │ ├── HubConnection.ts │ │ │ ├── HubConnectionBuilder.ts │ │ │ ├── IConnection.ts │ │ │ ├── IHttpConnectionOptions.ts │ │ │ ├── IHubProtocol.ts │ │ │ ├── ILogger.ts │ │ │ ├── IRetryPolicy.ts │ │ │ ├── ITransport.ts │ │ │ ├── JsonHubProtocol.ts │ │ │ ├── Loggers.ts │ │ │ ├── LongPollingTransport.ts │ │ │ ├── Polyfills.ts │ │ │ ├── ServerSentEventsTransport.ts │ │ │ ├── Stream.ts │ │ │ ├── Subject.ts │ │ │ ├── TextMessageFormat.ts │ │ │ ├── Utils.ts │ │ │ ├── WebSocketTransport.ts │ │ │ ├── XhrHttpClient.ts │ │ │ ├── browser-index.ts │ │ │ ├── index.ts │ │ │ └── third-party-notices.txt │ └── site.js │ └── lib │ ├── bootstrap │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ └── bootstrap.min.js.map │ ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map ├── Hangfire.FluentNHibernateStorage.sln ├── Hangfire.FluentNHibernateStorage ├── ArgumentHelper.cs ├── CountersAggregator.cs ├── Entities │ ├── CounterBase.cs │ ├── ICreatedAt.cs │ ├── IExpirableWithId.cs │ ├── IExpirableWithKey.cs │ ├── IExpireAtNullable.cs │ ├── IFetchedAtNullable.cs │ ├── IInt32Id.cs │ ├── IIntValue.cs │ ├── IJobChild.cs │ ├── IKeyWithStringValue.cs │ ├── IStringKey.cs │ ├── IStringValue.cs │ ├── Int32IdBase.cs │ ├── KeyValueTypeBase.cs │ ├── ServerData.cs │ ├── _AggregatedCounter.cs │ ├── _Counter.cs │ ├── _DistributedLock.cs │ ├── _Dual.cs │ ├── _Hash.cs │ ├── _Job.cs │ ├── _JobParameter.cs │ ├── _JobQueue.cs │ ├── _JobState.cs │ ├── _List.cs │ ├── _Server.cs │ └── _Set.cs ├── ExpirationManager.cs ├── Extensions │ ├── CancellationTokenExtensions.cs │ ├── DateHelper.cs │ └── MappingExtensions.cs ├── FluentNHibernateDistributedLock.cs ├── FluentNHibernateDistributedLockTimeoutException.cs ├── FluentNHibernateJobStorage.cs ├── FluentNHibernateJobStorageConnection.cs ├── FluentNHibernateJobStorageTestWrapper.cs ├── FluentNHibernateStorageBootstrapperConfigurationExtensions.cs ├── FluentNHibernateStorageFactory.cs ├── FluentNHibernateStorageOptions.cs ├── FluentNHibernateWriteOnlyTransaction.cs ├── ForcedUtcDateTimeType.cs ├── Hangfire.FluentNHibernateStorage.csproj ├── JobQueue │ ├── EnqueuedAndFetchedCountDto.cs │ ├── FetchedJob.cs │ ├── FluentNHibernateFetchedJob.cs │ ├── FluentNHibernateJobQueue.cs │ ├── FluentNHibernateJobQueueMonitoringApi.cs │ ├── FluentNHibernateJobQueueProvider.cs │ ├── IPersistentJobQueue.cs │ ├── IPersistentJobQueueMonitoringApi.cs │ ├── IPersistentJobQueueProvider.cs │ └── PersistentJobQueueProviderCollection.cs ├── Maps │ ├── ClassMapBase.cs │ ├── Constants.cs │ ├── Int32IdMapBase.cs │ ├── _AggregatedCounterMap.cs │ ├── _CounterBaseMap.cs │ ├── _CounterMap.cs │ ├── _DistributedLockMap.cs │ ├── _DualMap.cs │ ├── _HashMap.cs │ ├── _JobMap.cs │ ├── _JobParameterMap.cs │ ├── _JobQueueMap.cs │ ├── _JobStateMap.cs │ ├── _ListMap.cs │ ├── _ServerMap.cs │ └── _SetMap.cs ├── Monitoring │ └── FluentNHibernateMonitoringApi.cs ├── PrefixRenamer.cs ├── Properties │ └── AssemblyInfo.cs ├── ServerTimeSyncManager.cs ├── SqlUtil.cs ├── StatelessSessionWrapper.cs └── StringToInt32Converter.cs ├── LICENSE.MD ├── README.md ├── Run Tests.bat ├── nu-build └── build.bat └── nuspecs └── Hangfire.FluentNHibernateStorage.nuspec /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavierjefferson/Hangfire.FluentNHibernateStorage/98a5408b7f3314fce2166e4c321c5bfe9e621920/.nuget/NuGet.exe -------------------------------------------------------------------------------- /DriverPackage.md: -------------------------------------------------------------------------------- 1 | # Required Driver Packages 2 | 3 | For the use of any database other than SQL Server, you must also install an appropriate driver package: 4 | 5 | ### For MySQL: 6 | ``` 7 | Install-Package MySql.Data 8 | ``` 9 | 10 | ### For PostgreSQL: 11 | ``` 12 | Install-Package Npgsql 13 | ``` 14 | 15 | ### For Oracle Managed Provider: 16 | ``` 17 | Install-Package Oracle.ManagedDataAccess 18 | ``` 19 | 20 | ### For Firebird: 21 | ``` 22 | Install-Package FirebirdSql.Data.FirebirdClient 23 | ``` -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.ConsoleApplication/Hangfire.FluentNHibernate.ConsoleApplication.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.SampleStuff/Hangfire.FluentNHibernate.SampleStuff.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.SampleStuff/HangfireActivator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernate.SampleStuff 4 | { 5 | public class HangfireActivator : JobActivator 6 | { 7 | private readonly IServiceProvider _serviceProvider; 8 | 9 | public HangfireActivator(IServiceProvider serviceProvider) 10 | { 11 | _serviceProvider = serviceProvider; 12 | } 13 | 14 | public override object ActivateJob(Type type) 15 | { 16 | return _serviceProvider.GetService(type); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.SampleStuff/HangfireBootstrapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Hangfire.FluentNHibernateStorage; 3 | using Snork.FluentNHibernateTools; 4 | 5 | namespace Hangfire.FluentNHibernate.SampleStuff 6 | { 7 | public static class HangfireBootstrapper 8 | { 9 | public static IGlobalConfiguration SetupJobStorage(this IGlobalConfiguration globalConfiguration, 10 | ISqliteTempFileService sqliteTempFileService) 11 | { 12 | return globalConfiguration.UseFluentNHibernateJobStorage( 13 | sqliteTempFileService.GetConnectionString(), 14 | ProviderTypeEnum.SQLite); 15 | } 16 | 17 | public static IGlobalConfiguration SetupActivator( 18 | this IGlobalConfiguration globalConfiguration, IServiceProvider serviceProvider) 19 | { 20 | return globalConfiguration.UseActivator(new HangfireActivator(serviceProvider)); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.SampleStuff/IJobMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernate.SampleStuff 4 | { 5 | public interface IJobMethods 6 | { 7 | void WriteSomething(string id, int currentCounter, int stage, int stages); 8 | void HelloWorld(string id, DateTime whenQueued, TimeSpan interval); 9 | } 10 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.SampleStuff/ILogPersistenceService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Serilog.Events; 3 | 4 | namespace Hangfire.FluentNHibernate.SampleStuff 5 | { 6 | public interface ILogPersistenceService 7 | { 8 | List GetRecent(); 9 | void Insert(LogEvent l); 10 | } 11 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.SampleStuff/ISqliteTempFileService.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernate.SampleStuff 2 | { 3 | public interface ISqliteTempFileService 4 | { 5 | string GetConnectionString(); 6 | void CreateDatabase(); 7 | string GetDatabaseFileName(); 8 | } 9 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.SampleStuff/LogItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Newtonsoft.Json; 4 | using Serilog.Events; 5 | 6 | namespace Hangfire.FluentNHibernate.SampleStuff 7 | { 8 | public class LogItem 9 | { 10 | public LogItem() 11 | { 12 | } 13 | 14 | public LogItem(LogEvent logEvent) 15 | { 16 | var properties = new Dictionary(); 17 | if (logEvent.Properties != null) 18 | foreach (var m in logEvent.Properties.Keys) 19 | properties[m] = logEvent.Properties[m].ToString(); 20 | Id = Guid.NewGuid().ToString(); 21 | Timestamp = logEvent.Timestamp.ToString("yyyy.MM.dd HH:mm:ss.fff"); 22 | dt = logEvent.Timestamp.UtcDateTime; 23 | Level = logEvent.Level.ToString(); 24 | Message = logEvent.RenderMessage(); 25 | Exception = logEvent.Exception?.ToString() ?? "-"; 26 | Properties = JsonConvert.SerializeObject(properties); 27 | } 28 | 29 | [JsonProperty("dt")] public virtual DateTime dt { get; set; } 30 | [JsonProperty("id")] public virtual string Id { get; set; } 31 | 32 | [JsonProperty("timestamp")] public virtual string Timestamp { get; set; } 33 | 34 | [JsonProperty("level")] public virtual string Level { get; set; } 35 | 36 | [JsonProperty("exception")] public virtual string Exception { get; set; } 37 | 38 | [JsonProperty("message")] public virtual string Message { get; set; } 39 | 40 | [JsonProperty("properties")] public virtual string Properties { get; set; } 41 | } 42 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.SampleStuff/LogPersistenceService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Linq; 5 | using Newtonsoft.Json; 6 | using NHibernate; 7 | using Serilog.Events; 8 | 9 | namespace Hangfire.FluentNHibernate.SampleStuff 10 | { 11 | public class LogPersistenceService : ILogPersistenceService 12 | { 13 | private readonly ISessionFactory _sessionFactory; 14 | 15 | public LogPersistenceService(ISessionFactory sessionFactory) 16 | { 17 | _sessionFactory = sessionFactory; 18 | } 19 | 20 | public List GetRecent() 21 | { 22 | using (var statelessSession = _sessionFactory.OpenStatelessSession()) 23 | { 24 | using (var transaction = statelessSession.BeginTransaction(IsolationLevel.Serializable)) 25 | { 26 | return statelessSession.Query().OrderBy(i => i.dt).ToList(); 27 | } 28 | } 29 | } 30 | 31 | public void Insert(LogEvent logEvent) 32 | { 33 | using (var statelessSession = _sessionFactory.OpenStatelessSession()) 34 | { 35 | statelessSession.Insert(new LogItem (logEvent)); 36 | } 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.SampleStuff/ThreadIDEnricher.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using Serilog.Core; 3 | using Serilog.Events; 4 | 5 | namespace Hangfire.FluentNHibernate.SampleStuff 6 | { 7 | public class ThreadIDEnricher : ILogEventEnricher 8 | { 9 | public const string PropertyName = "ThreadID"; 10 | 11 | public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) 12 | { 13 | logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty( 14 | PropertyName, Thread.CurrentThread.Name)); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.WinformsApplication/ILogEventEmitterService.cs: -------------------------------------------------------------------------------- 1 | using Serilog.Core; 2 | 3 | namespace Hangfire.FluentNHibernate.WinformsApplication 4 | { 5 | public interface ILogEventEmitterService : ILogEventSink 6 | { 7 | event OnEmitHandler OnEmit; 8 | } 9 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.WinformsApplication/LogEventEmitterService.cs: -------------------------------------------------------------------------------- 1 | using Serilog.Events; 2 | 3 | namespace Hangfire.FluentNHibernate.WinformsApplication 4 | { 5 | public class LogEventEmitterService : ILogEventEmitterService 6 | { 7 | public event OnEmitHandler OnEmit; 8 | 9 | public void Emit(LogEvent logEvent) 10 | { 11 | OnEmit?.Invoke(logEvent); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.WinformsApplication/LogEventRepositorySinkExtensions.cs: -------------------------------------------------------------------------------- 1 | using Serilog; 2 | using Serilog.Configuration; 3 | 4 | namespace Hangfire.FluentNHibernate.WinformsApplication 5 | { 6 | public static class LogEventRepositorySinkExtensions 7 | { 8 | public static LoggerConfiguration LogEventRepositorySink( 9 | this LoggerSinkConfiguration loggerConfiguration, ILogEventEmitterService logEventEmitterService) 10 | { 11 | return loggerConfiguration.Sink(logEventEmitterService); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.WinformsApplication/LogEventWrapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Hangfire.FluentNHibernate.SampleStuff; 3 | using Serilog.Events; 4 | 5 | namespace Hangfire.FluentNHibernate.WinformsApplication 6 | { 7 | public class LogEventWrapper 8 | { 9 | private readonly IFormatProvider _formatProvider; 10 | private readonly LogEvent _logEvent; 11 | 12 | public LogEventWrapper(LogEvent logEvent, IFormatProvider formatProvider) 13 | { 14 | _formatProvider = formatProvider; 15 | _logEvent = logEvent; 16 | } 17 | 18 | public string Message => _logEvent.RenderMessage(_formatProvider); 19 | 20 | public string LoggerName => "tbd"; 21 | 22 | public string ThreadName => _logEvent.Properties[ThreadIDEnricher.PropertyName].ToString(); 23 | 24 | public LogEventLevel Level => _logEvent.Level; 25 | 26 | public string TimeStamp => _logEvent.Timestamp.DateTime.ToString("yyyy-MM-dd hh:mm:ss"); 27 | 28 | public string Exception => _logEvent.Exception?.Message; 29 | } 30 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.WinformsApplication/OnEmitHandler.cs: -------------------------------------------------------------------------------- 1 | using Serilog.Events; 2 | 3 | namespace Hangfire.FluentNHibernate.WinformsApplication 4 | { 5 | public delegate void OnEmitHandler(LogEvent logEvent); 6 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.WinformsApplication/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Hangfire.FluentNHibernate.SampleApplication")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("Hangfire.FluentNHibernate.SampleApplication")] 12 | [assembly: AssemblyCopyright("Copyright © 2017")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("7bf347bc-a06b-431e-9234-e3bbd6af10dd")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.WinformsApplication/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Hangfire.FluentNHibernate.WinformsApplication.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernate.WinformsApplication/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Base/JobQueue/FetchedJobTestsBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Hangfire.FluentNHibernateStorage.JobQueue; 3 | using Hangfire.FluentNHibernateStorage.Tests.Base.Fixtures; 4 | using Xunit; 5 | 6 | namespace Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue 7 | { 8 | public abstract class FetchedJobTestsBase : TestBase 9 | { 10 | protected FetchedJobTestsBase(DatabaseFixtureBase fixture) : base(fixture) 11 | { 12 | _fetchedJob = new FetchedJob {Id = _id, JobId = JobId, Queue = Queue}; 13 | } 14 | 15 | private const int JobId = 1; 16 | private const string Queue = "queue"; 17 | private readonly FetchedJob _fetchedJob; 18 | private readonly int _id = 0; 19 | 20 | 21 | [Fact] 22 | public void Ctor_CorrectlySets_AllInstanceProperties() 23 | { 24 | var fetchedJob = new FluentNHibernateFetchedJob(GetStorage(), _fetchedJob); 25 | 26 | Assert.Equal(JobId.ToString(), fetchedJob.JobId); 27 | Assert.Equal(Queue, fetchedJob.Queue); 28 | } 29 | 30 | [Fact] 31 | public void Ctor_ThrowsAnException_WhenConnectionIsNull() 32 | { 33 | var exception = Assert.Throws( 34 | () => new FluentNHibernateFetchedJob(null, _fetchedJob)); 35 | 36 | Assert.Equal("storage", exception.ParamName); 37 | } 38 | 39 | [Fact] 40 | public void Ctor_ThrowsAnException_WhenStorageIsNull() 41 | { 42 | var exception = Assert.Throws( 43 | () => new FluentNHibernateFetchedJob(null, _fetchedJob)); 44 | 45 | Assert.Equal("storage", exception.ParamName); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Base/Misc/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Tests.Base.Misc 2 | { 3 | public class Constants 4 | { 5 | public const string MySqlFixtureCollectionName = "733dccc8-7d9e-4373-9f17-2a906f68302d"; 6 | public const string SqlCeFixtureCollectionName = "d33dccc8-7d9e-4373-9f17-2a906f68302c"; 7 | public const string SqliteFixtureCollectionName = "b6625313-9155-410e-9be1-0b79656ec6c2"; 8 | public const string SqlServerFixtureCollectionName = "80f893a1-572b-4130-a5e4-c3aa80a1734b"; 9 | } 10 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Base/Misc/CountersAggregatorTestsBase.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Threading; 3 | using Hangfire.FluentNHibernateStorage.Entities; 4 | using Hangfire.FluentNHibernateStorage.Tests.Base.Fixtures; 5 | using Xunit; 6 | 7 | namespace Hangfire.FluentNHibernateStorage.Tests.Base.Misc 8 | { 9 | public abstract class CountersAggregatorTestsBase : TestBase 10 | { 11 | protected CountersAggregatorTestsBase(DatabaseFixtureBase fixture) : base(fixture) 12 | { 13 | } 14 | 15 | 16 | [Fact] 17 | public void CountersAggregatorExecutesProperly() 18 | { 19 | UseJobStorageConnectionWithSession((sessionWrapper, connection) => 20 | { 21 | //Arrange 22 | sessionWrapper.Insert(new _Counter 23 | {Key = "key", Value = 1, ExpireAt = connection.Storage.UtcNow.AddHours(1)}); 24 | 25 | 26 | var cts = new CancellationTokenSource(); 27 | cts.Cancel(); 28 | 29 | // Act 30 | var countersAggregator = new CountersAggregator(connection.Storage); 31 | countersAggregator.Execute(cts.Token); 32 | 33 | // Assert 34 | Assert.Equal(1, sessionWrapper.Query<_AggregatedCounter>().Count()); 35 | }); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Base/Misc/DateHelperTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | using Xunit; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.Base.Misc 6 | { 7 | public class DateHelperTests 8 | { 9 | [Fact] 10 | public void TestDateTimeToLong() 11 | { 12 | var r = new Random(); 13 | for (var iteration = 0; iteration < 1000; iteration++) 14 | { 15 | var dateTimeValue = DateTimeOffset.FromUnixTimeSeconds(r.Next()).UtcDateTime; 16 | var longValue = dateTimeValue.ToEpochDate(); 17 | var newDateTimeValue = longValue.FromEpochDate(); 18 | Assert.Equal(newDateTimeValue, dateTimeValue); 19 | } 20 | } 21 | 22 | [Fact] 23 | public void TestLongToDateTime() 24 | { 25 | var r = new Random(); 26 | for (var iteration = 0; iteration < 1000; iteration++) 27 | { 28 | var longValue = Convert.ToInt64(r.NextDouble() * 315537897599999) - 62135596800000; 29 | var dateTimeValue = longValue.FromEpochDate(); 30 | var newLongValue = dateTimeValue.ToEpochDate(); 31 | Assert.Equal(longValue, newLongValue); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Base/Misc/StorageOptionsTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xunit; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.Base.Misc 5 | { 6 | public class StorageOptionsTests 7 | { 8 | [Fact] 9 | public void Ctor_SetsTheDefaultOptions() 10 | { 11 | var options = new FluentNHibernateStorageOptions(); 12 | 13 | Assert.True(options.QueuePollInterval > TimeSpan.Zero); 14 | 15 | Assert.True(options.JobExpirationCheckInterval > TimeSpan.Zero); 16 | Assert.True(options.UpdateSchema); 17 | } 18 | 19 | [Fact] 20 | public void Set_QueuePollInterval_SetsTheValue() 21 | { 22 | var options = new FluentNHibernateStorageOptions(); 23 | options.QueuePollInterval = TimeSpan.FromSeconds(1); 24 | Assert.Equal(TimeSpan.FromSeconds(1), options.QueuePollInterval); 25 | } 26 | 27 | [Fact] 28 | public void Set_QueuePollInterval_ShouldThrowAnException_WhenGivenIntervalIsEqualToZero() 29 | { 30 | var options = new FluentNHibernateStorageOptions(); 31 | Assert.Throws( 32 | () => options.QueuePollInterval = TimeSpan.Zero); 33 | } 34 | 35 | [Fact] 36 | public void Set_QueuePollInterval_ShouldThrowAnException_WhenGivenIntervalIsNegative() 37 | { 38 | var options = new FluentNHibernateStorageOptions(); 39 | Assert.Throws( 40 | () => options.QueuePollInterval = TimeSpan.FromSeconds(-1)); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Hangfire.FluentNHibernateStorage.Tests.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | True -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/MySql/Fixtures/MySqlCollectionFixture.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Xunit; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.MySql.Fixtures 5 | { 6 | [CollectionDefinition(Constants.MySqlFixtureCollectionName)] 7 | public class MySqlCollectionFixture : ICollectionFixture 8 | { 9 | // This class has no code, and is never created. Its purpose is simply 10 | // to be the place to apply [CollectionDefinition] and all the 11 | // ICollectionFixture<> interfaces. 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/MySql/JobQueue/MySqlFetchedJobTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.MySql.Fixtures; 4 | using Xunit; 5 | 6 | namespace Hangfire.FluentNHibernateStorage.Tests.MySql.JobQueue 7 | { 8 | [Collection(Constants.MySqlFixtureCollectionName)] 9 | public class 10 | MySqlFetchedJobTests : FetchedJobTestsBase 11 | { 12 | public MySqlFetchedJobTests(MySqlTestDatabaseFixture fixture) : base(fixture) 13 | { 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/MySql/JobQueue/MySqlJobQueueMonitoringApiTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.MySql.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.MySql.JobQueue 6 | { 7 | [Xunit.Collection(Constants.MySqlFixtureCollectionName)] 8 | public class 9 | MySqlJobQueueMonitoringApiTests : JobQueueMonitoringApiTests 10 | { 11 | public MySqlJobQueueMonitoringApiTests(MySqlTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/MySql/JobQueue/MySqlJobQueueTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.MySql.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.MySql.JobQueue 6 | { 7 | [Xunit.Collection(Constants.MySqlFixtureCollectionName)] 8 | public class 9 | MySqlJobQueueTests : JobQueueTestsBase 10 | { 11 | public MySqlJobQueueTests(MySqlTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/MySql/Misc/MySqlCounterAggregatorTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.MySql.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.MySql.Misc 5 | { 6 | [Xunit.Collection(Constants.MySqlFixtureCollectionName)] 7 | public class MySqlCounterAggregatorTests : CountersAggregatorTestsBase 8 | { 9 | public MySqlCounterAggregatorTests(MySqlTestDatabaseFixture fixture) : base(fixture) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/MySql/Misc/MySqlExpirationManagerTest.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.MySql.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.MySql.Misc 5 | { 6 | [Xunit.Collection(Constants.MySqlFixtureCollectionName)] 7 | public class MySqlExpirationManagerTest : ExpirationManagerTestsBase 8 | { 9 | public MySqlExpirationManagerTest(MySqlTestDatabaseFixture fixture) : base(fixture) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/MySql/Misc/MySqlFluentNHibernateStorageTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.MySql.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.MySql.Misc 5 | { 6 | [Xunit.Collection(Constants.MySqlFixtureCollectionName)] 7 | public class MySqlFluentNHibernateStorageTests : FluentNHibernateStorageTests 8 | { 9 | public MySqlFluentNHibernateStorageTests(MySqlTestDatabaseFixture fixture) : base(fixture) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/MySql/Misc/MySqlStorageConnectionTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.MySql.Fixtures; 3 | using Xunit.Abstractions; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.MySql.Misc 6 | { 7 | [Xunit.Collection(Constants.MySqlFixtureCollectionName)] 8 | public class 9 | MySqlStorageConnectionTests : StorageConnectionTestsBase 10 | { 11 | public MySqlStorageConnectionTests(MySqlTestDatabaseFixture fixture, ITestOutputHelper testOutputHelper) : base(fixture, testOutputHelper) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/MySql/Misc/MySqlWriteOnlyTransactionTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.MySql.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.MySql.Misc 5 | { 6 | [Xunit.Collection(Constants.MySqlFixtureCollectionName)] 7 | public class 8 | MySqlWriteOnlyTransactionTests : WriteOnlyTransactionTestsBase 9 | { 10 | public MySqlWriteOnlyTransactionTests(MySqlTestDatabaseFixture fixture) : base(fixture) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/MySql/Monitoring/MySqlMonitoringApiTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Monitoring; 3 | using Hangfire.FluentNHibernateStorage.Tests.MySql.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.MySql.Monitoring 6 | { 7 | [Xunit.Collection(Constants.MySqlFixtureCollectionName)] 8 | public class 9 | MySqlMonitoringApiTests : MonitoringApiTestsBase 10 | { 11 | public MySqlMonitoringApiTests(MySqlTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Hangfire.MySql.Tests")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("Hangfire.MySql.Tests")] 12 | [assembly: AssemblyCopyright("Copyright © 2015")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("d3d9b19a-a9fc-4ff6-a327-aca8359e68ca")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlCe/Fixtures/SqlCeCollectionFixture.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Xunit; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlCe.Fixtures 5 | { 6 | [CollectionDefinition(Constants.SqlCeFixtureCollectionName)] 7 | public class SqlCeCollectionFixture : ICollectionFixture 8 | { 9 | // This class has no code, and is never created. Its purpose is simply 10 | // to be the place to apply [CollectionDefinition] and all the 11 | // ICollectionFixture<> interfaces. 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlCe/JobQueue/SqlCeFetchedJobTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.SqlCe.Fixtures; 4 | using Xunit; 5 | 6 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlCe.JobQueue 7 | { 8 | [Collection(Constants.SqlCeFixtureCollectionName)] 9 | 10 | public class 11 | SqlCeFetchedJobTests : FetchedJobTestsBase 12 | { 13 | public SqlCeFetchedJobTests(SqlCeTestDatabaseFixture fixture) : base(fixture) 14 | { 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlCe/JobQueue/SqlCeJobQueueMonitoringApiTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.SqlCe.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlCe.JobQueue 6 | { 7 | [Xunit.Collection(Constants.SqlCeFixtureCollectionName)] 8 | public class 9 | SqlCeJobQueueMonitoringApiTests : JobQueueMonitoringApiTests 10 | { 11 | public SqlCeJobQueueMonitoringApiTests(SqlCeTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlCe/JobQueue/SqlCeJobQueueTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.SqlCe.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlCe.JobQueue 6 | { 7 | [Xunit.Collection(Constants.SqlCeFixtureCollectionName)] 8 | public class 9 | SqlCeJobQueueTests : JobQueueTestsBase 10 | { 11 | public SqlCeJobQueueTests(SqlCeTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlCe/Misc/SqlCeCounterAggregatorTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.SqlCe.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlCe.Misc 5 | { 6 | [Xunit.Collection(Constants.SqlCeFixtureCollectionName)] 7 | public class SqlCeCounterAggregatorTests : CountersAggregatorTestsBase 8 | { 9 | public SqlCeCounterAggregatorTests(SqlCeTestDatabaseFixture fixture) : base(fixture) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlCe/Misc/SqlCeExpirationManagerTest.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.SqlCe.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlCe.Misc 5 | { 6 | [Xunit.Collection(Constants.SqlCeFixtureCollectionName)] 7 | public class SqlCeExpirationManagerTest : ExpirationManagerTestsBase 8 | { 9 | public SqlCeExpirationManagerTest(SqlCeTestDatabaseFixture fixture) : base(fixture) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlCe/Misc/SqlCeFluentNHibernateStorageTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.SqlCe.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlCe.Misc 5 | { 6 | [Xunit.Collection(Constants.SqlCeFixtureCollectionName)] 7 | public class SqlCeFluentNHibernateStorageTests : FluentNHibernateStorageTests 8 | { 9 | public SqlCeFluentNHibernateStorageTests(SqlCeTestDatabaseFixture fixture) : base(fixture) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlCe/Misc/SqlCeStorageConnectionTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.SqlCe.Fixtures; 3 | using Xunit.Abstractions; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlCe.Misc 6 | { 7 | [Xunit.Collection(Constants.SqlCeFixtureCollectionName)] 8 | public class 9 | SqlCeStorageConnectionTests : StorageConnectionTestsBase 10 | { 11 | public SqlCeStorageConnectionTests(SqlCeTestDatabaseFixture fixture, ITestOutputHelper testOutputHelper) : base(fixture, testOutputHelper) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlCe/Misc/SqlCeWriteOnlyTransactionTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.SqlCe.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlCe.Misc 5 | { 6 | [Xunit.Collection(Constants.SqlCeFixtureCollectionName)] 7 | public class 8 | SqlCeWriteOnlyTransactionTests : WriteOnlyTransactionTestsBase 9 | { 10 | public SqlCeWriteOnlyTransactionTests(SqlCeTestDatabaseFixture fixture) : base(fixture) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlCe/Monitoring/SqlCeMonitoringApiTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Monitoring; 3 | using Hangfire.FluentNHibernateStorage.Tests.SqlCe.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlCe.Monitoring 6 | { 7 | [Xunit.Collection(Constants.SqlCeFixtureCollectionName)] 8 | public class 9 | SqlCeMonitoringApiTests : MonitoringApiTestsBase 10 | { 11 | public SqlCeMonitoringApiTests(SqlCeTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlServer/Fixtures/SqlServerCollectionFixture.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Xunit; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlServer.Fixtures 5 | { 6 | [CollectionDefinition(Constants.SqlServerFixtureCollectionName)] 7 | public class SqlServerCollectionFixture : ICollectionFixture 8 | { 9 | // This class has no code, and is never created. Its purpose is simply 10 | // to be the place to apply [CollectionDefinition] and all the 11 | // ICollectionFixture<> interfaces. 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlServer/JobQueue/SqlServerFetchedJobTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.SqlServer.Fixtures; 4 | using Xunit; 5 | 6 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlServer.JobQueue 7 | { 8 | [Collection(Constants.SqlServerFixtureCollectionName)] 9 | public class 10 | SqlServerFetchedJobTests : FetchedJobTestsBase 11 | { 12 | public SqlServerFetchedJobTests(SqlServerTestDatabaseFixture fixture) : base(fixture) 13 | { 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlServer/JobQueue/SqlServerJobQueueMonitoringApiTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.SqlServer.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlServer.JobQueue 6 | { 7 | [Xunit.Collection(Constants.SqlServerFixtureCollectionName)] 8 | public class 9 | SqlServerJobQueueMonitoringApiTests : JobQueueMonitoringApiTests 10 | { 11 | public SqlServerJobQueueMonitoringApiTests(SqlServerTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlServer/JobQueue/SqlServerJobQueueTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.SqlServer.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlServer.JobQueue 6 | { 7 | [Xunit.Collection(Constants.SqlServerFixtureCollectionName)] 8 | public class 9 | SqlServerJobQueueTests : JobQueueTestsBase 10 | { 11 | public SqlServerJobQueueTests(SqlServerTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlServer/Misc/SqlServerCounterAggregatorTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.SqlServer.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlServer.Misc 5 | { 6 | [Xunit.Collection(Constants.SqlServerFixtureCollectionName)] 7 | public class SqlServerCounterAggregatorTests : CountersAggregatorTestsBase 8 | { 9 | public SqlServerCounterAggregatorTests(SqlServerTestDatabaseFixture fixture) : base(fixture) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlServer/Misc/SqlServerExpirationManagerTest.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.SqlServer.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlServer.Misc 5 | { 6 | [Xunit.Collection(Constants.SqlServerFixtureCollectionName)] 7 | public class SqlServerExpirationManagerTest : ExpirationManagerTestsBase 8 | { 9 | public SqlServerExpirationManagerTest(SqlServerTestDatabaseFixture fixture) : base(fixture) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlServer/Misc/SqlServerFluentNHibernateStorageTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.SqlServer.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlServer.Misc 5 | { 6 | [Xunit.Collection(Constants.SqlServerFixtureCollectionName)] 7 | public class SqlServerFluentNHibernateStorageTests : FluentNHibernateStorageTests 8 | { 9 | public SqlServerFluentNHibernateStorageTests(SqlServerTestDatabaseFixture fixture) : base(fixture) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlServer/Misc/SqlServerStorageConnectionTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.SqlServer.Fixtures; 3 | using Xunit.Abstractions; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlServer.Misc 6 | { 7 | [Xunit.Collection(Constants.SqlServerFixtureCollectionName)] 8 | public class 9 | SqlServerStorageConnectionTests : StorageConnectionTestsBase 10 | { 11 | public SqlServerStorageConnectionTests(SqlServerTestDatabaseFixture fixture, ITestOutputHelper testOutputHelper) : base(fixture, testOutputHelper) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlServer/Misc/SqlServerWriteOnlyTransactionTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.SqlServer.Fixtures; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlServer.Misc 5 | { 6 | [Xunit.Collection(Constants.SqlServerFixtureCollectionName)] 7 | public class 8 | SqlServerWriteOnlyTransactionTests : WriteOnlyTransactionTestsBase 9 | { 10 | public SqlServerWriteOnlyTransactionTests(SqlServerTestDatabaseFixture fixture) : base(fixture) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/SqlServer/Monitoring/SqlServerMonitoringApiTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Monitoring; 3 | using Hangfire.FluentNHibernateStorage.Tests.SqlServer.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.SqlServer.Monitoring 6 | { 7 | [Xunit.Collection(Constants.SqlServerFixtureCollectionName)] 8 | public class 9 | SqlServerMonitoringApiTests : MonitoringApiTestsBase 10 | { 11 | public SqlServerMonitoringApiTests(SqlServerTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Sqlite/Fixtures/SqliteCollectionFixture.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Xunit; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests.Sqlite.Fixtures 5 | { 6 | [CollectionDefinition(Constants.SqliteFixtureCollectionName)] 7 | public class SqliteCollectionFixture : ICollectionFixture 8 | { 9 | // This class has no code, and is never created. Its purpose is simply 10 | // to be the place to apply [CollectionDefinition] and all the 11 | // ICollectionFixture<> interfaces. 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Sqlite/Fixtures/SqliteTestDatabaseFixture.cs: -------------------------------------------------------------------------------- 1 | using System.Data.SQLite; 2 | using System.IO; 3 | using System.Threading; 4 | using Hangfire.FluentNHibernateStorage.Tests.Base.Fixtures; 5 | using Snork.FluentNHibernateTools; 6 | 7 | namespace Hangfire.FluentNHibernateStorage.Tests.Sqlite.Fixtures 8 | { 9 | public class SqliteTestDatabaseFixture : DatabaseFixtureBase 10 | { 11 | private static readonly object GlobalLock = new object(); 12 | private static DirectoryInfo _testFolder; 13 | 14 | public SqliteTestDatabaseFixture() 15 | { 16 | _testFolder = new DirectoryInfo(GetTempPath()); 17 | _testFolder.Create(); 18 | Monitor.Enter(GlobalLock); 19 | CreateDatabase(); 20 | } 21 | 22 | public override ProviderTypeEnum ProviderType => ProviderTypeEnum.SQLite; 23 | 24 | public override void Cleanup() 25 | { 26 | try 27 | 28 | { 29 | DeleteFolder(_testFolder); 30 | } 31 | catch 32 | { 33 | } 34 | } 35 | 36 | public override string GetConnectionString() 37 | { 38 | var databaseFileName = GetDatabaseFileName(); 39 | return $"Data Source={databaseFileName};Version=3"; 40 | } 41 | 42 | public override void OnDispose() 43 | { 44 | Monitor.Exit(GlobalLock); 45 | Cleanup(); 46 | } 47 | 48 | public override void CreateDatabase() 49 | { 50 | var databaseFileName = GetDatabaseFileName(); 51 | if (!File.Exists(databaseFileName)) SQLiteConnection.CreateFile(databaseFileName); 52 | } 53 | 54 | 55 | private string GetDatabaseFileName() 56 | { 57 | return Path.Combine(_testFolder.FullName, "database.sqlite"); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Sqlite/JobQueue/SqliteFetchedJobTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.Sqlite.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.Sqlite.JobQueue 6 | { 7 | [Xunit.Collection(Constants.SqliteFixtureCollectionName)] 8 | public class SqliteFetchedJobTests : FetchedJobTestsBase 9 | { 10 | public SqliteFetchedJobTests(SqliteTestDatabaseFixture fixture) : base(fixture) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Sqlite/JobQueue/SqliteJobQueueMonitoringApiTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.Sqlite.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.Sqlite.JobQueue 6 | { 7 | [Xunit.Collection(Constants.SqliteFixtureCollectionName)] 8 | public class 9 | SqliteJobQueueMonitoringApiTests : JobQueueMonitoringApiTests 10 | { 11 | public SqliteJobQueueMonitoringApiTests(SqliteTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Sqlite/JobQueue/SqliteJobQueueTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.JobQueue; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 3 | using Hangfire.FluentNHibernateStorage.Tests.Sqlite.Fixtures; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.Sqlite.JobQueue 6 | { 7 | [Xunit.Collection(Constants.SqliteFixtureCollectionName)] 8 | public class SqliteJobQueueTests : JobQueueTestsBase 9 | { 10 | public SqliteJobQueueTests(SqliteTestDatabaseFixture fixture) : base(fixture) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Sqlite/Misc/SqliteCounterAggregatorTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.Sqlite.Fixtures; 3 | using Xunit; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.Sqlite.Misc 6 | { 7 | [Collection(Constants.SqliteFixtureCollectionName)] 8 | public class SqliteCounterAggregatorTests : CountersAggregatorTestsBase 9 | { 10 | public SqliteCounterAggregatorTests(SqliteTestDatabaseFixture fixture) : base(fixture) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Sqlite/Misc/SqliteExpirationManagerTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.Sqlite.Fixtures; 3 | using Xunit; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.Sqlite.Misc 6 | { 7 | [Collection(Constants.SqliteFixtureCollectionName)] 8 | public class SqliteExpirationManagerTests : ExpirationManagerTestsBase 9 | { 10 | public SqliteExpirationManagerTests(SqliteTestDatabaseFixture fixture) : base(fixture) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Sqlite/Misc/SqliteFluentNHibernateStorageTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.Sqlite.Fixtures; 3 | using Xunit; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.Sqlite.Misc 6 | { 7 | [Collection(Constants.SqliteFixtureCollectionName)] 8 | public class SqliteFluentNHibernateStorageTests : FluentNHibernateStorageTests 9 | { 10 | public SqliteFluentNHibernateStorageTests(SqliteTestDatabaseFixture fixture) : base(fixture) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Sqlite/Misc/SqliteStorageConnectionTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.Sqlite.Fixtures; 3 | using Xunit; 4 | using Xunit.Abstractions; 5 | 6 | namespace Hangfire.FluentNHibernateStorage.Tests.Sqlite.Misc 7 | { 8 | [Collection(Constants.SqliteFixtureCollectionName)] 9 | public class 10 | SqliteStorageConnectionTests : StorageConnectionTestsBase 11 | { 12 | public SqliteStorageConnectionTests(SqliteTestDatabaseFixture fixture, ITestOutputHelper testOutputHelper) : base(fixture, testOutputHelper) 13 | { 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Sqlite/Misc/SqliteWriteOnlyTransactionTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.Sqlite.Fixtures; 3 | using Xunit; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Tests.Sqlite.Misc 6 | { 7 | [Collection(Constants.SqliteFixtureCollectionName)] 8 | public class 9 | SqliteWriteOnlyTransactionTests : WriteOnlyTransactionTestsBase 10 | { 11 | public SqliteWriteOnlyTransactionTests(SqliteTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Sqlite/Monitoring/SqliteMonitoringApiTests.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Tests.Base.Misc; 2 | using Hangfire.FluentNHibernateStorage.Tests.Base.Monitoring; 3 | using Hangfire.FluentNHibernateStorage.Tests.Sqlite.Fixtures; 4 | using Xunit; 5 | 6 | namespace Hangfire.FluentNHibernateStorage.Tests.Sqlite.Monitoring 7 | { 8 | [Collection(Constants.SqliteFixtureCollectionName)] 9 | public class SqliteMonitoringApiTests : MonitoringApiTestsBase 10 | { 11 | public SqliteMonitoringApiTests(SqliteTestDatabaseFixture fixture) : base(fixture) 12 | { 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/StorageOptionsTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xunit; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests 5 | { 6 | public class StorageOptionsTests 7 | { 8 | [Fact] 9 | public void Ctor_SetsTheDefaultOptions() 10 | { 11 | var options = new FluentNHibernateStorageOptions(); 12 | 13 | Assert.True(options.QueuePollInterval > TimeSpan.Zero); 14 | 15 | Assert.True(options.JobExpirationCheckInterval > TimeSpan.Zero); 16 | Assert.True(options.UpdateSchema); 17 | } 18 | 19 | [Fact] 20 | public void Set_QueuePollInterval_SetsTheValue() 21 | { 22 | var options = new FluentNHibernateStorageOptions(); 23 | options.QueuePollInterval = TimeSpan.FromSeconds(1); 24 | Assert.Equal(TimeSpan.FromSeconds(1), options.QueuePollInterval); 25 | } 26 | 27 | [Fact] 28 | public void Set_QueuePollInterval_ShouldThrowAnException_WhenGivenIntervalIsEqualToZero() 29 | { 30 | var options = new FluentNHibernateStorageOptions(); 31 | Assert.Throws( 32 | () => options.QueuePollInterval = TimeSpan.Zero); 33 | } 34 | 35 | [Fact] 36 | public void Set_QueuePollInterval_ShouldThrowAnException_WhenGivenIntervalIsNegative() 37 | { 38 | var options = new FluentNHibernateStorageOptions(); 39 | Assert.Throws( 40 | () => options.QueuePollInterval = TimeSpan.FromSeconds(-1)); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.Tests/Utils/JobInsertionHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Hangfire.FluentNHibernateStorage.Entities; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Tests 5 | { 6 | internal static class JobInsertionHelper 7 | { 8 | public static _Job InsertNewJob(StatelessSessionWrapper session, Action<_Job> action = null) 9 | { 10 | var newJob = new _Job 11 | { 12 | InvocationData = string.Empty, 13 | Arguments = string.Empty, 14 | CreatedAt = session.Storage.UtcNow 15 | }; 16 | action?.Invoke(newJob); 17 | session.Insert(newJob); 18 | 19 | return newJob; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/ChatHub.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Hangfire.FluentNHibernate.SampleStuff; 3 | using Microsoft.AspNetCore.SignalR; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.WebApplication 6 | { 7 | public class ChatHub : Hub 8 | { 9 | private readonly ILogPersistenceService _logPersistenceService; 10 | 11 | public ChatHub(ILogPersistenceService logPersistenceService) 12 | { 13 | _logPersistenceService = logPersistenceService; 14 | } 15 | 16 | public async Task GetRecentLog() 17 | { 18 | var logItems = _logPersistenceService.GetRecent(); 19 | foreach (var logItem in logItems) 20 | await Clients.Caller.SendLogAsObject(logItem); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/ExtLogItem.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.WebApplication 4 | { 5 | public class ExtLogItem 6 | { 7 | [JsonProperty("id")] public string id { get; set; } 8 | 9 | [JsonProperty("timestamp")] public string timestamp { get; set; } 10 | 11 | [JsonProperty("level")] public string level { get; set; } 12 | 13 | [JsonProperty("message")] public string message { get; set; } 14 | 15 | [JsonProperty("exception")] public string exception { get; set; } 16 | 17 | [JsonProperty("properties")] public string properties { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/Hangfire.FluentNHibernateStorage.WebApplication.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/IChatHub.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.WebApplication 2 | { 3 | public interface IChatHub : IHub 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/IHub.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Hangfire.FluentNHibernate.SampleStuff; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.WebApplication 5 | { 6 | public interface IHub 7 | { 8 | Task SendLogAsString(string message); 9 | 10 | Task SendLogAsObject(LogItem messageObject); 11 | } 12 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/LogItemMap.cs: -------------------------------------------------------------------------------- 1 | using FluentNHibernate.Mapping; 2 | using Hangfire.FluentNHibernate.SampleStuff; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.WebApplication 5 | { 6 | public class LogItemMap : ClassMap 7 | { 8 | public LogItemMap() 9 | { 10 | Table("Logs"); 11 | Id(i => i.Id).Column("`id`").GeneratedBy.Assigned(); 12 | Map(i => i.Timestamp).Nullable(); 13 | Map(i => i.Level).Nullable().Length(10); 14 | Map(i => i.Exception).Nullable(); 15 | Map(i => i.Message).Nullable(); 16 | Map(i => i.Properties).Nullable(); 17 | Map(i => i.dt).Not.Nullable().Index("abc"); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

13 | Request ID: @Model.RequestId 14 |

15 | } 16 | 17 |

Development Mode

18 |

19 | Swapping to the Development environment displays detailed information about the error that occurred. 20 |

21 |

22 | The Development environment shouldn't be enabled for deployed applications. 23 | It can result in displaying sensitive information from exceptions to end users. 24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 25 | and restarting the app. 26 |

27 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.AspNetCore.Mvc.RazorPages; 4 | using Microsoft.Extensions.Logging; 5 | 6 | namespace Hangfire.FluentNHibernateStorage.WebApplication.Pages 7 | { 8 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 9 | public class ErrorModel : PageModel 10 | { 11 | private readonly ILogger _logger; 12 | 13 | public ErrorModel(ILogger logger) 14 | { 15 | _logger = logger; 16 | } 17 | 18 | public string RequestId { get; set; } 19 | 20 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 21 | 22 | public void OnGet() 23 | { 24 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using Microsoft.Extensions.Logging; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.WebApplication.Pages 6 | { 7 | public class IndexModel : PageModel 8 | { 9 | private readonly ILogger _logger; 10 | 11 | public IndexModel(ILogger logger) 12 | { 13 | _logger = logger; 14 | } 15 | 16 | public IActionResult OnGet() 17 | { 18 | return null; 19 | //return Redirect("/mydashboard"); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/Pages/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PrivacyModel 3 | @{ 4 | ViewData["Title"] = "Privacy Policy"; 5 | } 6 |

@ViewData["Title"]

7 | 8 |

Use this page to detail your site's privacy policy.

9 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/Pages/Privacy.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.RazorPages; 2 | using Microsoft.Extensions.Logging; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.WebApplication.Pages 5 | { 6 | public class PrivacyModel : PageModel 7 | { 8 | private readonly ILogger _logger; 9 | 10 | public PrivacyModel(ILogger logger) 11 | { 12 | _logger = logger; 13 | } 14 | 15 | public void OnGet() 16 | { 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @namespace Hangfire.FluentNHibernateStorage.WebApplication.Pages 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/Program.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernate.SampleStuff; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.Extensions.Hosting; 5 | using Serilog; 6 | using Serilog.Events; 7 | 8 | namespace Hangfire.FluentNHibernateStorage.WebApplication 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | CreateHostBuilder(args).Build().Run(); 15 | } 16 | 17 | public static IHostBuilder CreateHostBuilder(string[] args) 18 | { 19 | return Host.CreateDefaultBuilder(args) 20 | .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); }) 21 | .UseSerilog( 22 | (hostBuilderContext, serviceProvider, loggerConfiguration) => 23 | { 24 | loggerConfiguration 25 | .ReadFrom.Configuration(hostBuilderContext.Configuration) 26 | .Enrich.FromLogContext().Enrich.With(new ThreadIDEnricher()) 27 | .WriteTo.Debug( 28 | outputTemplate: 29 | "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] [{SourceContext}] {Message}{NewLine}{Exception}") 30 | .WriteTo.SqliteSink(LogEventLevel.Information, 31 | serviceProvider.GetService()) 32 | .WriteTo 33 | .SignalRSink( 34 | LogEventLevel.Information, 35 | serviceProvider, sendAsString: false); 36 | }); 37 | ; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:23062", 7 | "sslPort": 44333 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Hangfire.FluentNHibernateStorage.WebApplication": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/SignalRSinkExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNetCore.SignalR; 3 | using Serilog; 4 | using Serilog.Configuration; 5 | using Serilog.Events; 6 | 7 | namespace Hangfire.FluentNHibernateStorage.WebApplication 8 | { 9 | public static class SignalRSinkExtension 10 | { 11 | public static LoggerConfiguration SignalRSink( 12 | this LoggerSinkConfiguration loggerConfiguration, 13 | LogEventLevel logEventLevel, 14 | IServiceProvider serviceProvider = null, 15 | IFormatProvider formatProvider = null, 16 | string[] groups = null, 17 | string[] userIds = null, 18 | string[] excludedConnectionIds = null, 19 | bool sendAsString = false) 20 | where THub : Hub 21 | where T : class, IHub 22 | { 23 | if (loggerConfiguration == null) 24 | throw new ArgumentNullException(nameof(loggerConfiguration)); 25 | if (serviceProvider == null) 26 | throw new ArgumentNullException(nameof(serviceProvider)); 27 | return loggerConfiguration.Sink( 28 | new SignalRSink(formatProvider, serviceProvider, groups, userIds, 29 | excludedConnectionIds), logEventLevel); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/SqliteSink.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Hangfire.FluentNHibernate.SampleStuff; 3 | using Serilog.Core; 4 | using Serilog.Events; 5 | 6 | namespace Hangfire.FluentNHibernateStorage.WebApplication 7 | { 8 | public class SqliteSink : ILogEventSink 9 | 10 | { 11 | private readonly ILogPersistenceService _logPersistenceService; 12 | 13 | public SqliteSink( 14 | ILogPersistenceService logPersistenceService) 15 | { 16 | _logPersistenceService = logPersistenceService; 17 | } 18 | 19 | public void Emit(LogEvent logEvent) 20 | { 21 | if (logEvent == null) 22 | throw new ArgumentNullException(nameof(logEvent)); 23 | _logPersistenceService.Insert(logEvent); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/SqliteSinkExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Hangfire.FluentNHibernate.SampleStuff; 3 | using Serilog; 4 | using Serilog.Configuration; 5 | using Serilog.Events; 6 | 7 | namespace Hangfire.FluentNHibernateStorage.WebApplication 8 | { 9 | public static class SqliteSinkExtension 10 | { 11 | public static LoggerConfiguration SqliteSink( 12 | this LoggerSinkConfiguration loggerConfiguration, 13 | LogEventLevel logEventLevel, 14 | ILogPersistenceService svc) 15 | 16 | 17 | { 18 | if (loggerConfiguration == null) 19 | throw new ArgumentNullException(nameof(loggerConfiguration)); 20 | if (svc == null) 21 | throw new ArgumentNullException(nameof(svc)); 22 | return loggerConfiguration.Sink(new SqliteSink(svc), logEventLevel); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/libman.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "defaultProvider": "unpkg", 4 | "libraries": [ 5 | { 6 | "library": "@microsoft/signalr@6.0.5", 7 | "destination": "wwwroot/js/signalr/" 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | /* Provide sufficient contrast against white background */ 11 | a { 12 | color: #0366d6; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 22 | color: #fff; 23 | background-color: #1b6ec2; 24 | border-color: #1861ac; 25 | } 26 | 27 | /* Sticky footer styles 28 | -------------------------------------------------- */ 29 | html { 30 | font-size: 14px; 31 | } 32 | @media (min-width: 768px) { 33 | html { 34 | font-size: 16px; 35 | } 36 | } 37 | 38 | .border-top { 39 | border-top: 1px solid #e5e5e5; 40 | } 41 | .border-bottom { 42 | border-bottom: 1px solid #e5e5e5; 43 | } 44 | 45 | .box-shadow { 46 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 47 | } 48 | 49 | button.accept-policy { 50 | font-size: 1rem; 51 | line-height: inherit; 52 | } 53 | 54 | /* Sticky footer styles 55 | -------------------------------------------------- */ 56 | html { 57 | position: relative; 58 | min-height: 100%; 59 | } 60 | 61 | body { 62 | /* Margin bottom by footer height */ 63 | margin-bottom: 60px; 64 | } 65 | .footer { 66 | position: absolute; 67 | bottom: 0; 68 | width: 100%; 69 | white-space: nowrap; 70 | line-height: 60px; /* Vertically center the text there */ 71 | } 72 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavierjefferson/Hangfire.FluentNHibernateStorage/98a5408b7f3314fce2166e4c321c5bfe9e621920/Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/AbortController.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | exports.AbortController = void 0; 6 | // Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController 7 | // We don't actually ever use the API being polyfilled, we always use the polyfill because 8 | // it's a very new API right now. 9 | // Not exported from index. 10 | /** @private */ 11 | class AbortController { 12 | constructor() { 13 | this._isAborted = false; 14 | this.onabort = null; 15 | } 16 | abort() { 17 | if (!this._isAborted) { 18 | this._isAborted = true; 19 | if (this.onabort) { 20 | this.onabort(); 21 | } 22 | } 23 | } 24 | get signal() { 25 | return this; 26 | } 27 | get aborted() { 28 | return this._isAborted; 29 | } 30 | } 31 | exports.AbortController = AbortController; 32 | //# sourceMappingURL=AbortController.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/AbortController.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"AbortController.js","sourceRoot":"","sources":["../../src/AbortController.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,uEAAuE;;;AAEvE,qFAAqF;AACrF,0FAA0F;AAC1F,iCAAiC;AAEjC,2BAA2B;AAC3B,eAAe;AACf,MAAa,eAAe;IAA5B;QACY,eAAU,GAAY,KAAK,CAAC;QAC7B,YAAO,GAAwB,IAAI,CAAC;IAkB/C,CAAC;IAhBU,KAAK;QACR,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,IAAI,CAAC,OAAO,EAAE;gBACd,IAAI,CAAC,OAAO,EAAE,CAAC;aAClB;SACJ;IACL,CAAC;IAED,IAAI,MAAM;QACN,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ;AApBD,0CAoBC","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController\r\n// We don't actually ever use the API being polyfilled, we always use the polyfill because\r\n// it's a very new API right now.\r\n\r\n// Not exported from index.\r\n/** @private */\r\nexport class AbortController implements AbortSignal {\r\n private _isAborted: boolean = false;\r\n public onabort: (() => void) | null = null;\r\n\r\n public abort(): void {\r\n if (!this._isAborted) {\r\n this._isAborted = true;\r\n if (this.onabort) {\r\n this.onabort();\r\n }\r\n }\r\n }\r\n\r\n get signal(): AbortSignal {\r\n return this;\r\n }\r\n\r\n get aborted(): boolean {\r\n return this._isAborted;\r\n }\r\n}\r\n\r\n/** Represents a signal that can be monitored to determine if a request has been aborted. */\r\nexport interface AbortSignal {\r\n /** Indicates if the request has been aborted. */\r\n aborted: boolean;\r\n /** Set this to a handler that will be invoked when the request is aborted. */\r\n onabort: (() => void) | null;\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/DefaultReconnectPolicy.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | exports.DefaultReconnectPolicy = void 0; 6 | // 0, 2, 10, 30 second delays before reconnect attempts. 7 | const DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null]; 8 | /** @private */ 9 | class DefaultReconnectPolicy { 10 | constructor(retryDelays) { 11 | this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS; 12 | } 13 | nextRetryDelayInMilliseconds(retryContext) { 14 | return this._retryDelays[retryContext.previousRetryCount]; 15 | } 16 | } 17 | exports.DefaultReconnectPolicy = DefaultReconnectPolicy; 18 | //# sourceMappingURL=DefaultReconnectPolicy.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/DefaultReconnectPolicy.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"DefaultReconnectPolicy.js","sourceRoot":"","sources":["../../src/DefaultReconnectPolicy.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,uEAAuE;;;AAIvE,wDAAwD;AACxD,MAAM,oCAAoC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAE3E,eAAe;AACf,MAAa,sBAAsB;IAG/B,YAAY,WAAsB;QAC9B,IAAI,CAAC,YAAY,GAAG,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,oCAAoC,CAAC;IAClH,CAAC;IAEM,4BAA4B,CAAC,YAA0B;QAC1D,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAC9D,CAAC;CACJ;AAVD,wDAUC","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { IRetryPolicy, RetryContext } from \"./IRetryPolicy\";\r\n\r\n// 0, 2, 10, 30 second delays before reconnect attempts.\r\nconst DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];\r\n\r\n/** @private */\r\nexport class DefaultReconnectPolicy implements IRetryPolicy {\r\n private readonly _retryDelays: (number | null)[];\r\n\r\n constructor(retryDelays?: number[]) {\r\n this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;\r\n }\r\n\r\n public nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null {\r\n return this._retryDelays[retryContext.previousRetryCount];\r\n }\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/HeaderNames.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | exports.HeaderNames = void 0; 6 | class HeaderNames { 7 | } 8 | exports.HeaderNames = HeaderNames; 9 | HeaderNames.Authorization = "Authorization"; 10 | HeaderNames.Cookie = "Cookie"; 11 | //# sourceMappingURL=HeaderNames.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/HeaderNames.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"HeaderNames.js","sourceRoot":"","sources":["../../src/HeaderNames.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,uEAAuE;;;AAEvE,MAAsB,WAAW;;AAAjC,kCAGC;AAFmB,yBAAa,GAAG,eAAe,CAAC;AAChC,kBAAM,GAAG,QAAQ,CAAC","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nexport abstract class HeaderNames {\r\n static readonly Authorization = \"Authorization\";\r\n static readonly Cookie = \"Cookie\";\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/HttpClient.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | exports.HttpClient = exports.HttpResponse = void 0; 6 | /** Represents an HTTP response. */ 7 | class HttpResponse { 8 | constructor(statusCode, statusText, content) { 9 | this.statusCode = statusCode; 10 | this.statusText = statusText; 11 | this.content = content; 12 | } 13 | } 14 | exports.HttpResponse = HttpResponse; 15 | /** Abstraction over an HTTP client. 16 | * 17 | * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms. 18 | */ 19 | class HttpClient { 20 | get(url, options) { 21 | return this.send({ 22 | ...options, 23 | method: "GET", 24 | url, 25 | }); 26 | } 27 | post(url, options) { 28 | return this.send({ 29 | ...options, 30 | method: "POST", 31 | url, 32 | }); 33 | } 34 | delete(url, options) { 35 | return this.send({ 36 | ...options, 37 | method: "DELETE", 38 | url, 39 | }); 40 | } 41 | /** Gets all cookies that apply to the specified URL. 42 | * 43 | * @param url The URL that the cookies are valid for. 44 | * @returns {string} A string containing all the key-value cookie pairs for the specified URL. 45 | */ 46 | // @ts-ignore 47 | getCookieString(url) { 48 | return ""; 49 | } 50 | } 51 | exports.HttpClient = HttpClient; 52 | //# sourceMappingURL=HttpClient.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/IConnection.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | //# sourceMappingURL=IConnection.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/IConnection.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"IConnection.js","sourceRoot":"","sources":["../../src/IConnection.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,uEAAuE","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { TransferFormat } from \"./ITransport\";\r\n\r\n/** @private */\r\nexport interface IConnection {\r\n readonly features: any;\r\n readonly connectionId?: string;\r\n\r\n baseUrl: string;\r\n\r\n start(transferFormat: TransferFormat): Promise;\r\n send(data: string | ArrayBuffer): Promise;\r\n stop(error?: Error): Promise;\r\n\r\n onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n onclose: ((error?: Error) => void) | null;\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/IHttpConnectionOptions.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | //# sourceMappingURL=IHttpConnectionOptions.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/IHubProtocol.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | exports.MessageType = void 0; 6 | /** Defines the type of a Hub Message. */ 7 | var MessageType; 8 | (function (MessageType) { 9 | /** Indicates the message is an Invocation message and implements the {@link @microsoft/signalr.InvocationMessage} interface. */ 10 | MessageType[MessageType["Invocation"] = 1] = "Invocation"; 11 | /** Indicates the message is a StreamItem message and implements the {@link @microsoft/signalr.StreamItemMessage} interface. */ 12 | MessageType[MessageType["StreamItem"] = 2] = "StreamItem"; 13 | /** Indicates the message is a Completion message and implements the {@link @microsoft/signalr.CompletionMessage} interface. */ 14 | MessageType[MessageType["Completion"] = 3] = "Completion"; 15 | /** Indicates the message is a Stream Invocation message and implements the {@link @microsoft/signalr.StreamInvocationMessage} interface. */ 16 | MessageType[MessageType["StreamInvocation"] = 4] = "StreamInvocation"; 17 | /** Indicates the message is a Cancel Invocation message and implements the {@link @microsoft/signalr.CancelInvocationMessage} interface. */ 18 | MessageType[MessageType["CancelInvocation"] = 5] = "CancelInvocation"; 19 | /** Indicates the message is a Ping message and implements the {@link @microsoft/signalr.PingMessage} interface. */ 20 | MessageType[MessageType["Ping"] = 6] = "Ping"; 21 | /** Indicates the message is a Close message and implements the {@link @microsoft/signalr.CloseMessage} interface. */ 22 | MessageType[MessageType["Close"] = 7] = "Close"; 23 | })(MessageType = exports.MessageType || (exports.MessageType = {})); 24 | //# sourceMappingURL=IHubProtocol.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/ILogger.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | exports.LogLevel = void 0; 6 | // These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here. 7 | /** Indicates the severity of a log message. 8 | * 9 | * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc. 10 | */ 11 | var LogLevel; 12 | (function (LogLevel) { 13 | /** Log level for very low severity diagnostic messages. */ 14 | LogLevel[LogLevel["Trace"] = 0] = "Trace"; 15 | /** Log level for low severity diagnostic messages. */ 16 | LogLevel[LogLevel["Debug"] = 1] = "Debug"; 17 | /** Log level for informational diagnostic messages. */ 18 | LogLevel[LogLevel["Information"] = 2] = "Information"; 19 | /** Log level for diagnostic messages that indicate a non-fatal problem. */ 20 | LogLevel[LogLevel["Warning"] = 3] = "Warning"; 21 | /** Log level for diagnostic messages that indicate a failure in the current operation. */ 22 | LogLevel[LogLevel["Error"] = 4] = "Error"; 23 | /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */ 24 | LogLevel[LogLevel["Critical"] = 5] = "Critical"; 25 | /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */ 26 | LogLevel[LogLevel["None"] = 6] = "None"; 27 | })(LogLevel = exports.LogLevel || (exports.LogLevel = {})); 28 | //# sourceMappingURL=ILogger.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/IRetryPolicy.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | //# sourceMappingURL=IRetryPolicy.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/IRetryPolicy.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"IRetryPolicy.js","sourceRoot":"","sources":["../../src/IRetryPolicy.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,uEAAuE","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n/** An abstraction that controls when the client attempts to reconnect and how many times it does so. */\r\nexport interface IRetryPolicy {\r\n /** Called after the transport loses the connection.\r\n *\r\n * @param {RetryContext} retryContext Details related to the retry event to help determine how long to wait for the next retry.\r\n *\r\n * @returns {number | null} The amount of time in milliseconds to wait before the next retry. `null` tells the client to stop retrying.\r\n */\r\n nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null;\r\n}\r\n\r\nexport interface RetryContext {\r\n /**\r\n * The number of consecutive failed tries so far.\r\n */\r\n readonly previousRetryCount: number;\r\n\r\n /**\r\n * The amount of time in milliseconds spent retrying so far.\r\n */\r\n readonly elapsedMilliseconds: number;\r\n\r\n /**\r\n * The error that forced the upcoming retry.\r\n */\r\n readonly retryReason: Error;\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/ITransport.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | exports.TransferFormat = exports.HttpTransportType = void 0; 6 | // This will be treated as a bit flag in the future, so we keep it using power-of-two values. 7 | /** Specifies a specific HTTP transport type. */ 8 | var HttpTransportType; 9 | (function (HttpTransportType) { 10 | /** Specifies no transport preference. */ 11 | HttpTransportType[HttpTransportType["None"] = 0] = "None"; 12 | /** Specifies the WebSockets transport. */ 13 | HttpTransportType[HttpTransportType["WebSockets"] = 1] = "WebSockets"; 14 | /** Specifies the Server-Sent Events transport. */ 15 | HttpTransportType[HttpTransportType["ServerSentEvents"] = 2] = "ServerSentEvents"; 16 | /** Specifies the Long Polling transport. */ 17 | HttpTransportType[HttpTransportType["LongPolling"] = 4] = "LongPolling"; 18 | })(HttpTransportType = exports.HttpTransportType || (exports.HttpTransportType = {})); 19 | /** Specifies the transfer format for a connection. */ 20 | var TransferFormat; 21 | (function (TransferFormat) { 22 | /** Specifies that only text data will be transmitted over the connection. */ 23 | TransferFormat[TransferFormat["Text"] = 1] = "Text"; 24 | /** Specifies that binary data will be transmitted over the connection. */ 25 | TransferFormat[TransferFormat["Binary"] = 2] = "Binary"; 26 | })(TransferFormat = exports.TransferFormat || (exports.TransferFormat = {})); 27 | //# sourceMappingURL=ITransport.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/Loggers.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | exports.NullLogger = void 0; 6 | /** A logger that does nothing when log messages are sent to it. */ 7 | class NullLogger { 8 | constructor() { } 9 | /** @inheritDoc */ 10 | // eslint-disable-next-line 11 | log(_logLevel, _message) { 12 | } 13 | } 14 | exports.NullLogger = NullLogger; 15 | /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */ 16 | NullLogger.instance = new NullLogger(); 17 | //# sourceMappingURL=Loggers.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/Loggers.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Loggers.js","sourceRoot":"","sources":["../../src/Loggers.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,uEAAuE;;;AAIvE,mEAAmE;AACnE,MAAa,UAAU;IAInB,gBAAuB,CAAC;IAExB,kBAAkB;IAClB,2BAA2B;IACpB,GAAG,CAAC,SAAmB,EAAE,QAAgB;IAChD,CAAC;;AATL,gCAUC;AATG,2EAA2E;AAC7D,mBAAQ,GAAY,IAAI,UAAU,EAAE,CAAC","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\n\r\n/** A logger that does nothing when log messages are sent to it. */\r\nexport class NullLogger implements ILogger {\r\n /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */\r\n public static instance: ILogger = new NullLogger();\r\n\r\n private constructor() {}\r\n\r\n /** @inheritDoc */\r\n // eslint-disable-next-line\r\n public log(_logLevel: LogLevel, _message: string): void {\r\n }\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/Polyfills.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | //# sourceMappingURL=Polyfills.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/Polyfills.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Polyfills.js","sourceRoot":"","sources":["../../src/Polyfills.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,uEAAuE","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Not exported from index\r\n\r\n/** @private */\r\nexport type EventSourceConstructor = new(url: string, eventSourceInitDict?: EventSourceInit) => EventSource;\r\n\r\n/** @private */\r\nexport interface WebSocketConstructor {\r\n new(url: string, protocols?: string | string[], options?: any): WebSocket;\r\n readonly CLOSED: number;\r\n readonly CLOSING: number;\r\n readonly CONNECTING: number;\r\n readonly OPEN: number;\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/Stream.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | //# sourceMappingURL=Stream.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/Subject.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | exports.Subject = void 0; 6 | const Utils_1 = require("./Utils"); 7 | /** Stream implementation to stream items to the server. */ 8 | class Subject { 9 | constructor() { 10 | this.observers = []; 11 | } 12 | next(item) { 13 | for (const observer of this.observers) { 14 | observer.next(item); 15 | } 16 | } 17 | error(err) { 18 | for (const observer of this.observers) { 19 | if (observer.error) { 20 | observer.error(err); 21 | } 22 | } 23 | } 24 | complete() { 25 | for (const observer of this.observers) { 26 | if (observer.complete) { 27 | observer.complete(); 28 | } 29 | } 30 | } 31 | subscribe(observer) { 32 | this.observers.push(observer); 33 | return new Utils_1.SubjectSubscription(this, observer); 34 | } 35 | } 36 | exports.Subject = Subject; 37 | //# sourceMappingURL=Subject.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/TextMessageFormat.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // Licensed to the .NET Foundation under one or more agreements. 3 | // The .NET Foundation licenses this file to you under the MIT license. 4 | Object.defineProperty(exports, "__esModule", { value: true }); 5 | exports.TextMessageFormat = void 0; 6 | // Not exported from index 7 | /** @private */ 8 | class TextMessageFormat { 9 | static write(output) { 10 | return `${output}${TextMessageFormat.RecordSeparator}`; 11 | } 12 | static parse(input) { 13 | if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) { 14 | throw new Error("Message is incomplete."); 15 | } 16 | const messages = input.split(TextMessageFormat.RecordSeparator); 17 | messages.pop(); 18 | return messages; 19 | } 20 | } 21 | exports.TextMessageFormat = TextMessageFormat; 22 | TextMessageFormat.RecordSeparatorCode = 0x1e; 23 | TextMessageFormat.RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode); 24 | //# sourceMappingURL=TextMessageFormat.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/cjs/TextMessageFormat.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"TextMessageFormat.js","sourceRoot":"","sources":["../../src/TextMessageFormat.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,uEAAuE;;;AAEvE,0BAA0B;AAC1B,eAAe;AACf,MAAa,iBAAiB;IAInB,MAAM,CAAC,KAAK,CAAC,MAAc;QAC9B,OAAO,GAAG,MAAM,GAAG,iBAAiB,CAAC,eAAe,EAAE,CAAC;IAC3D,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,KAAa;QAC7B,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,iBAAiB,CAAC,eAAe,EAAE;YAC/D,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;SAC7C;QAED,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;QAChE,QAAQ,CAAC,GAAG,EAAE,CAAC;QACf,OAAO,QAAQ,CAAC;IACpB,CAAC;;AAhBL,8CAiBC;AAhBiB,qCAAmB,GAAG,IAAI,CAAC;AAC3B,iCAAe,GAAG,MAAM,CAAC,YAAY,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Not exported from index\r\n/** @private */\r\nexport class TextMessageFormat {\r\n public static RecordSeparatorCode = 0x1e;\r\n public static RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode);\r\n\r\n public static write(output: string): string {\r\n return `${output}${TextMessageFormat.RecordSeparator}`;\r\n }\r\n\r\n public static parse(input: string): string[] {\r\n if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n\r\n const messages = input.split(TextMessageFormat.RecordSeparator);\r\n messages.pop();\r\n return messages;\r\n }\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/AbortController.d.ts: -------------------------------------------------------------------------------- 1 | /** @private */ 2 | export declare class AbortController implements AbortSignal { 3 | private _isAborted; 4 | onabort: (() => void) | null; 5 | abort(): void; 6 | get signal(): AbortSignal; 7 | get aborted(): boolean; 8 | } 9 | /** Represents a signal that can be monitored to determine if a request has been aborted. */ 10 | export interface AbortSignal { 11 | /** Indicates if the request has been aborted. */ 12 | aborted: boolean; 13 | /** Set this to a handler that will be invoked when the request is aborted. */ 14 | onabort: (() => void) | null; 15 | } 16 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/AbortController.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController 4 | // We don't actually ever use the API being polyfilled, we always use the polyfill because 5 | // it's a very new API right now. 6 | // Not exported from index. 7 | /** @private */ 8 | export class AbortController { 9 | constructor() { 10 | this._isAborted = false; 11 | this.onabort = null; 12 | } 13 | abort() { 14 | if (!this._isAborted) { 15 | this._isAborted = true; 16 | if (this.onabort) { 17 | this.onabort(); 18 | } 19 | } 20 | } 21 | get signal() { 22 | return this; 23 | } 24 | get aborted() { 25 | return this._isAborted; 26 | } 27 | } 28 | //# sourceMappingURL=AbortController.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/AbortController.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"AbortController.js","sourceRoot":"","sources":["../../src/AbortController.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,uEAAuE;AAEvE,qFAAqF;AACrF,0FAA0F;AAC1F,iCAAiC;AAEjC,2BAA2B;AAC3B,eAAe;AACf,MAAM,OAAO,eAAe;IAA5B;QACY,eAAU,GAAY,KAAK,CAAC;QAC7B,YAAO,GAAwB,IAAI,CAAC;IAkB/C,CAAC;IAhBU,KAAK;QACR,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,IAAI,CAAC,OAAO,EAAE;gBACd,IAAI,CAAC,OAAO,EAAE,CAAC;aAClB;SACJ;IACL,CAAC;IAED,IAAI,MAAM;QACN,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController\r\n// We don't actually ever use the API being polyfilled, we always use the polyfill because\r\n// it's a very new API right now.\r\n\r\n// Not exported from index.\r\n/** @private */\r\nexport class AbortController implements AbortSignal {\r\n private _isAborted: boolean = false;\r\n public onabort: (() => void) | null = null;\r\n\r\n public abort(): void {\r\n if (!this._isAborted) {\r\n this._isAborted = true;\r\n if (this.onabort) {\r\n this.onabort();\r\n }\r\n }\r\n }\r\n\r\n get signal(): AbortSignal {\r\n return this;\r\n }\r\n\r\n get aborted(): boolean {\r\n return this._isAborted;\r\n }\r\n}\r\n\r\n/** Represents a signal that can be monitored to determine if a request has been aborted. */\r\nexport interface AbortSignal {\r\n /** Indicates if the request has been aborted. */\r\n aborted: boolean;\r\n /** Set this to a handler that will be invoked when the request is aborted. */\r\n onabort: (() => void) | null;\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/DefaultHttpClient.d.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient, HttpRequest, HttpResponse } from "./HttpClient"; 2 | import { ILogger } from "./ILogger"; 3 | /** Default implementation of {@link @microsoft/signalr.HttpClient}. */ 4 | export declare class DefaultHttpClient extends HttpClient { 5 | private readonly _httpClient; 6 | /** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */ 7 | constructor(logger: ILogger); 8 | /** @inheritDoc */ 9 | send(request: HttpRequest): Promise; 10 | getCookieString(url: string): string; 11 | } 12 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/DefaultHttpClient.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | import { AbortError } from "./Errors"; 4 | import { FetchHttpClient } from "./FetchHttpClient"; 5 | import { HttpClient } from "./HttpClient"; 6 | import { Platform } from "./Utils"; 7 | import { XhrHttpClient } from "./XhrHttpClient"; 8 | /** Default implementation of {@link @microsoft/signalr.HttpClient}. */ 9 | export class DefaultHttpClient extends HttpClient { 10 | /** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */ 11 | constructor(logger) { 12 | super(); 13 | if (typeof fetch !== "undefined" || Platform.isNode) { 14 | this._httpClient = new FetchHttpClient(logger); 15 | } 16 | else if (typeof XMLHttpRequest !== "undefined") { 17 | this._httpClient = new XhrHttpClient(logger); 18 | } 19 | else { 20 | throw new Error("No usable HttpClient found."); 21 | } 22 | } 23 | /** @inheritDoc */ 24 | send(request) { 25 | // Check that abort was not signaled before calling send 26 | if (request.abortSignal && request.abortSignal.aborted) { 27 | return Promise.reject(new AbortError()); 28 | } 29 | if (!request.method) { 30 | return Promise.reject(new Error("No method defined.")); 31 | } 32 | if (!request.url) { 33 | return Promise.reject(new Error("No url defined.")); 34 | } 35 | return this._httpClient.send(request); 36 | } 37 | getCookieString(url) { 38 | return this._httpClient.getCookieString(url); 39 | } 40 | } 41 | //# sourceMappingURL=DefaultHttpClient.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/DefaultReconnectPolicy.d.ts: -------------------------------------------------------------------------------- 1 | import { IRetryPolicy, RetryContext } from "./IRetryPolicy"; 2 | /** @private */ 3 | export declare class DefaultReconnectPolicy implements IRetryPolicy { 4 | private readonly _retryDelays; 5 | constructor(retryDelays?: number[]); 6 | nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null; 7 | } 8 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/DefaultReconnectPolicy.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // 0, 2, 10, 30 second delays before reconnect attempts. 4 | const DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null]; 5 | /** @private */ 6 | export class DefaultReconnectPolicy { 7 | constructor(retryDelays) { 8 | this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS; 9 | } 10 | nextRetryDelayInMilliseconds(retryContext) { 11 | return this._retryDelays[retryContext.previousRetryCount]; 12 | } 13 | } 14 | //# sourceMappingURL=DefaultReconnectPolicy.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/DefaultReconnectPolicy.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"DefaultReconnectPolicy.js","sourceRoot":"","sources":["../../src/DefaultReconnectPolicy.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,uEAAuE;AAIvE,wDAAwD;AACxD,MAAM,oCAAoC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAE3E,eAAe;AACf,MAAM,OAAO,sBAAsB;IAG/B,YAAY,WAAsB;QAC9B,IAAI,CAAC,YAAY,GAAG,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,oCAAoC,CAAC;IAClH,CAAC;IAEM,4BAA4B,CAAC,YAA0B;QAC1D,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAC9D,CAAC;CACJ","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { IRetryPolicy, RetryContext } from \"./IRetryPolicy\";\r\n\r\n// 0, 2, 10, 30 second delays before reconnect attempts.\r\nconst DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];\r\n\r\n/** @private */\r\nexport class DefaultReconnectPolicy implements IRetryPolicy {\r\n private readonly _retryDelays: (number | null)[];\r\n\r\n constructor(retryDelays?: number[]) {\r\n this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;\r\n }\r\n\r\n public nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null {\r\n return this._retryDelays[retryContext.previousRetryCount];\r\n }\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/FetchHttpClient.d.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient, HttpRequest, HttpResponse } from "./HttpClient"; 2 | import { ILogger } from "./ILogger"; 3 | export declare class FetchHttpClient extends HttpClient { 4 | private readonly _abortControllerType; 5 | private readonly _fetchType; 6 | private readonly _jar?; 7 | private readonly _logger; 8 | constructor(logger: ILogger); 9 | /** @inheritDoc */ 10 | send(request: HttpRequest): Promise; 11 | getCookieString(url: string): string; 12 | } 13 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/HandshakeProtocol.d.ts: -------------------------------------------------------------------------------- 1 | /** @private */ 2 | export interface HandshakeRequestMessage { 3 | readonly protocol: string; 4 | readonly version: number; 5 | } 6 | /** @private */ 7 | export interface HandshakeResponseMessage { 8 | readonly error: string; 9 | readonly minorVersion: number; 10 | } 11 | /** @private */ 12 | export declare class HandshakeProtocol { 13 | writeHandshakeRequest(handshakeRequest: HandshakeRequestMessage): string; 14 | parseHandshakeResponse(data: any): [any, HandshakeResponseMessage]; 15 | } 16 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/HeaderNames.d.ts: -------------------------------------------------------------------------------- 1 | export declare abstract class HeaderNames { 2 | static readonly Authorization = "Authorization"; 3 | static readonly Cookie = "Cookie"; 4 | } 5 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/HeaderNames.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | export class HeaderNames { 4 | } 5 | HeaderNames.Authorization = "Authorization"; 6 | HeaderNames.Cookie = "Cookie"; 7 | //# sourceMappingURL=HeaderNames.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/HeaderNames.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"HeaderNames.js","sourceRoot":"","sources":["../../src/HeaderNames.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,uEAAuE;AAEvE,MAAM,OAAgB,WAAW;;AACb,yBAAa,GAAG,eAAe,CAAC;AAChC,kBAAM,GAAG,QAAQ,CAAC","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nexport abstract class HeaderNames {\r\n static readonly Authorization = \"Authorization\";\r\n static readonly Cookie = \"Cookie\";\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/HttpClient.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | /** Represents an HTTP response. */ 4 | export class HttpResponse { 5 | constructor(statusCode, statusText, content) { 6 | this.statusCode = statusCode; 7 | this.statusText = statusText; 8 | this.content = content; 9 | } 10 | } 11 | /** Abstraction over an HTTP client. 12 | * 13 | * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms. 14 | */ 15 | export class HttpClient { 16 | get(url, options) { 17 | return this.send({ 18 | ...options, 19 | method: "GET", 20 | url, 21 | }); 22 | } 23 | post(url, options) { 24 | return this.send({ 25 | ...options, 26 | method: "POST", 27 | url, 28 | }); 29 | } 30 | delete(url, options) { 31 | return this.send({ 32 | ...options, 33 | method: "DELETE", 34 | url, 35 | }); 36 | } 37 | /** Gets all cookies that apply to the specified URL. 38 | * 39 | * @param url The URL that the cookies are valid for. 40 | * @returns {string} A string containing all the key-value cookie pairs for the specified URL. 41 | */ 42 | // @ts-ignore 43 | getCookieString(url) { 44 | return ""; 45 | } 46 | } 47 | //# sourceMappingURL=HttpClient.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/IConnection.d.ts: -------------------------------------------------------------------------------- 1 | import { TransferFormat } from "./ITransport"; 2 | /** @private */ 3 | export interface IConnection { 4 | readonly features: any; 5 | readonly connectionId?: string; 6 | baseUrl: string; 7 | start(transferFormat: TransferFormat): Promise; 8 | send(data: string | ArrayBuffer): Promise; 9 | stop(error?: Error): Promise; 10 | onreceive: ((data: string | ArrayBuffer) => void) | null; 11 | onclose: ((error?: Error) => void) | null; 12 | } 13 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/IConnection.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | export {}; 4 | //# sourceMappingURL=IConnection.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/IConnection.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"IConnection.js","sourceRoot":"","sources":["../../src/IConnection.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,uEAAuE","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { TransferFormat } from \"./ITransport\";\r\n\r\n/** @private */\r\nexport interface IConnection {\r\n readonly features: any;\r\n readonly connectionId?: string;\r\n\r\n baseUrl: string;\r\n\r\n start(transferFormat: TransferFormat): Promise;\r\n send(data: string | ArrayBuffer): Promise;\r\n stop(error?: Error): Promise;\r\n\r\n onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n onclose: ((error?: Error) => void) | null;\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/IHttpConnectionOptions.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | export {}; 4 | //# sourceMappingURL=IHttpConnectionOptions.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/IHubProtocol.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | /** Defines the type of a Hub Message. */ 4 | export var MessageType; 5 | (function (MessageType) { 6 | /** Indicates the message is an Invocation message and implements the {@link @microsoft/signalr.InvocationMessage} interface. */ 7 | MessageType[MessageType["Invocation"] = 1] = "Invocation"; 8 | /** Indicates the message is a StreamItem message and implements the {@link @microsoft/signalr.StreamItemMessage} interface. */ 9 | MessageType[MessageType["StreamItem"] = 2] = "StreamItem"; 10 | /** Indicates the message is a Completion message and implements the {@link @microsoft/signalr.CompletionMessage} interface. */ 11 | MessageType[MessageType["Completion"] = 3] = "Completion"; 12 | /** Indicates the message is a Stream Invocation message and implements the {@link @microsoft/signalr.StreamInvocationMessage} interface. */ 13 | MessageType[MessageType["StreamInvocation"] = 4] = "StreamInvocation"; 14 | /** Indicates the message is a Cancel Invocation message and implements the {@link @microsoft/signalr.CancelInvocationMessage} interface. */ 15 | MessageType[MessageType["CancelInvocation"] = 5] = "CancelInvocation"; 16 | /** Indicates the message is a Ping message and implements the {@link @microsoft/signalr.PingMessage} interface. */ 17 | MessageType[MessageType["Ping"] = 6] = "Ping"; 18 | /** Indicates the message is a Close message and implements the {@link @microsoft/signalr.CloseMessage} interface. */ 19 | MessageType[MessageType["Close"] = 7] = "Close"; 20 | })(MessageType || (MessageType = {})); 21 | //# sourceMappingURL=IHubProtocol.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/ILogger.d.ts: -------------------------------------------------------------------------------- 1 | /** Indicates the severity of a log message. 2 | * 3 | * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc. 4 | */ 5 | export declare enum LogLevel { 6 | /** Log level for very low severity diagnostic messages. */ 7 | Trace = 0, 8 | /** Log level for low severity diagnostic messages. */ 9 | Debug = 1, 10 | /** Log level for informational diagnostic messages. */ 11 | Information = 2, 12 | /** Log level for diagnostic messages that indicate a non-fatal problem. */ 13 | Warning = 3, 14 | /** Log level for diagnostic messages that indicate a failure in the current operation. */ 15 | Error = 4, 16 | /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */ 17 | Critical = 5, 18 | /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */ 19 | None = 6 20 | } 21 | /** An abstraction that provides a sink for diagnostic messages. */ 22 | export interface ILogger { 23 | /** Called by the framework to emit a diagnostic message. 24 | * 25 | * @param {LogLevel} logLevel The severity level of the message. 26 | * @param {string} message The message. 27 | */ 28 | log(logLevel: LogLevel, message: string): void; 29 | } 30 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/ILogger.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here. 4 | /** Indicates the severity of a log message. 5 | * 6 | * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc. 7 | */ 8 | export var LogLevel; 9 | (function (LogLevel) { 10 | /** Log level for very low severity diagnostic messages. */ 11 | LogLevel[LogLevel["Trace"] = 0] = "Trace"; 12 | /** Log level for low severity diagnostic messages. */ 13 | LogLevel[LogLevel["Debug"] = 1] = "Debug"; 14 | /** Log level for informational diagnostic messages. */ 15 | LogLevel[LogLevel["Information"] = 2] = "Information"; 16 | /** Log level for diagnostic messages that indicate a non-fatal problem. */ 17 | LogLevel[LogLevel["Warning"] = 3] = "Warning"; 18 | /** Log level for diagnostic messages that indicate a failure in the current operation. */ 19 | LogLevel[LogLevel["Error"] = 4] = "Error"; 20 | /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */ 21 | LogLevel[LogLevel["Critical"] = 5] = "Critical"; 22 | /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */ 23 | LogLevel[LogLevel["None"] = 6] = "None"; 24 | })(LogLevel || (LogLevel = {})); 25 | //# sourceMappingURL=ILogger.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/IRetryPolicy.d.ts: -------------------------------------------------------------------------------- 1 | /** An abstraction that controls when the client attempts to reconnect and how many times it does so. */ 2 | export interface IRetryPolicy { 3 | /** Called after the transport loses the connection. 4 | * 5 | * @param {RetryContext} retryContext Details related to the retry event to help determine how long to wait for the next retry. 6 | * 7 | * @returns {number | null} The amount of time in milliseconds to wait before the next retry. `null` tells the client to stop retrying. 8 | */ 9 | nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null; 10 | } 11 | export interface RetryContext { 12 | /** 13 | * The number of consecutive failed tries so far. 14 | */ 15 | readonly previousRetryCount: number; 16 | /** 17 | * The amount of time in milliseconds spent retrying so far. 18 | */ 19 | readonly elapsedMilliseconds: number; 20 | /** 21 | * The error that forced the upcoming retry. 22 | */ 23 | readonly retryReason: Error; 24 | } 25 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/IRetryPolicy.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | export {}; 4 | //# sourceMappingURL=IRetryPolicy.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/IRetryPolicy.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"IRetryPolicy.js","sourceRoot":"","sources":["../../src/IRetryPolicy.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,uEAAuE","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n/** An abstraction that controls when the client attempts to reconnect and how many times it does so. */\r\nexport interface IRetryPolicy {\r\n /** Called after the transport loses the connection.\r\n *\r\n * @param {RetryContext} retryContext Details related to the retry event to help determine how long to wait for the next retry.\r\n *\r\n * @returns {number | null} The amount of time in milliseconds to wait before the next retry. `null` tells the client to stop retrying.\r\n */\r\n nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null;\r\n}\r\n\r\nexport interface RetryContext {\r\n /**\r\n * The number of consecutive failed tries so far.\r\n */\r\n readonly previousRetryCount: number;\r\n\r\n /**\r\n * The amount of time in milliseconds spent retrying so far.\r\n */\r\n readonly elapsedMilliseconds: number;\r\n\r\n /**\r\n * The error that forced the upcoming retry.\r\n */\r\n readonly retryReason: Error;\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/ITransport.d.ts: -------------------------------------------------------------------------------- 1 | /** Specifies a specific HTTP transport type. */ 2 | export declare enum HttpTransportType { 3 | /** Specifies no transport preference. */ 4 | None = 0, 5 | /** Specifies the WebSockets transport. */ 6 | WebSockets = 1, 7 | /** Specifies the Server-Sent Events transport. */ 8 | ServerSentEvents = 2, 9 | /** Specifies the Long Polling transport. */ 10 | LongPolling = 4 11 | } 12 | /** Specifies the transfer format for a connection. */ 13 | export declare enum TransferFormat { 14 | /** Specifies that only text data will be transmitted over the connection. */ 15 | Text = 1, 16 | /** Specifies that binary data will be transmitted over the connection. */ 17 | Binary = 2 18 | } 19 | /** An abstraction over the behavior of transports. This is designed to support the framework and not intended for use by applications. */ 20 | export interface ITransport { 21 | connect(url: string, transferFormat: TransferFormat): Promise; 22 | send(data: any): Promise; 23 | stop(): Promise; 24 | onreceive: ((data: string | ArrayBuffer) => void) | null; 25 | onclose: ((error?: Error) => void) | null; 26 | } 27 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/ITransport.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // This will be treated as a bit flag in the future, so we keep it using power-of-two values. 4 | /** Specifies a specific HTTP transport type. */ 5 | export var HttpTransportType; 6 | (function (HttpTransportType) { 7 | /** Specifies no transport preference. */ 8 | HttpTransportType[HttpTransportType["None"] = 0] = "None"; 9 | /** Specifies the WebSockets transport. */ 10 | HttpTransportType[HttpTransportType["WebSockets"] = 1] = "WebSockets"; 11 | /** Specifies the Server-Sent Events transport. */ 12 | HttpTransportType[HttpTransportType["ServerSentEvents"] = 2] = "ServerSentEvents"; 13 | /** Specifies the Long Polling transport. */ 14 | HttpTransportType[HttpTransportType["LongPolling"] = 4] = "LongPolling"; 15 | })(HttpTransportType || (HttpTransportType = {})); 16 | /** Specifies the transfer format for a connection. */ 17 | export var TransferFormat; 18 | (function (TransferFormat) { 19 | /** Specifies that only text data will be transmitted over the connection. */ 20 | TransferFormat[TransferFormat["Text"] = 1] = "Text"; 21 | /** Specifies that binary data will be transmitted over the connection. */ 22 | TransferFormat[TransferFormat["Binary"] = 2] = "Binary"; 23 | })(TransferFormat || (TransferFormat = {})); 24 | //# sourceMappingURL=ITransport.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/JsonHubProtocol.d.ts: -------------------------------------------------------------------------------- 1 | import { HubMessage, IHubProtocol } from "./IHubProtocol"; 2 | import { ILogger } from "./ILogger"; 3 | import { TransferFormat } from "./ITransport"; 4 | /** Implements the JSON Hub Protocol. */ 5 | export declare class JsonHubProtocol implements IHubProtocol { 6 | /** @inheritDoc */ 7 | readonly name: string; 8 | /** @inheritDoc */ 9 | readonly version: number; 10 | /** @inheritDoc */ 11 | readonly transferFormat: TransferFormat; 12 | /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation. 13 | * 14 | * @param {string} input A string containing the serialized representation. 15 | * @param {ILogger} logger A logger that will be used to log messages that occur during parsing. 16 | */ 17 | parseMessages(input: string, logger: ILogger): HubMessage[]; 18 | /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it. 19 | * 20 | * @param {HubMessage} message The message to write. 21 | * @returns {string} A string containing the serialized representation of the message. 22 | */ 23 | writeMessage(message: HubMessage): string; 24 | private _isInvocationMessage; 25 | private _isStreamItemMessage; 26 | private _isCompletionMessage; 27 | private _assertNotEmptyString; 28 | } 29 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/Loggers.d.ts: -------------------------------------------------------------------------------- 1 | import { ILogger, LogLevel } from "./ILogger"; 2 | /** A logger that does nothing when log messages are sent to it. */ 3 | export declare class NullLogger implements ILogger { 4 | /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */ 5 | static instance: ILogger; 6 | private constructor(); 7 | /** @inheritDoc */ 8 | log(_logLevel: LogLevel, _message: string): void; 9 | } 10 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/Loggers.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | /** A logger that does nothing when log messages are sent to it. */ 4 | export class NullLogger { 5 | constructor() { } 6 | /** @inheritDoc */ 7 | // eslint-disable-next-line 8 | log(_logLevel, _message) { 9 | } 10 | } 11 | /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */ 12 | NullLogger.instance = new NullLogger(); 13 | //# sourceMappingURL=Loggers.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/Loggers.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Loggers.js","sourceRoot":"","sources":["../../src/Loggers.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,uEAAuE;AAIvE,mEAAmE;AACnE,MAAM,OAAO,UAAU;IAInB,gBAAuB,CAAC;IAExB,kBAAkB;IAClB,2BAA2B;IACpB,GAAG,CAAC,SAAmB,EAAE,QAAgB;IAChD,CAAC;;AARD,2EAA2E;AAC7D,mBAAQ,GAAY,IAAI,UAAU,EAAE,CAAC","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\n\r\n/** A logger that does nothing when log messages are sent to it. */\r\nexport class NullLogger implements ILogger {\r\n /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */\r\n public static instance: ILogger = new NullLogger();\r\n\r\n private constructor() {}\r\n\r\n /** @inheritDoc */\r\n // eslint-disable-next-line\r\n public log(_logLevel: LogLevel, _message: string): void {\r\n }\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/LongPollingTransport.d.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from "./HttpClient"; 2 | import { ILogger } from "./ILogger"; 3 | import { ITransport, TransferFormat } from "./ITransport"; 4 | import { IHttpConnectionOptions } from "./IHttpConnectionOptions"; 5 | /** @private */ 6 | export declare class LongPollingTransport implements ITransport { 7 | private readonly _httpClient; 8 | private readonly _accessTokenFactory; 9 | private readonly _logger; 10 | private readonly _options; 11 | private readonly _pollAbort; 12 | private _url?; 13 | private _running; 14 | private _receiving?; 15 | private _closeError?; 16 | onreceive: ((data: string | ArrayBuffer) => void) | null; 17 | onclose: ((error?: Error) => void) | null; 18 | get pollAborted(): boolean; 19 | constructor(httpClient: HttpClient, accessTokenFactory: (() => string | Promise) | undefined, logger: ILogger, options: IHttpConnectionOptions); 20 | connect(url: string, transferFormat: TransferFormat): Promise; 21 | private _getAccessToken; 22 | private _updateHeaderToken; 23 | private _poll; 24 | send(data: any): Promise; 25 | stop(): Promise; 26 | private _raiseOnClose; 27 | } 28 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/Polyfills.d.ts: -------------------------------------------------------------------------------- 1 | /** @private */ 2 | export declare type EventSourceConstructor = new (url: string, eventSourceInitDict?: EventSourceInit) => EventSource; 3 | /** @private */ 4 | export interface WebSocketConstructor { 5 | new (url: string, protocols?: string | string[], options?: any): WebSocket; 6 | readonly CLOSED: number; 7 | readonly CLOSING: number; 8 | readonly CONNECTING: number; 9 | readonly OPEN: number; 10 | } 11 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/Polyfills.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | export {}; 4 | //# sourceMappingURL=Polyfills.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/Polyfills.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Polyfills.js","sourceRoot":"","sources":["../../src/Polyfills.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,uEAAuE","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Not exported from index\r\n\r\n/** @private */\r\nexport type EventSourceConstructor = new(url: string, eventSourceInitDict?: EventSourceInit) => EventSource;\r\n\r\n/** @private */\r\nexport interface WebSocketConstructor {\r\n new(url: string, protocols?: string | string[], options?: any): WebSocket;\r\n readonly CLOSED: number;\r\n readonly CLOSING: number;\r\n readonly CONNECTING: number;\r\n readonly OPEN: number;\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/ServerSentEventsTransport.d.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from "./HttpClient"; 2 | import { ILogger } from "./ILogger"; 3 | import { ITransport, TransferFormat } from "./ITransport"; 4 | import { IHttpConnectionOptions } from "./IHttpConnectionOptions"; 5 | /** @private */ 6 | export declare class ServerSentEventsTransport implements ITransport { 7 | private readonly _httpClient; 8 | private readonly _accessTokenFactory; 9 | private readonly _logger; 10 | private readonly _options; 11 | private _eventSource?; 12 | private _url?; 13 | onreceive: ((data: string | ArrayBuffer) => void) | null; 14 | onclose: ((error?: Error) => void) | null; 15 | constructor(httpClient: HttpClient, accessTokenFactory: (() => string | Promise) | undefined, logger: ILogger, options: IHttpConnectionOptions); 16 | connect(url: string, transferFormat: TransferFormat): Promise; 17 | send(data: any): Promise; 18 | stop(): Promise; 19 | private _close; 20 | } 21 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/Stream.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | export {}; 4 | //# sourceMappingURL=Stream.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/Subject.d.ts: -------------------------------------------------------------------------------- 1 | import { IStreamResult, IStreamSubscriber, ISubscription } from "./Stream"; 2 | /** Stream implementation to stream items to the server. */ 3 | export declare class Subject implements IStreamResult { 4 | constructor(); 5 | next(item: T): void; 6 | error(err: any): void; 7 | complete(): void; 8 | subscribe(observer: IStreamSubscriber): ISubscription; 9 | } 10 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/Subject.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | import { SubjectSubscription } from "./Utils"; 4 | /** Stream implementation to stream items to the server. */ 5 | export class Subject { 6 | constructor() { 7 | this.observers = []; 8 | } 9 | next(item) { 10 | for (const observer of this.observers) { 11 | observer.next(item); 12 | } 13 | } 14 | error(err) { 15 | for (const observer of this.observers) { 16 | if (observer.error) { 17 | observer.error(err); 18 | } 19 | } 20 | } 21 | complete() { 22 | for (const observer of this.observers) { 23 | if (observer.complete) { 24 | observer.complete(); 25 | } 26 | } 27 | } 28 | subscribe(observer) { 29 | this.observers.push(observer); 30 | return new SubjectSubscription(this, observer); 31 | } 32 | } 33 | //# sourceMappingURL=Subject.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/TextMessageFormat.d.ts: -------------------------------------------------------------------------------- 1 | /** @private */ 2 | export declare class TextMessageFormat { 3 | static RecordSeparatorCode: number; 4 | static RecordSeparator: string; 5 | static write(output: string): string; 6 | static parse(input: string): string[]; 7 | } 8 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/TextMessageFormat.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // Not exported from index 4 | /** @private */ 5 | export class TextMessageFormat { 6 | static write(output) { 7 | return `${output}${TextMessageFormat.RecordSeparator}`; 8 | } 9 | static parse(input) { 10 | if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) { 11 | throw new Error("Message is incomplete."); 12 | } 13 | const messages = input.split(TextMessageFormat.RecordSeparator); 14 | messages.pop(); 15 | return messages; 16 | } 17 | } 18 | TextMessageFormat.RecordSeparatorCode = 0x1e; 19 | TextMessageFormat.RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode); 20 | //# sourceMappingURL=TextMessageFormat.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/TextMessageFormat.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"TextMessageFormat.js","sourceRoot":"","sources":["../../src/TextMessageFormat.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,uEAAuE;AAEvE,0BAA0B;AAC1B,eAAe;AACf,MAAM,OAAO,iBAAiB;IAInB,MAAM,CAAC,KAAK,CAAC,MAAc;QAC9B,OAAO,GAAG,MAAM,GAAG,iBAAiB,CAAC,eAAe,EAAE,CAAC;IAC3D,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,KAAa;QAC7B,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,iBAAiB,CAAC,eAAe,EAAE;YAC/D,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;SAC7C;QAED,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;QAChE,QAAQ,CAAC,GAAG,EAAE,CAAC;QACf,OAAO,QAAQ,CAAC;IACpB,CAAC;;AAfa,qCAAmB,GAAG,IAAI,CAAC;AAC3B,iCAAe,GAAG,MAAM,CAAC,YAAY,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Not exported from index\r\n/** @private */\r\nexport class TextMessageFormat {\r\n public static RecordSeparatorCode = 0x1e;\r\n public static RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode);\r\n\r\n public static write(output: string): string {\r\n return `${output}${TextMessageFormat.RecordSeparator}`;\r\n }\r\n\r\n public static parse(input: string): string[] {\r\n if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n\r\n const messages = input.split(TextMessageFormat.RecordSeparator);\r\n messages.pop();\r\n return messages;\r\n }\r\n}\r\n"]} -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/WebSocketTransport.d.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from "./HttpClient"; 2 | import { MessageHeaders } from "./IHubProtocol"; 3 | import { ILogger } from "./ILogger"; 4 | import { ITransport, TransferFormat } from "./ITransport"; 5 | import { WebSocketConstructor } from "./Polyfills"; 6 | /** @private */ 7 | export declare class WebSocketTransport implements ITransport { 8 | private readonly _logger; 9 | private readonly _accessTokenFactory; 10 | private readonly _logMessageContent; 11 | private readonly _webSocketConstructor; 12 | private readonly _httpClient; 13 | private _webSocket?; 14 | private _headers; 15 | onreceive: ((data: string | ArrayBuffer) => void) | null; 16 | onclose: ((error?: Error) => void) | null; 17 | constructor(httpClient: HttpClient, accessTokenFactory: (() => string | Promise) | undefined, logger: ILogger, logMessageContent: boolean, webSocketConstructor: WebSocketConstructor, headers: MessageHeaders); 18 | connect(url: string, transferFormat: TransferFormat): Promise; 19 | send(data: any): Promise; 20 | stop(): Promise; 21 | private _close; 22 | private _isCloseEvent; 23 | } 24 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/XhrHttpClient.d.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient, HttpRequest, HttpResponse } from "./HttpClient"; 2 | import { ILogger } from "./ILogger"; 3 | export declare class XhrHttpClient extends HttpClient { 4 | private readonly _logger; 5 | constructor(logger: ILogger); 6 | /** @inheritDoc */ 7 | send(request: HttpRequest): Promise; 8 | } 9 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/browser-index.d.ts: -------------------------------------------------------------------------------- 1 | export * from "./index"; 2 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/browser-index.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // This is where we add any polyfills we'll need for the browser. It is the entry module for browser-specific builds. 4 | // Copy from Array.prototype into Uint8Array to polyfill on IE. It's OK because the implementations of indexOf and slice use properties 5 | // that exist on Uint8Array with the same name, and JavaScript is magic. 6 | // We make them 'writable' because the Buffer polyfill messes with it as well. 7 | if (!Uint8Array.prototype.indexOf) { 8 | Object.defineProperty(Uint8Array.prototype, "indexOf", { 9 | value: Array.prototype.indexOf, 10 | writable: true, 11 | }); 12 | } 13 | if (!Uint8Array.prototype.slice) { 14 | Object.defineProperty(Uint8Array.prototype, "slice", { 15 | // wrap the slice in Uint8Array so it looks like a Uint8Array.slice call 16 | // eslint-disable-next-line object-shorthand 17 | value: function (start, end) { return new Uint8Array(Array.prototype.slice.call(this, start, end)); }, 18 | writable: true, 19 | }); 20 | } 21 | if (!Uint8Array.prototype.forEach) { 22 | Object.defineProperty(Uint8Array.prototype, "forEach", { 23 | value: Array.prototype.forEach, 24 | writable: true, 25 | }); 26 | } 27 | export * from "./index"; 28 | //# sourceMappingURL=browser-index.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/index.d.ts: -------------------------------------------------------------------------------- 1 | export { AbortSignal } from "./AbortController"; 2 | export { AbortError, HttpError, TimeoutError } from "./Errors"; 3 | export { HttpClient, HttpRequest, HttpResponse } from "./HttpClient"; 4 | export { DefaultHttpClient } from "./DefaultHttpClient"; 5 | export { IHttpConnectionOptions } from "./IHttpConnectionOptions"; 6 | export { HubConnection, HubConnectionState } from "./HubConnection"; 7 | export { HubConnectionBuilder } from "./HubConnectionBuilder"; 8 | export { MessageType, MessageHeaders, HubMessage, HubMessageBase, HubInvocationMessage, InvocationMessage, StreamInvocationMessage, StreamItemMessage, CompletionMessage, PingMessage, CloseMessage, CancelInvocationMessage, IHubProtocol } from "./IHubProtocol"; 9 | export { ILogger, LogLevel } from "./ILogger"; 10 | export { HttpTransportType, TransferFormat, ITransport } from "./ITransport"; 11 | export { IStreamSubscriber, IStreamResult, ISubscription } from "./Stream"; 12 | export { NullLogger } from "./Loggers"; 13 | export { JsonHubProtocol } from "./JsonHubProtocol"; 14 | export { Subject } from "./Subject"; 15 | export { IRetryPolicy, RetryContext } from "./IRetryPolicy"; 16 | export { VERSION } from "./Utils"; 17 | 18 | export as namespace signalR; -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/dist/esm/index.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | export { AbortError, HttpError, TimeoutError } from "./Errors"; 4 | export { HttpClient, HttpResponse } from "./HttpClient"; 5 | export { DefaultHttpClient } from "./DefaultHttpClient"; 6 | export { HubConnection, HubConnectionState } from "./HubConnection"; 7 | export { HubConnectionBuilder } from "./HubConnectionBuilder"; 8 | export { MessageType } from "./IHubProtocol"; 9 | export { LogLevel } from "./ILogger"; 10 | export { HttpTransportType, TransferFormat } from "./ITransport"; 11 | export { NullLogger } from "./Loggers"; 12 | export { JsonHubProtocol } from "./JsonHubProtocol"; 13 | export { Subject } from "./Subject"; 14 | export { VERSION } from "./Utils"; 15 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/AbortController.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | // Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController 5 | // We don't actually ever use the API being polyfilled, we always use the polyfill because 6 | // it's a very new API right now. 7 | 8 | // Not exported from index. 9 | /** @private */ 10 | export class AbortController implements AbortSignal { 11 | private _isAborted: boolean = false; 12 | public onabort: (() => void) | null = null; 13 | 14 | public abort(): void { 15 | if (!this._isAborted) { 16 | this._isAborted = true; 17 | if (this.onabort) { 18 | this.onabort(); 19 | } 20 | } 21 | } 22 | 23 | get signal(): AbortSignal { 24 | return this; 25 | } 26 | 27 | get aborted(): boolean { 28 | return this._isAborted; 29 | } 30 | } 31 | 32 | /** Represents a signal that can be monitored to determine if a request has been aborted. */ 33 | export interface AbortSignal { 34 | /** Indicates if the request has been aborted. */ 35 | aborted: boolean; 36 | /** Set this to a handler that will be invoked when the request is aborted. */ 37 | onabort: (() => void) | null; 38 | } 39 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/DefaultReconnectPolicy.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | import { IRetryPolicy, RetryContext } from "./IRetryPolicy"; 5 | 6 | // 0, 2, 10, 30 second delays before reconnect attempts. 7 | const DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null]; 8 | 9 | /** @private */ 10 | export class DefaultReconnectPolicy implements IRetryPolicy { 11 | private readonly _retryDelays: (number | null)[]; 12 | 13 | constructor(retryDelays?: number[]) { 14 | this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS; 15 | } 16 | 17 | public nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null { 18 | return this._retryDelays[retryContext.previousRetryCount]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/HeaderNames.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | export abstract class HeaderNames { 5 | static readonly Authorization = "Authorization"; 6 | static readonly Cookie = "Cookie"; 7 | } 8 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/IConnection.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | import { TransferFormat } from "./ITransport"; 5 | 6 | /** @private */ 7 | export interface IConnection { 8 | readonly features: any; 9 | readonly connectionId?: string; 10 | 11 | baseUrl: string; 12 | 13 | start(transferFormat: TransferFormat): Promise; 14 | send(data: string | ArrayBuffer): Promise; 15 | stop(error?: Error): Promise; 16 | 17 | onreceive: ((data: string | ArrayBuffer) => void) | null; 18 | onclose: ((error?: Error) => void) | null; 19 | } 20 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/ILogger.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | // These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here. 5 | /** Indicates the severity of a log message. 6 | * 7 | * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc. 8 | */ 9 | export enum LogLevel { 10 | /** Log level for very low severity diagnostic messages. */ 11 | Trace = 0, 12 | /** Log level for low severity diagnostic messages. */ 13 | Debug = 1, 14 | /** Log level for informational diagnostic messages. */ 15 | Information = 2, 16 | /** Log level for diagnostic messages that indicate a non-fatal problem. */ 17 | Warning = 3, 18 | /** Log level for diagnostic messages that indicate a failure in the current operation. */ 19 | Error = 4, 20 | /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */ 21 | Critical = 5, 22 | /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */ 23 | None = 6, 24 | } 25 | 26 | /** An abstraction that provides a sink for diagnostic messages. */ 27 | export interface ILogger { 28 | /** Called by the framework to emit a diagnostic message. 29 | * 30 | * @param {LogLevel} logLevel The severity level of the message. 31 | * @param {string} message The message. 32 | */ 33 | log(logLevel: LogLevel, message: string): void; 34 | } 35 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/IRetryPolicy.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | /** An abstraction that controls when the client attempts to reconnect and how many times it does so. */ 5 | export interface IRetryPolicy { 6 | /** Called after the transport loses the connection. 7 | * 8 | * @param {RetryContext} retryContext Details related to the retry event to help determine how long to wait for the next retry. 9 | * 10 | * @returns {number | null} The amount of time in milliseconds to wait before the next retry. `null` tells the client to stop retrying. 11 | */ 12 | nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null; 13 | } 14 | 15 | export interface RetryContext { 16 | /** 17 | * The number of consecutive failed tries so far. 18 | */ 19 | readonly previousRetryCount: number; 20 | 21 | /** 22 | * The amount of time in milliseconds spent retrying so far. 23 | */ 24 | readonly elapsedMilliseconds: number; 25 | 26 | /** 27 | * The error that forced the upcoming retry. 28 | */ 29 | readonly retryReason: Error; 30 | } 31 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/ITransport.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | // This will be treated as a bit flag in the future, so we keep it using power-of-two values. 5 | /** Specifies a specific HTTP transport type. */ 6 | export enum HttpTransportType { 7 | /** Specifies no transport preference. */ 8 | None = 0, 9 | /** Specifies the WebSockets transport. */ 10 | WebSockets = 1, 11 | /** Specifies the Server-Sent Events transport. */ 12 | ServerSentEvents = 2, 13 | /** Specifies the Long Polling transport. */ 14 | LongPolling = 4, 15 | } 16 | 17 | /** Specifies the transfer format for a connection. */ 18 | export enum TransferFormat { 19 | /** Specifies that only text data will be transmitted over the connection. */ 20 | Text = 1, 21 | /** Specifies that binary data will be transmitted over the connection. */ 22 | Binary = 2, 23 | } 24 | 25 | /** An abstraction over the behavior of transports. This is designed to support the framework and not intended for use by applications. */ 26 | export interface ITransport { 27 | connect(url: string, transferFormat: TransferFormat): Promise; 28 | send(data: any): Promise; 29 | stop(): Promise; 30 | onreceive: ((data: string | ArrayBuffer) => void) | null; 31 | onclose: ((error?: Error) => void) | null; 32 | } 33 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/Loggers.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | import { ILogger, LogLevel } from "./ILogger"; 5 | 6 | /** A logger that does nothing when log messages are sent to it. */ 7 | export class NullLogger implements ILogger { 8 | /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */ 9 | public static instance: ILogger = new NullLogger(); 10 | 11 | private constructor() {} 12 | 13 | /** @inheritDoc */ 14 | // eslint-disable-next-line 15 | public log(_logLevel: LogLevel, _message: string): void { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/Polyfills.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | // Not exported from index 5 | 6 | /** @private */ 7 | export type EventSourceConstructor = new(url: string, eventSourceInitDict?: EventSourceInit) => EventSource; 8 | 9 | /** @private */ 10 | export interface WebSocketConstructor { 11 | new(url: string, protocols?: string | string[], options?: any): WebSocket; 12 | readonly CLOSED: number; 13 | readonly CLOSING: number; 14 | readonly CONNECTING: number; 15 | readonly OPEN: number; 16 | } 17 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/Subject.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | import { IStreamResult, IStreamSubscriber, ISubscription } from "./Stream"; 5 | import { SubjectSubscription } from "./Utils"; 6 | 7 | /** Stream implementation to stream items to the server. */ 8 | export class Subject implements IStreamResult { 9 | /** @internal */ 10 | public observers: IStreamSubscriber[]; 11 | 12 | /** @internal */ 13 | public cancelCallback?: () => Promise; 14 | 15 | constructor() { 16 | this.observers = []; 17 | } 18 | 19 | public next(item: T): void { 20 | for (const observer of this.observers) { 21 | observer.next(item); 22 | } 23 | } 24 | 25 | public error(err: any): void { 26 | for (const observer of this.observers) { 27 | if (observer.error) { 28 | observer.error(err); 29 | } 30 | } 31 | } 32 | 33 | public complete(): void { 34 | for (const observer of this.observers) { 35 | if (observer.complete) { 36 | observer.complete(); 37 | } 38 | } 39 | } 40 | 41 | public subscribe(observer: IStreamSubscriber): ISubscription { 42 | this.observers.push(observer); 43 | return new SubjectSubscription(this, observer); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/TextMessageFormat.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | // Not exported from index 5 | /** @private */ 6 | export class TextMessageFormat { 7 | public static RecordSeparatorCode = 0x1e; 8 | public static RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode); 9 | 10 | public static write(output: string): string { 11 | return `${output}${TextMessageFormat.RecordSeparator}`; 12 | } 13 | 14 | public static parse(input: string): string[] { 15 | if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) { 16 | throw new Error("Message is incomplete."); 17 | } 18 | 19 | const messages = input.split(TextMessageFormat.RecordSeparator); 20 | messages.pop(); 21 | return messages; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/browser-index.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | // This is where we add any polyfills we'll need for the browser. It is the entry module for browser-specific builds. 5 | 6 | // Copy from Array.prototype into Uint8Array to polyfill on IE. It's OK because the implementations of indexOf and slice use properties 7 | // that exist on Uint8Array with the same name, and JavaScript is magic. 8 | // We make them 'writable' because the Buffer polyfill messes with it as well. 9 | if (!Uint8Array.prototype.indexOf) { 10 | Object.defineProperty(Uint8Array.prototype, "indexOf", { 11 | value: Array.prototype.indexOf, 12 | writable: true, 13 | }); 14 | } 15 | if (!Uint8Array.prototype.slice) { 16 | Object.defineProperty(Uint8Array.prototype, "slice", { 17 | // wrap the slice in Uint8Array so it looks like a Uint8Array.slice call 18 | // eslint-disable-next-line object-shorthand 19 | value: function(start?: number, end?: number) { return new Uint8Array(Array.prototype.slice.call(this, start, end)); }, 20 | writable: true, 21 | }); 22 | } 23 | if (!Uint8Array.prototype.forEach) { 24 | Object.defineProperty(Uint8Array.prototype, "forEach", { 25 | value: Array.prototype.forEach, 26 | writable: true, 27 | }); 28 | } 29 | 30 | export * from "./index"; 31 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/index.ts: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | // Everything that users need to access must be exported here. Including interfaces. 5 | export { AbortSignal } from "./AbortController"; 6 | export { AbortError, HttpError, TimeoutError } from "./Errors"; 7 | export { HttpClient, HttpRequest, HttpResponse } from "./HttpClient"; 8 | export { DefaultHttpClient } from "./DefaultHttpClient"; 9 | export { IHttpConnectionOptions } from "./IHttpConnectionOptions"; 10 | export { HubConnection, HubConnectionState } from "./HubConnection"; 11 | export { HubConnectionBuilder } from "./HubConnectionBuilder"; 12 | export { MessageType, MessageHeaders, HubMessage, HubMessageBase, HubInvocationMessage, InvocationMessage, StreamInvocationMessage, StreamItemMessage, CompletionMessage, 13 | PingMessage, CloseMessage, CancelInvocationMessage, IHubProtocol } from "./IHubProtocol"; 14 | export { ILogger, LogLevel } from "./ILogger"; 15 | export { HttpTransportType, TransferFormat, ITransport } from "./ITransport"; 16 | export { IStreamSubscriber, IStreamResult, ISubscription } from "./Stream"; 17 | export { NullLogger } from "./Loggers"; 18 | export { JsonHubProtocol } from "./JsonHubProtocol"; 19 | export { Subject } from "./Subject"; 20 | export { IRetryPolicy, RetryContext } from "./IRetryPolicy"; 21 | export { VERSION } from "./Utils"; 22 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/signalr/src/third-party-notices.txt: -------------------------------------------------------------------------------- 1 | .NET Core uses third-party libraries or other resources that may be 2 | distributed under licenses different than the .NET Core software. 3 | 4 | In the event that we accidentally failed to list a required notice, please 5 | bring it to our attention. Post an issue or email us: 6 | 7 | dotnet@microsoft.com 8 | 9 | The attached notices are provided for information only. 10 | 11 | 12 | License notice for es6-promise 13 | ------------------------------------------------------------------------------ 14 | "Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors 15 | 16 | Permission is hereby granted, free of charge, to any person obtaining a copy of 17 | this software and associated documentation files (the "Software"), to deal in 18 | the Software without restriction, including without limitation the rights to 19 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 20 | of the Software, and to permit persons to whom the Software is furnished to do 21 | so, subject to the following conditions: 22 | 23 | The above copyright notice and this permission notice shall be included in all 24 | copies or substantial portions of the Software. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 29 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 30 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 31 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 32 | SOFTWARE." -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your Javascript code. 5 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage.WebApplication/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/ArgumentHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage 4 | { 5 | internal static class ArgumentHelper 6 | { 7 | public static void ThrowIfValueIsNotPositive(TimeSpan value, string fieldName) 8 | { 9 | var message = $"The {fieldName} property value should be positive. Given: {value}."; 10 | 11 | if (value == TimeSpan.Zero || value != value.Duration()) 12 | throw new ArgumentException(message, nameof(value)); 13 | } 14 | 15 | public static void ThrowIfValueIsNotPositive(int? value, string fieldName) 16 | { 17 | var message = $"The {fieldName} property value should be positive. Given: {value}."; 18 | 19 | if (value.HasValue && value.Value <= 0) 20 | throw new ArgumentException(message, nameof(value)); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/CounterBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Entities 4 | { 5 | public abstract class CounterBase : IExpirableWithId, IInt32Id, IStringKey, IIntValue 6 | { 7 | public virtual DateTime? ExpireAt { get; set; } 8 | public virtual int Id { get; set; } 9 | public virtual int Value { get; set; } 10 | public virtual string Key { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/ICreatedAt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Entities 4 | { 5 | public interface ICreatedAt 6 | { 7 | DateTime CreatedAt { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/IExpirableWithId.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | internal interface IExpirableWithId : IExpirable, IInt32Id 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/IExpirableWithKey.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | internal interface IExpirableWithKey : IExpirable 4 | { 5 | string Key { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/IExpireAtNullable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Entities 4 | { 5 | public interface IExpirable 6 | { 7 | DateTime? ExpireAt { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/IFetchedAtNullable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Entities 4 | { 5 | public interface IFetchedAtNullable 6 | { 7 | DateTime? FetchedAt { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/IInt32Id.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public interface IInt32Id 4 | { 5 | int Id { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/IIntValue.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public interface IIntValue 4 | { 5 | int Value { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/IJobChild.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public interface IJobChild 4 | { 5 | _Job Job { get; } 6 | } 7 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/IKeyWithStringValue.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | internal interface IKeyWithStringValue 4 | { 5 | string Key { get; } 6 | string Value { get; } 7 | } 8 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/IStringKey.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public interface IStringKey 4 | { 5 | string Key { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/IStringValue.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public interface IStringValue 4 | { 5 | string Value { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/Int32IdBase.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public abstract class Int32IdBase : IInt32Id 4 | { 5 | public virtual int Id { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/KeyValueTypeBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Entities 4 | { 5 | public abstract class KeyValueTypeBase : Int32IdBase, IExpirableWithKey, IExpirableWithId, IExpirable, 6 | IStringKey 7 | { 8 | public virtual T Value { get; set; } 9 | public virtual string Key { get; set; } 10 | public virtual DateTime? ExpireAt { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/ServerData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Entities 4 | { 5 | public class ServerData 6 | { 7 | public int WorkerCount { get; set; } 8 | public string[] Queues { get; set; } 9 | public DateTime? StartedAt { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_AggregatedCounter.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public class _AggregatedCounter : CounterBase 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_Counter.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public class _Counter : CounterBase 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_DistributedLock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Entities 5 | { 6 | public class _DistributedLock : Int32IdBase, ICreatedAt 7 | { 8 | public _DistributedLock() 9 | { 10 | CreatedAt = DateTime.UtcNow; 11 | ExpireAtAsLong = DateTime.UtcNow.ToEpochDate(); 12 | } 13 | 14 | /// 15 | /// This is a long integer because NHibernate's default storage for dates 16 | /// doesn't have accuracy smaller than 1 second. 17 | /// 18 | public virtual long ExpireAtAsLong { get; set; } 19 | 20 | //this column is just for debugging 21 | 22 | public virtual string Resource { get; set; } 23 | public virtual DateTime CreatedAt { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_Dual.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | /// 4 | /// Dual is a single-row table created to mock a VALUES statement in HQL 5 | /// 6 | public class _Dual : Int32IdBase 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_Hash.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public class _Hash : KeyValueTypeBase, IStringKey, IStringValue 4 | { 5 | public virtual string Field { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_Job.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Entities 5 | { 6 | public class _Job : IExpirableWithId, ICreatedAt, IExpirable 7 | { 8 | public _Job() 9 | { 10 | Parameters = new List<_JobParameter>(); 11 | History = new List<_JobState>(); 12 | } 13 | 14 | // public virtual _JobState CurrentState { get; set; } 15 | public virtual string InvocationData { get; set; } 16 | 17 | public virtual string Arguments { get; set; } 18 | 19 | public virtual IList<_JobParameter> Parameters { get; set; } 20 | public virtual IList<_JobState> History { get; set; } 21 | public virtual string StateName { get; set; } 22 | public virtual string StateReason { get; set; } 23 | public virtual DateTime? LastStateChangedAt { get; set; } 24 | public virtual string StateData { get; set; } 25 | public virtual DateTime CreatedAt { get; set; } 26 | 27 | 28 | public virtual int Id { get; set; } 29 | public virtual DateTime? ExpireAt { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_JobParameter.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public class _JobParameter : Int32IdBase, IJobChild 4 | { 5 | public virtual string Name { get; set; } 6 | public virtual string Value { get; set; } 7 | public virtual _Job Job { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_JobQueue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Entities 4 | { 5 | public class _JobQueue : Int32IdBase, IJobChild, IFetchedAtNullable 6 | { 7 | public virtual string Queue { get; set; } 8 | public virtual string FetchToken { get; set; } 9 | public virtual DateTime? FetchedAt { get; set; } 10 | public virtual _Job Job { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_JobState.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Entities 4 | { 5 | public class _JobState : Int32IdBase, IJobChild, ICreatedAt 6 | { 7 | public virtual string Name { get; set; } 8 | public virtual string Reason { get; set; } 9 | public virtual string Data { get; set; } 10 | public virtual DateTime CreatedAt { get; set; } 11 | public virtual _Job Job { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_List.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public class _List : KeyValueTypeBase, IKeyWithStringValue, IStringValue 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_Server.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Entities 4 | { 5 | public class _Server 6 | { 7 | public virtual string Id { get; set; } 8 | public virtual string Data { get; set; } = string.Empty; 9 | public virtual DateTime? LastHeartbeat { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Entities/_Set.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Entities 2 | { 3 | public class _Set : KeyValueTypeBase, IKeyWithStringValue, IStringValue 4 | { 5 | public virtual double Score { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Extensions/CancellationTokenExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Threading; 4 | using Hangfire.Common; 5 | 6 | namespace Hangfire.FluentNHibernateStorage.Extensions 7 | { 8 | public static class CancellationTokenExtensions 9 | { 10 | private static readonly TimeSpan PollInterval = TimeSpan.FromSeconds(1); 11 | 12 | /// 13 | /// Do a wait but check often to see if cancellation has been requested for smoother shutdown 14 | /// 15 | /// 16 | /// 17 | public static void PollForCancellation(this CancellationToken cancellationToken, TimeSpan interval) 18 | { 19 | var stopwatch = new Stopwatch(); 20 | stopwatch.Start(); 21 | while (stopwatch.Elapsed < interval) 22 | { 23 | cancellationToken.Wait(PollInterval); 24 | cancellationToken.ThrowIfCancellationRequested(); 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Extensions/DateHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Extensions 4 | { 5 | public static class DateHelper 6 | { 7 | public static long ToEpochDate(this DateTime dateTime) 8 | { 9 | return new DateTimeOffset(dateTime).ToUnixTimeMilliseconds(); 10 | } 11 | 12 | public static DateTime FromEpochDate(this long dateTime) 13 | { 14 | return DateTimeOffset.FromUnixTimeMilliseconds(dateTime).UtcDateTime; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/FluentNHibernateDistributedLockTimeoutException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage 4 | { 5 | public class FluentNHibernateDistributedLockTimeoutException : Exception 6 | { 7 | public FluentNHibernateDistributedLockTimeoutException(string message) : base(message) 8 | { 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/FluentNHibernateJobStorageTestWrapper.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage 2 | { 3 | public class FluentNHibernateJobStorageTestWrapper 4 | { 5 | private readonly FluentNHibernateJobStorage _storage; 6 | 7 | public FluentNHibernateJobStorageTestWrapper(FluentNHibernateJobStorage storage) 8 | { 9 | _storage = storage; 10 | } 11 | 12 | public int ExecuteHqlQuery(string query) 13 | { 14 | return _storage.UseStatelessSession(session => { return session.CreateQuery(query).ExecuteUpdate(); }); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/FluentNHibernateStorageBootstrapperConfigurationExtensions.cs: -------------------------------------------------------------------------------- 1 | using Snork.FluentNHibernateTools; 2 | 3 | namespace Hangfire.FluentNHibernateStorage 4 | { 5 | public static class FluentNHibernateStorageBootstrapperConfigurationExtensions 6 | { 7 | /// 8 | /// Tells the bootstrapper to use FluentNHibernate provider as a job storage, 9 | /// that can be accessed using the given connection string or 10 | /// its name. 11 | /// 12 | /// Configuration 13 | /// Connection string or its name 14 | /// Provider type from enumeration 15 | /// Advanced options 16 | public static IGlobalConfiguration UseFluentNHibernateJobStorage( 17 | this IGlobalConfiguration configuration, 18 | string nameOrConnectionString, ProviderTypeEnum providerType, FluentNHibernateStorageOptions options = null) 19 | { 20 | var storage = FluentNHibernateStorageFactory.For(providerType, nameOrConnectionString, 21 | options ?? new FluentNHibernateStorageOptions()); 22 | configuration.UseStorage(storage); 23 | return configuration; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Hangfire.FluentNHibernateStorage.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 1.2.1020 6 | Xavier Jefferson 7 | (c) 2017-2020 Xavier Jefferson. All rights reserved. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/JobQueue/EnqueuedAndFetchedCountDto.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.JobQueue 2 | { 3 | public class EnqueuedAndFetchedCountDto 4 | { 5 | public int? EnqueuedCount { get; set; } 6 | public int? FetchedCount { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/JobQueue/FetchedJob.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.JobQueue 2 | { 3 | public class FetchedJob 4 | { 5 | public long Id { get; set; } 6 | public long JobId { get; set; } 7 | public string Queue { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/JobQueue/FluentNHibernateJobQueueProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.JobQueue 4 | { 5 | internal class FluentNHibernateJobQueueProvider : IPersistentJobQueueProvider 6 | { 7 | private readonly IPersistentJobQueue _jobQueue; 8 | private readonly IPersistentJobQueueMonitoringApi _monitoringApi; 9 | 10 | public FluentNHibernateJobQueueProvider(FluentNHibernateJobStorage storage) 11 | { 12 | if (storage == null) throw new ArgumentNullException(nameof(storage)); 13 | _jobQueue = new FluentNHibernateJobQueue(storage); 14 | _monitoringApi = new FluentNHibernateJobQueueMonitoringApi(storage); 15 | } 16 | 17 | public IPersistentJobQueue GetJobQueue() 18 | { 19 | return _jobQueue; 20 | } 21 | 22 | public IPersistentJobQueueMonitoringApi GetJobQueueMonitoringApi() 23 | { 24 | return _monitoringApi; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/JobQueue/IPersistentJobQueue.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using Hangfire.Storage; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.JobQueue 5 | { 6 | public interface IPersistentJobQueue 7 | { 8 | IFetchedJob Dequeue(string[] queues, CancellationToken cancellationToken); 9 | void Enqueue(StatelessSessionWrapper session, string queue, string jobId); 10 | } 11 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/JobQueue/IPersistentJobQueueMonitoringApi.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.JobQueue 4 | { 5 | public interface IPersistentJobQueueMonitoringApi 6 | { 7 | IEnumerable GetQueues(); 8 | IEnumerable GetEnqueuedJobIds(string queue, int from, int perPage); 9 | IEnumerable GetFetchedJobIds(string queue, int from, int perPage); 10 | EnqueuedAndFetchedCountDto GetEnqueuedAndFetchedCount(string queue); 11 | } 12 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/JobQueue/IPersistentJobQueueProvider.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.JobQueue 2 | { 3 | public interface IPersistentJobQueueProvider 4 | { 5 | IPersistentJobQueue GetJobQueue(); 6 | IPersistentJobQueueMonitoringApi GetJobQueueMonitoringApi(); 7 | } 8 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/ClassMapBase.cs: -------------------------------------------------------------------------------- 1 | using FluentNHibernate.Mapping; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal abstract class ClassMapBase : ClassMap 7 | { 8 | protected ClassMapBase() 9 | { 10 | Table(Tablename.WrapObjectName()); 11 | } 12 | 13 | public abstract string Tablename { get; } 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage.Maps 2 | { 3 | public class Defaults 4 | { 5 | public const int DistributedLockPollIntervalSeconds = 15; 6 | } 7 | internal class Constants 8 | { 9 | //exceeding 4000 will break sqlce 10 | public const int VarcharMaxLength = 4000; 11 | 12 | public const int StateReasonLength = 100; 13 | public const int StateDataLength = VarcharMaxLength; 14 | public const int StateNameLength = 20; 15 | 16 | public class ColumnNames 17 | { 18 | public static readonly string JobId = "JobId"; 19 | public static readonly string Id = "Id"; 20 | public static readonly string Data = "Data"; 21 | public static readonly string CreatedAt = "CreatedAt"; 22 | public static readonly string Key = "Key"; 23 | public static readonly string Value = "Value"; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/Int32IdMapBase.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal abstract class Int32IdMapBase : ClassMapBase where T : IInt32Id 7 | { 8 | protected Int32IdMapBase() 9 | { 10 | LazyLoad(); 11 | this.MapIntIdColumn(); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_AggregatedCounterMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Maps 4 | { 5 | internal class _AggregatedCounterMap : _CounterBaseMap<_AggregatedCounter> 6 | { 7 | public override string Tablename => "AggregatedCounter"; 8 | 9 | public override bool KeyIsUnique => true; 10 | } 11 | 12 | /* 13 | * 14 | CREATE TABLE [HangFire].[AggregatedCounter] ( 15 | [Id] [int] IDENTITY(1,1) NOT NULL, 16 | [Key] [nvarchar](100) NOT NULL, 17 | [Value] [bigint] NOT NULL, 18 | [ExpireAt] [datetime] NULL, 19 | 20 | CONSTRAINT [PK_HangFire_CounterAggregated] PRIMARY KEY CLUSTERED ([Id] ASC) 21 | ); 22 | PRINT 'Created table [HangFire].[AggregatedCounter]'; 23 | 24 | CREATE UNIQUE NONCLUSTERED INDEX [UX_HangFire_CounterAggregated_Key] ON [HangFire].[AggregatedCounter] ( 25 | [Key] ASC 26 | ) INCLUDE ([Value]); 27 | 28 | */ 29 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_CounterBaseMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal abstract class _CounterBaseMap : Int32IdMapBase where T : CounterBase 7 | { 8 | protected _CounterBaseMap() 9 | { 10 | Table(Tablename.WrapObjectName()); 11 | //id is mapped in base class 12 | var tmp = this.MapStringKeyColumn().Length(100); 13 | if (KeyIsUnique) 14 | tmp.UniqueKey($"UX_Hangfire_{Tablename}_Key"); 15 | else 16 | tmp.Index($"IX_Hangfire_{Tablename}_Key"); 17 | this.MapIntValueColumn(); 18 | this.MapExpireAt(); 19 | } 20 | 21 | 22 | public abstract bool KeyIsUnique { get; } 23 | } 24 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_CounterMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | 3 | namespace Hangfire.FluentNHibernateStorage.Maps 4 | { 5 | /* 6 | CREATE TABLE [HangFire].[Counter]( 7 | [Id] [int] IDENTITY(1,1) NOT NULL, 8 | [Key] [nvarchar](100) NOT NULL, 9 | [Value] [tinyint] NOT NULL, 10 | [ExpireAt] [datetime] NULL, 11 | 12 | CONSTRAINT [PK_HangFire_Counter] PRIMARY KEY CLUSTERED ([Id] ASC) 13 | ); 14 | PRINT 'Created table [HangFire].[Counter]'; 15 | 16 | CREATE NONCLUSTERED INDEX [IX_HangFire_Counter_Key] ON [HangFire].[Counter] ([Key] ASC) 17 | INCLUDE ([Value]); 18 | PRINT 'Created index [IX_HangFire_Counter_Key]'; 19 | 20 | SET @CURRENT_SCHEMA_VERSION = 1; 21 | END 22 | 23 | IF @CURRENT_SCHEMA_VERSION = 1 24 | BEGIN 25 | PRINT 'Installing schema version 2'; 26 | 27 | -- https://github.com/odinserj/HangFire/issues/83 28 | 29 | DROP INDEX [IX_HangFire_Counter_Key] ON [HangFire].[Counter]; 30 | 31 | ALTER TABLE [HangFire].[Counter] ALTER COLUMN [Value] SMALLINT NOT NULL; 32 | 33 | CREATE NONCLUSTERED INDEX [IX_HangFire_Counter_Key] ON [HangFire].[Counter] ([Key] ASC) 34 | INCLUDE ([Value]); 35 | PRINT 'Index [IX_HangFire_Counter_Key] re-created'; 36 | */ 37 | internal class _CounterMap : _CounterBaseMap<_Counter> 38 | { 39 | public override string Tablename => "Counter"; 40 | 41 | public override bool KeyIsUnique => false; 42 | } 43 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_DistributedLockMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal class _DistributedLockMap : Int32IdMapBase<_DistributedLock> 7 | { 8 | public _DistributedLockMap() 9 | { 10 | Map(i => i.Resource).Column("Resource".WrapObjectName()).Length(100).Not.Nullable().Unique(); 11 | this.MapCreatedAt(); 12 | Map(i => i.ExpireAtAsLong).Column("ExpireAtAsLong".WrapObjectName()).Not.Nullable(); 13 | } 14 | 15 | public override string Tablename => "DistributedLock"; 16 | } 17 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_DualMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal class _DualMap : ClassMapBase<_Dual> 7 | { 8 | public _DualMap() 9 | { 10 | Id(i => i.Id).Column(Constants.ColumnNames.Id.WrapObjectName()).GeneratedBy.Assigned(); 11 | } 12 | 13 | public override string Tablename => "Dual"; 14 | } 15 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_HashMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal class _HashMap : Int32IdMapBase<_Hash> 7 | { 8 | public _HashMap() 9 | { 10 | var indexName = $"UX_{Tablename}_{Constants.ColumnNames.Key}_Field"; 11 | 12 | //id is mapped in parent class 13 | this.MapStringKeyColumn().UniqueKey(indexName).Length(100); 14 | Map(i => i.Field).Column("Field".WrapObjectName()).Not.Nullable().UniqueKey(indexName).Length(40); 15 | this.MapStringValueColumn(true).Length(Constants.VarcharMaxLength); 16 | this.MapExpireAt(); 17 | } 18 | 19 | public override string Tablename => "Hash"; 20 | } 21 | 22 | /* 23 | We're only doing one value column instead of two. 24 | 25 | 26 | CREATE TABLE [HangFire].[Hash]( 27 | [Id] [int] IDENTITY(1,1) NOT NULL, 28 | [Key] [nvarchar](100) NOT NULL, 29 | [Name] [nvarchar](40) NOT NULL, 30 | [StringValue] [nvarchar](max) NULL, 31 | [IntValue] [int] NULL, 32 | [ExpireAt] [datetime] NULL, 33 | 34 | CONSTRAINT [PK_HangFire_Hash] PRIMARY KEY CLUSTERED ([Id] ASC) 35 | ); 36 | PRINT 'Created table [HangFire].[Hash]'; 37 | 38 | CREATE UNIQUE NONCLUSTERED INDEX [UX_HangFire_Hash_KeyAndName] ON [HangFire].[Hash] ( 39 | [Key] ASC, 40 | [Name] ASC 41 | ); 42 | */ 43 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_JobMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal class _JobMap : Int32IdMapBase<_Job> 7 | { 8 | public _JobMap() 9 | { 10 | Map(i => i.LastStateChangedAt).Column("LastStateChangedAt".WrapObjectName()).Nullable(); 11 | Map(i => i.StateData).Column("StateData".WrapObjectName()).Length(Constants.StateDataLength).Nullable(); 12 | Map(i => i.InvocationData) 13 | .Column("InvocationData".WrapObjectName()) 14 | .Length(Constants.VarcharMaxLength) 15 | .Not.Nullable(); 16 | Map(i => i.Arguments) 17 | .Column("Arguments".WrapObjectName()) 18 | .Length(Constants.VarcharMaxLength) 19 | .Not.Nullable(); 20 | this.MapCreatedAt(); 21 | this.MapExpireAt(); 22 | var jobId = Constants.ColumnNames.JobId.WrapObjectName(); 23 | HasMany(i => i.Parameters).KeyColumn(jobId).Cascade.All(); 24 | HasMany(i => i.History).KeyColumn(jobId).Cascade.All(); 25 | 26 | Map(i => i.StateName).Column("StateName".WrapObjectName()).Length(Constants.StateNameLength).Nullable(); 27 | Map(i => i.StateReason) 28 | .Column("StateReason".WrapObjectName()) 29 | .Length(Constants.StateReasonLength) 30 | .Nullable(); 31 | } 32 | 33 | public override string Tablename => "Job"; 34 | } 35 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_JobParameterMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal class _JobParameterMap : Int32IdMapBase<_JobParameter> 7 | { 8 | public _JobParameterMap() 9 | { 10 | string indexName = $"IX_Hangfire_{Tablename}_JobIdAndName"; 11 | 12 | References(i => i.Job).Column(Constants.ColumnNames.JobId.WrapObjectName()).Not.Nullable().Cascade.Delete() 13 | .UniqueKey(indexName).ForeignKey($"FK_Hangfire_{Tablename}_Job"); 14 | Map(i => i.Name).Column("Name".WrapObjectName()).Length(40).Not.Nullable().UniqueKey(indexName); 15 | Map(i => i.Value).Column(Constants.ColumnNames.Value.WrapObjectName()).Length(Constants.VarcharMaxLength) 16 | .Nullable(); 17 | } 18 | 19 | public override string Tablename => "JobParameter"; 20 | } 21 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_JobQueueMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal class _JobQueueMap : Int32IdMapBase<_JobQueue> 7 | { 8 | public _JobQueueMap() 9 | { 10 | References(i => i.Job).Cascade.Delete().Column(Constants.ColumnNames.JobId.WrapObjectName()); 11 | Map(i => i.FetchedAt).Column("FetchedAt".WrapObjectName()).Nullable().CustomType(); 12 | Map(i => i.Queue).Column("Queue".WrapObjectName()).Length(50).Not.Nullable(); 13 | Map(i => i.FetchToken).Column("FetchToken".WrapObjectName()).Length(36).Nullable(); 14 | } 15 | 16 | public override string Tablename => "JobQueue"; 17 | } 18 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_JobStateMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal class _JobStateMap : Int32IdMapBase<_JobState> 7 | { 8 | public _JobStateMap() 9 | { 10 | Map(i => i.Name).Column("Name".WrapObjectName()).Length(Constants.StateNameLength).Not.Nullable(); 11 | Map(i => i.Reason).Column("Reason".WrapObjectName()).Length(Constants.StateReasonLength).Nullable(); 12 | Map(i => i.Data).Column(Constants.ColumnNames.Data.WrapObjectName()).Length(Constants.StateDataLength) 13 | .Nullable(); 14 | this.MapCreatedAt(); 15 | References(i => i.Job).Column(Constants.ColumnNames.JobId.WrapObjectName()).Not.Nullable().Cascade.Delete(); 16 | } 17 | 18 | public override string Tablename => "JobState"; 19 | } 20 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_ListMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal class _ListMap : Int32IdMapBase<_List> 7 | { 8 | public _ListMap() 9 | { 10 | //id is mapped in parent class 11 | this.MapStringKeyColumn().Length(100); 12 | this.MapStringValueColumn(true).Length(Constants.VarcharMaxLength); 13 | this.MapExpireAt(); 14 | } 15 | 16 | public override string Tablename => "List"; 17 | } 18 | 19 | /* 20 | 21 | CREATE TABLE [HangFire].[List]( 22 | [Id] [int] IDENTITY(1,1) NOT NULL, 23 | [Key] [nvarchar](100) NOT NULL, 24 | [Value] [nvarchar](max) NULL, 25 | [ExpireAt] [datetime] NULL, 26 | 27 | CONSTRAINT [PK_HangFire_List] PRIMARY KEY CLUSTERED ([Id] ASC) 28 | ); 29 | 30 | */ 31 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_ServerMap.cs: -------------------------------------------------------------------------------- 1 | using FluentNHibernate.Mapping; 2 | using Hangfire.FluentNHibernateStorage.Entities; 3 | using Hangfire.FluentNHibernateStorage.Extensions; 4 | 5 | namespace Hangfire.FluentNHibernateStorage.Maps 6 | { 7 | internal class _ServerMap : ClassMap<_Server> 8 | { 9 | public _ServerMap() 10 | { 11 | Table("Server".WrapObjectName()); 12 | Id(i => i.Id).Length(200).GeneratedBy.Assigned().Column(Constants.ColumnNames.Id.WrapObjectName()); 13 | Map(i => i.Data).Length(Constants.VarcharMaxLength).Not.Nullable() 14 | .Column(Constants.ColumnNames.Data.WrapObjectName()); 15 | Map(i => i.LastHeartbeat).Nullable().Column("LastHeartbeat".WrapObjectName()) 16 | .CustomType(); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Maps/_SetMap.cs: -------------------------------------------------------------------------------- 1 | using Hangfire.FluentNHibernateStorage.Entities; 2 | using Hangfire.FluentNHibernateStorage.Extensions; 3 | 4 | namespace Hangfire.FluentNHibernateStorage.Maps 5 | { 6 | internal class _SetMap : Int32IdMapBase<_Set> 7 | { 8 | public _SetMap() 9 | { 10 | var indexName = $"UX_{Tablename}_{Constants.ColumnNames.Key}_{Constants.ColumnNames.Value}"; 11 | Table("Set".WrapObjectName()); 12 | //id is mapped in parent class 13 | this.MapStringKeyColumn().UniqueKey(indexName).Length(100); 14 | Map(i => i.Score).Column("Score".WrapObjectName()).Not.Nullable(); 15 | this.MapStringValueColumn(false).UniqueKey(indexName).Length(255); 16 | this.MapExpireAt(); 17 | } 18 | 19 | public override string Tablename => "Set"; 20 | } 21 | 22 | /* 23 | CREATE TABLE [HangFire].[Set]( 24 | [Id] [int] IDENTITY(1,1) NOT NULL, 25 | [Key] [nvarchar](100) NOT NULL, 26 | [Score] [float] NOT NULL, 27 | [Value] [nvarchar](256) NOT NULL, 28 | [ExpireAt] [datetime] NULL, 29 | 30 | CONSTRAINT [PK_HangFire_Set] PRIMARY KEY CLUSTERED ([Id] ASC) 31 | ); 32 | PRINT 'Created table [HangFire].[Set]'; 33 | 34 | CREATE UNIQUE NONCLUSTERED INDEX [UX_HangFire_Set_KeyAndValue] ON [HangFire].[Set] ( 35 | [Key] ASC, 36 | [Value] ASC 37 | ); 38 | 39 | */ 40 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/PrefixRenamer.cs: -------------------------------------------------------------------------------- 1 | using Snork.FluentNHibernateTools; 2 | 3 | namespace Hangfire.FluentNHibernateStorage 4 | { 5 | internal class PrefixRenamer : IObjectRenamer 6 | { 7 | public PrefixRenamer(string prefix) 8 | { 9 | Prefix = prefix; 10 | } 11 | 12 | public string Prefix { get; } 13 | 14 | public string Rename(ObjectTypeEnum type, string name) 15 | { 16 | if (Prefix.Equals(FluentNHibernateStorageOptions.DefaultTablePrefix)) 17 | { 18 | switch (type) 19 | { 20 | case ObjectTypeEnum.Table: 21 | return string.Concat(Prefix, name); 22 | default: 23 | return name; 24 | } 25 | } 26 | else 27 | { 28 | return string.Concat(Prefix, name); 29 | } 30 | 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Hangfire.MySql")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Hangfire.MySql")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("fc4a387e-9093-4dee-b17c-20d2284c2d21")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | 38 | [assembly: InternalsVisibleTo("Hangfire.MySql.Tests")] 39 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/ServerTimeSyncManager.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using Hangfire.Common; 3 | using Hangfire.Server; 4 | 5 | namespace Hangfire.FluentNHibernateStorage 6 | { 7 | #pragma warning disable 618 8 | public class ServerTimeSyncManager : IBackgroundProcess, IServerComponent 9 | { 10 | private readonly FluentNHibernateJobStorage _storage; 11 | 12 | public ServerTimeSyncManager(FluentNHibernateJobStorage storage) 13 | { 14 | _storage = storage; 15 | } 16 | 17 | public void Execute(BackgroundProcessContext context) 18 | { 19 | Execute(context.StoppedToken); 20 | } 21 | 22 | public void Execute(CancellationToken cancellationToken) 23 | { 24 | _storage.RefreshUtcOFfset(); 25 | 26 | cancellationToken.Wait(_storage.Options.DbmsTimeSyncInterval); 27 | } 28 | #pragma warning restore 618 29 | } 30 | } -------------------------------------------------------------------------------- /Hangfire.FluentNHibernateStorage/StringToInt32Converter.cs: -------------------------------------------------------------------------------- 1 | namespace Hangfire.FluentNHibernateStorage 2 | { 3 | internal class StringToInt32Converter 4 | { 5 | private StringToInt32Converter() 6 | { 7 | } 8 | 9 | public bool Valid { get; private set; } 10 | public int Value { get; private set; } 11 | 12 | public static StringToInt32Converter Convert(string jobId) 13 | { 14 | int value; 15 | var valid = int.TryParse(jobId, out value); 16 | return new StringToInt32Converter {Value = value, Valid = valid}; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /LICENSE.MD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xavierjefferson/Hangfire.FluentNHibernateStorage/98a5408b7f3314fce2166e4c321c5bfe9e621920/LICENSE.MD -------------------------------------------------------------------------------- /Run Tests.bat: -------------------------------------------------------------------------------- 1 | packages\xunit.runner.console.2.3.1\tools\net452\xunit.console.exe Hangfire.FluentNHibernateStorage.Tests\bin\debug\Hangfire.FluentNHibernateStorage.Tests.dll 2 | pause -------------------------------------------------------------------------------- /nu-build/build.bat: -------------------------------------------------------------------------------- 1 | mkdir .\packages 2 | ..\.nuget\nuget.exe pack ..\nuspecs\Hangfire.FluentNHibernateStorage.nuspec -outputdirectory .\packages 3 | pause -------------------------------------------------------------------------------- /nuspecs/Hangfire.FluentNHibernateStorage.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Hangfire.FluentNHibernateStorage 6 | 1.7.30 7 | Xavier Jefferson 8 | XavierJefferson 9 | https://www.gnu.org/licenses/lgpl-3.0.en.html 10 | https://github.com/xavierjefferson/Hangfire.FluentNHibernateStorage 11 | 12 | false 13 | A Hangfire storage provider for SQL Server, MySQL, Oracle, DB/2, PostgreSQL, and Firebird 14 | 15 | Update to Hangfire 1.7.30 which includes update to FluentNHibernate 3.1.0 / NHibernate 5.3.3, improved session flush feature, and other optimizations. More unit tests. 16 | 17 | Copyright © 2017-2022 Xavier Jefferson 18 | hangfire storage provider mssql mysql oracle postgresql firebird db2 sqlite 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 31 | 32 | 33 | --------------------------------------------------------------------------------