Skip to content

Commit

Permalink
Remove ExportRequestType enum and replace with a list of plug-in asse…
Browse files Browse the repository at this point in the history
…mbly names

Signed-off-by: Victor Chang <[email protected]>
  • Loading branch information
mocsharp committed Aug 4, 2023
1 parent 70c3f01 commit 1b2122a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 40 deletions.
23 changes: 0 additions & 23 deletions src/Messaging/Common/ExportRequestType.cs

This file was deleted.

10 changes: 0 additions & 10 deletions src/Messaging/Events/ExportCompleteEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

using System.ComponentModel.DataAnnotations;
using Ardalis.GuardClauses;
using Monai.Deploy.Messaging.Common;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

Expand Down Expand Up @@ -58,15 +57,6 @@ public class ExportCompleteEvent : EventBase
[JsonProperty(PropertyName = "file_statuses")]
public Dictionary<string, FileExportStatus> FileStatuses { get; set; }

/// <summary>
/// Gets or set the ExportRequest type.
/// For standard exports this will be ExportRequestType.None
/// but for exports to external apps this will be ExportRequestType.ExternalProcessing
/// </summary>
[JsonProperty(PropertyName = "export_request")]
[Required]
public ExportRequestType ExportRequest { get; set; } = default!;

[JsonConstructor]
public ExportCompleteEvent()
{
Expand Down
13 changes: 6 additions & 7 deletions src/Messaging/Events/ExportRequestEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

using System.ComponentModel.DataAnnotations;
using Monai.Deploy.Messaging.Common;
using Newtonsoft.Json;

namespace Monai.Deploy.Messaging.Events
Expand Down Expand Up @@ -77,17 +76,17 @@ public class ExportRequestEvent : EventBase
public List<string> ErrorMessages { get; private set; }

/// <summary>
/// Gets or set the ExportRequest type.
/// For standard exports this will be ExportRequestType.None
/// but for exports to external apps this will be ExportRequestType.ExternalProcessing
/// A list of data output plug-in type names to be executed by the export services.
/// Each string must be a fully-qualified type name.
/// E.g. <code>MyCompnay.MyProject.MyNamepsace.MyPlugin, MyCompnay.MyProject.MyNamepsace</code> where
/// <code>MyCompnay.MyProject.MyNamepsace</code> is the name of the assembly (DLL).
/// </summary>
[JsonProperty(PropertyName = "export_request")]
[Required]
public ExportRequestType ExportRequest { get; set; } = default!;
public List<string> PluginAssemblies { get; private set; }

public ExportRequestEvent()
{
ErrorMessages = new List<string>();
PluginAssemblies = new List<string>();
}

public void AddErrorMessages(IList<string> errorMessages)
Expand Down
3 changes: 3 additions & 0 deletions src/Messaging/Tests/IServiceCollectionExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ internal class GoodSubscriberService : IMessageBrokerSubscriberService
{
public string Name => throw new NotImplementedException();

#pragma warning disable CS0067 // The event 'GoodSubscriberService.OnConnectionError' is never used
// event used by users of this library
public event ConnectionErrorHandler? OnConnectionError;
#pragma warning restore CS0067 // The event 'GoodSubscriberService.OnConnectionError' is never used

public void Acknowledge(MessageBase message) => throw new NotImplementedException();

Expand Down

0 comments on commit 1b2122a

Please sign in to comment.