Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,35 @@ namespace Particular.LicensingComponent.Report
public Particular.LicensingComponent.Report.AuditServicesData AuditServicesData { get; set; }
public System.Collections.Generic.Dictionary<string, string> EnvironmentData { get; set; }
}
public class LicenseAmendments : System.IEquatable<Particular.LicensingComponent.Report.LicenseAmendments>
{
public LicenseAmendments() { }
public Particular.LicensingComponent.Report.LicensedEndpointAmendment[] Endpoints { get; init; }
public Particular.LicensingComponent.Report.QueueIdentity[] ExcludedQueues { get; init; }
public Particular.LicensingComponent.Report.QueueIdentity[] InfrastructureQueues { get; init; }
public string[] RemovedEndpointNames { get; init; }
}
public class LicensedEndpointAmendment : System.IEquatable<Particular.LicensingComponent.Report.LicensedEndpointAmendment>
{
public LicensedEndpointAmendment() { }
public Particular.LicensingComponent.Report.QueueIdentity[] AmendedQueues { get; init; }
public string CurrentName { get; init; }
public string CurrentNameHash { get; init; }
public bool IsSendOnly { get; init; }
public string? PreviousName { get; init; }
public string? PreviousNameHash { get; init; }
public Particular.LicensingComponent.Report.QueueIdentity[] RemovedQueues { get; init; }
}
public class NoPrivateKeyException : System.Exception
{
public string ReportId { get; }
}
public class QueueIdentity : System.IEquatable<Particular.LicensingComponent.Report.QueueIdentity>
{
public QueueIdentity() { }
public string NameHash { get; init; }
public string? ScopeHash { get; init; }
}
public class QueueThroughput : System.IEquatable<Particular.LicensingComponent.Report.QueueThroughput>
{
public QueueThroughput() { }
Expand All @@ -41,6 +66,7 @@ namespace Particular.LicensingComponent.Report
public class Report : System.IEquatable<Particular.LicensingComponent.Report.Report>
{
public Report() { }
public Particular.LicensingComponent.Report.LicenseAmendments? CustomerLicenseAmendments { get; init; }
public string CustomerName { get; init; }
public System.DateTimeOffset EndTime { get; init; }
public Particular.LicensingComponent.Report.EnvironmentInformation EnvironmentInformation { get; set; }
Expand Down
115 changes: 115 additions & 0 deletions src/Particular.LicensingComponent.Report/Report.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public record Report
/// </summary>
public string[] IgnoredQueues { get; init; }

/// <summary>
/// Information, supplied by the customer, containing their suggested changes to the licensed endpoints and queue classifications
/// </summary>
public LicenseAmendments? CustomerLicenseAmendments { get; init; }

/// <summary>
/// Information about the environment, ie ServicePulse version, Audit instances versipns etc
/// </summary>
Expand Down Expand Up @@ -212,3 +217,113 @@ public record DailyThroughput
public record AuditServicesData(Dictionary<string, int> Versions, Dictionary<string, int> Transports)
{
}

/// <summary>
/// Information, supplied by the customer, containing their suggested changes to the licensed endpoints and queue classifications
/// </summary>
public record LicenseAmendments
{
/// <summary>
/// Information about amendments made to endpoints that were previously licensed
/// </summary>
public LicensedEndpointAmendment[] Endpoints { get; init; }

/// <summary>
/// A list of names for any endpoints that have been removed since the last license renewal
/// </summary>
public string[] RemovedEndpointNames { get; init; }

/// <summary>
/// A list of queues that have been marked as infrastructure since the last license renewal
/// </summary>
/// <remarks>
/// This list should only contain amendments on the last renewal, not the complete list of queues
/// </remarks>
public QueueIdentity[] InfrastructureQueues { get; init; }

/// <summary>
/// A list of queues that have been marked as excluded since the last license renewal
/// </summary>
/// <remarks>
/// This list should only contain amendments on the last renewal, not the complete list of queues
/// </remarks>
public QueueIdentity[] ExcludedQueues { get; init; }
}

/// <summary>
/// Minimal information required to uniquely identify a queue within a report
/// </summary>
public record QueueIdentity
{
/// <summary>
/// A hash of the queue name to support unique identification of queues across reports without exposing potentially sensitive information.
/// </summary>
/// <remarks>
/// This should be a one-way hash of the unmasked queue name.
/// </remarks>
public string NameHash { get; init; }

/// <summary>
/// A hash of the scope to support unique identification of queues across reports without exposing potentially sensitive information.
/// </summary>
/// <remarks>
/// This should be a one-way hash of the unmasked scope, if it exists.
/// </remarks>
public string? ScopeHash { get; init; }
}

/// <summary>
/// Information about amendments made to an endpoints that was previously licensed, or information about a newly created endpoint since the last license renewal
/// </summary>
public record LicensedEndpointAmendment
{
/// <summary>
/// What this endpoint was named in the previous license renewal, if it existed then
/// </summary>
public string? PreviousName { get; init; }

/// <summary>
/// A hash of the previous endpoint name to support unique identification across reports without exposing potentially sensitive information.
/// </summary>
/// <remarks>
/// This should be a one-way hash of the unmasked endpoint name.
/// </remarks>
public string? PreviousNameHash { get; init; }

/// <summary>
/// What this endpoint has been named by the user.
/// </summary>
/// <remarks>
/// If no change from last license renewal, this will be the same as PreviousName
/// </remarks>
public string CurrentName { get; init; }

/// <summary>
/// A hash of the endpoint name to support unique identification across reports without exposing potentially sensitive information.
/// </summary>
/// <remarks>
/// This should be a one-way hash of the unmasked endpoint name.
/// </remarks>
public string CurrentNameHash { get; init; }

/// <summary>
/// What the classification of this endpoint has been set to by the user
/// </summary>
public bool IsSendOnly { get; init; }

/// <summary>
/// Any queues that have been added to this endpoint since the last renewal
/// </summary>
/// <remarks>
/// This list should only contain amendments on the last renewal, not the complete list of queues
/// </remarks>
public QueueIdentity[] AmendedQueues { get; init; }

/// <summary>
/// Any queues that have been removed from this endpoint since the last renewal
/// </summary>
/// <remarks>
/// This list should only contain amendments on the last renewal, not the complete list of queues
/// </remarks>
public QueueIdentity[] RemovedQueues { get; init; }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that endpoints have removed queues, but there is no RemovedInfrastructureQueues or RemovedExcludedQueues as part of the main LicenseAmendments object. The reason for this is if a customer removes a queue from one of these lists, but doesn't assign it to an endpoint and merely leaves it in unassigned, then the only action we'd take anyway is to place that queue back in the list it was in the previous renewal.

}
Loading