-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
75 changed files
with
865 additions
and
922 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 0 additions & 40 deletions
40
Elfo.Wardein.Abstractions/Configuration/Models/GenericServiceModel.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
Elfo.Wardein.Abstractions/Configuration/Models/WatcherConfigurationModel.cs
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
...Abstractions/Configuration/Models/WatcherModels/Abstractions/IAmBaseConfigurationModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Elfo.Wardein.Abstractions.Configuration.Models | ||
{ | ||
public interface IAmBaseConfigurationModel | ||
{ | ||
[JsonProperty(PropertyName = "isInMaintenanceMode")] | ||
bool IsInMaintenanceMode { get; } | ||
[JsonProperty(PropertyName = "timeSpanFromSeconds")] | ||
double TimeSpanFromSeconds { get; } | ||
[JsonProperty(PropertyName = "watcherConfigurationId")] | ||
public int WatcherConfigurationId { get; } | ||
[JsonProperty(PropertyName = "applicationId")] | ||
public int ApplicationId { get; } | ||
[JsonProperty(PropertyName = "applicationHostname")] | ||
public string ApplicationHostname { get; } | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...ns/Configuration/Models/WatcherModels/Abstractions/IAmConfigurationModelWithResolution.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Elfo.Wardein.Abstractions.Configuration.Models | ||
{ | ||
public interface IAmConfigurationModelWithResolution : IAmBaseConfigurationModel | ||
{ | ||
[JsonProperty(PropertyName = "notificationtype")] | ||
public NotificationType NotificationType { get; set; } | ||
|
||
[JsonProperty(PropertyName = "recipientAddresses")] | ||
public string RecipientAddresses { get; set; } | ||
|
||
[JsonProperty(PropertyName = "failureMessage")] | ||
public string FailureMessage { get; set; } | ||
|
||
[JsonProperty(PropertyName = "restoredMessage")] | ||
public string RestoredMessage { get; set; } | ||
|
||
[JsonProperty(PropertyName = "maxRetryCount")] | ||
public int MaxRetryCount { get; set; } | ||
|
||
[JsonProperty(PropertyName = "sendReminderEmailAfterRetryCount")] | ||
public int SendReminderEmailAfterRetryCount { get; set; } | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
Elfo.Wardein.Abstractions/Configuration/Models/WatcherModels/FileSystemConfigurationModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Elfo.Wardein.Abstractions.Configuration.Models | ||
{ | ||
public class FileSystemConfigurationModel : IAmBaseConfigurationModel | ||
{ | ||
/// <summary> | ||
/// Property defines if watcher has to be running in maintainance mode | ||
/// Default value false | ||
/// </summary> | ||
[JsonProperty(PropertyName = "isInMaintenanceMode")] | ||
public bool IsInMaintenanceMode { get; set; } = false; | ||
|
||
/// <summary> | ||
/// Property that defines frequency of watcher polling | ||
/// Default value 10 seconds | ||
/// </summary> | ||
[JsonProperty(PropertyName = "timeSpanFromSeconds")] | ||
public double TimeSpanFromSeconds { get; set; } = 300; | ||
|
||
/// <summary> | ||
/// List of folder configurations that has to be monitored and cleaned by criteria | ||
/// </summary> | ||
[JsonProperty(PropertyName = "cleanUps")] | ||
public IEnumerable<FileSystemCleanUpConfig> CleanUps { get; set; } = new List<FileSystemCleanUpConfig>(); | ||
|
||
public int WatcherConfigurationId { get; set; } | ||
|
||
public int ApplicationId { get; set; } | ||
|
||
public string ApplicationHostname => HostHelper.GetName(); | ||
} | ||
|
||
public class FileSystemCleanUpConfig | ||
{ | ||
[JsonProperty(PropertyName = "filePath")] | ||
public string FilePath { get; set; } | ||
|
||
[JsonProperty(PropertyName = "timeSpanFromSeconds")] | ||
public double TimeSpanFromSeconds { get; set; } = 10; // Default values | ||
|
||
[JsonProperty(PropertyName = "cleanUpOptions")] | ||
public FileSystemCleanUpOptions CleanUpOptions { get; set; } = new FileSystemCleanUpOptions(); | ||
} | ||
|
||
public class FileSystemCleanUpOptions | ||
{ | ||
[JsonProperty(PropertyName = "thresholdInSeconds")] | ||
public int ThresholdInSeconds { get; set; } | ||
|
||
[JsonProperty(PropertyName = "thresholdInDays")] | ||
public int ThresholdInDays { get; set; } | ||
|
||
[JsonProperty(PropertyName = "displayOnly")] | ||
public bool DisplayOnly { get; set; } = false; | ||
|
||
[JsonProperty(PropertyName = "useRecycleBin")] | ||
public bool UseRecycleBin { get; set; } = false; | ||
|
||
[JsonProperty(PropertyName = "removeEmptyFolders")] | ||
public bool RemoveEmptyFolders { get; set; } = false; | ||
|
||
[JsonProperty(PropertyName = "recursive")] | ||
public bool Recursive { get; set; } = false; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...rdein.Abstractions/Configuration/Models/WatcherModels/GenericServiceConfigurationModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Elfo.Wardein.Abstractions.Configuration.Models | ||
{ | ||
public class GenericServiceConfigurationModel : IAmConfigurationModelWithResolution | ||
{ | ||
[JsonProperty(PropertyName = "serviceName")] | ||
public string ServiceName { get; set; } | ||
[JsonProperty(PropertyName = "serviceManagerType")] | ||
public ServiceManagerType ServiceManagerType { get; set; } | ||
public bool IsInMaintenanceMode { get; set; } | ||
public double TimeSpanFromSeconds { get; set; } = 60; | ||
public int WatcherConfigurationId { get; set; } | ||
public int ApplicationId { get; set; } | ||
public string ApplicationHostname => HostHelper.GetName(); | ||
public string RecipientAddresses { get; set; } | ||
public string FailureMessage { get; set; } | ||
public int SendReminderEmailAfterRetryCount { get; set; } = 120; | ||
public NotificationType NotificationType { get; set; } = NotificationType.Mail; | ||
public string RestoredMessage { get; set; } | ||
public int MaxRetryCount { get; set; } = 2; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
Elfo.Wardein.Abstractions/Configuration/Models/WatcherModels/HeartbeatConfigurationModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Net; | ||
using System.Text; | ||
|
||
namespace Elfo.Wardein.Abstractions.Configuration.Models | ||
{ | ||
public class HeartbeatConfigurationModel : IAmBaseConfigurationModel | ||
{ | ||
public string ApplicationHostname => HostHelper.GetName(); | ||
|
||
public bool IsInMaintenanceMode => false; | ||
|
||
public double TimeSpanFromSeconds => 60; | ||
|
||
public int WatcherConfigurationId { get; set; } | ||
|
||
public int ApplicationId { get; set; } | ||
} | ||
} |
Oops, something went wrong.