Skip to content

Commit

Permalink
Add SCHEMA notification type (#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardIrons-neo4j authored Aug 22, 2024
1 parent 4175d8e commit fe97662
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 10 deletions.
2 changes: 2 additions & 0 deletions Neo4j.Driver/Neo4j.Driver.Tests/ConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ public void WithTlsNegotiatorGeneric_ShouldSetTlsNegotiator()
[InlineData(Classification.Deprecation, Category.Deprecation)]
[InlineData(Classification.Security, Category.Security)]
[InlineData(Classification.Topology, Category.Topology)]
[InlineData(Classification.Schema, Category.Schema)]
[InlineData(Classification.Generic, Category.Generic)]
public void WithNotifications_ShouldSetCategoryWithClassification(
Classification classification,
Expand Down Expand Up @@ -281,6 +282,7 @@ public void WithNotifications_ShouldSetCategoryWithClassification(
[InlineData(Category.Deprecation, Category.Deprecation)]
[InlineData(Category.Security, Category.Security)]
[InlineData(Category.Topology, Category.Topology)]
[InlineData(Category.Schema, Category.Schema)]
[InlineData(Category.Generic, Category.Generic)]
public void WithNotifications_ShouldSetCategory(
Category inCat,
Expand Down
2 changes: 2 additions & 0 deletions Neo4j.Driver/Neo4j.Driver.Tests/SessionConfigBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class SessionConfigBuilderTests
[InlineData(Classification.Deprecation, Category.Deprecation)]
[InlineData(Classification.Security, Category.Security)]
[InlineData(Classification.Topology, Category.Topology)]
[InlineData(Classification.Schema, Category.Schema)]
[InlineData(Classification.Generic, Category.Generic)]
public void WithNotifications_ShouldSetCategoryWithClassification(
Classification classification,
Expand Down Expand Up @@ -62,6 +63,7 @@ public void WithNotifications_ShouldSetCategoryWithClassification(
[InlineData(Category.Deprecation, Category.Deprecation)]
[InlineData(Category.Security, Category.Security)]
[InlineData(Category.Topology, Category.Topology)]
[InlineData(Category.Schema, Category.Schema)]
[InlineData(Category.Generic, Category.Generic)]
public void WithNotifications_ShouldSetCategory(
Category inCat,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ private NotificationClassification ClassificationFrom(string rawClassification)
"deprecation" => NotificationClassification.Deprecation,
"security" => NotificationClassification.Security,
"topology" => NotificationClassification.Topology,
"schema" => NotificationClassification.Schema,
"generic" => NotificationClassification.Generic,
_ => NotificationClassification.Unknown
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private NotificationCategory ParseCategory(string category)
"deprecation" => NotificationCategory.Deprecation,
"security" => NotificationCategory.Security,
"topology" => NotificationCategory.Topology,
"schema" => NotificationCategory.Schema,
"generic" => NotificationCategory.Generic,
_ => NotificationCategory.Unknown
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ public enum NotificationCategory
Security,

/// <summary>
/// Topology notifications provide additional information related to managing databases and servers.
/// Information provided while executing database and server related commands.
/// </summary>
Topology,

/// <summary>
/// Information provided while managing indexes and constraints.
/// </summary>
Schema,

/// <summary>Notification not covered by other categories.</summary>
Generic
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public enum NotificationClassification
/// </summary>
Topology,

/// <summary>
/// Schema notifications provide additional information related to managing indexes and constraints.
/// </summary>
Schema,

/// <summary>Notification not covered by other categories.</summary>
Generic
}
4 changes: 4 additions & 0 deletions Neo4j.Driver/Neo4j.Driver/Public/Types/Category.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public enum Category
/// <remarks>Returned as <see cref="NotificationCategory.Topology"/></remarks>
Topology,

/// <summary> Receive notifications related to managing indexes and constraints.</summary>
/// <remarks>Returned as <see cref="NotificationCategory.Schema"/></remarks>
Schema,

/// <summary>Receive notifications not covered by other categories.</summary>
/// <remarks>Returned as <see cref="NotificationCategory.Generic"/></remarks>
Generic
Expand Down
24 changes: 15 additions & 9 deletions Neo4j.Driver/Neo4j.Driver/Public/Types/Classification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public enum Classification
{
/// <summary>Receive notifications when a hint in query cannot be satisfied.</summary>
/// <remarks>
/// Returned as <see cref="NotificationClassification.Hint"/> in <see cref="IGqlStatusObject.Classification"/> as
/// <see cref="NotificationCategory.Hint"/> in <see cref="INotification.Category"/>.
/// Returned as <see cref="NotificationClassification.Hint"/> in <see cref="IGqlStatusObject.Classification"/> and
/// as <see cref="NotificationCategory.Hint"/> in <see cref="INotification.Category"/>.
/// </remarks>
Hint,

/// <summary>Receive notifications when a query or command mentions entities that are unknown to the system.</summary>
/// <remarks>
/// Returned as <see cref="NotificationClassification.Unrecognized"/> in
/// <see cref="IGqlStatusObject.Classification"/> as <see cref="NotificationCategory.Unrecognized"/> in
/// <see cref="IGqlStatusObject.Classification"/> and as <see cref="NotificationCategory.Unrecognized"/> in
/// <see cref="INotification.Category"/>.
/// </remarks>
Unrecognized,
Expand All @@ -49,45 +49,51 @@ public enum Classification
/// </summary>
/// <remarks>
/// Returned as <see cref="NotificationClassification.Unsupported"/> in
/// <see cref="IGqlStatusObject.Classification"/> as <see cref="NotificationCategory.Unsupported"/> in
/// <see cref="IGqlStatusObject.Classification"/> and as <see cref="NotificationCategory.Unsupported"/> in
/// <see cref="INotification.Category"/>.
/// </remarks>
Unsupported,

/// <summary>Receive notifications when a query uses costly operations and might be slow.</summary>
/// <remarks>
/// Returned as <see cref="NotificationClassification.Performance"/> in
/// <see cref="IGqlStatusObject.Classification"/> as <see cref="NotificationCategory.Performance"/> in
/// <see cref="IGqlStatusObject.Classification"/> and as <see cref="NotificationCategory.Performance"/> in
/// <see cref="INotification.Category"/>.
/// </remarks>
Performance,

/// <summary>Receive notifications when a query/command use deprecated features that should be replaced.</summary>
/// <remarks>
/// Returned as <see cref="NotificationClassification.Deprecation"/> in
/// <see cref="IGqlStatusObject.Classification"/> as <see cref="NotificationCategory.Deprecation"/> in
/// <see cref="IGqlStatusObject.Classification"/> and as <see cref="NotificationCategory.Deprecation"/> in
/// <see cref="INotification.Category"/>.
/// </remarks>
Deprecation,

/// <summary>Receive notifications when the result of the query or command indicates a potential security issue.</summary>
/// <remarks>
/// Returned as <see cref="NotificationClassification.Security"/> in <see cref="IGqlStatusObject.Classification"/>
/// as <see cref="NotificationCategory.Security"/> in <see cref="INotification.Category"/>.
/// and as <see cref="NotificationCategory.Security"/> in <see cref="INotification.Category"/>.
/// </remarks>
Security,

/// <summary>Receive notifications related to managing databases and servers.</summary>
/// <remarks>
/// Returned as <see cref="NotificationClassification.Topology"/> in <see cref="IGqlStatusObject.Classification"/>
/// as <see cref="NotificationCategory.Topology"/> in <see cref="INotification.Category"/>.
/// and as <see cref="NotificationCategory.Topology"/> in <see cref="INotification.Category"/>.
/// </remarks>
Topology,

/// <summary>Receive notifications related to managing indexes and constraints.</summary>
/// <remarks> Returned as <see cref="NotificationClassification.Schema"/> in <see cref="IGqlStatusObject.Classification"/>
/// and as <see cref="NotificationCategory.Schema"/> in <see cref="INotification.Category"/>.
/// </remarks>
Schema,

/// <summary>Receive notifications not covered by other categories.</summary>
/// <remarks>
/// Returned as <see cref="NotificationClassification.Generic"/> in <see cref="IGqlStatusObject.Classification"/>
/// as <see cref="NotificationCategory.Generic"/> in <see cref="INotification.Category"/>.
/// and as <see cref="NotificationCategory.Generic"/> in <see cref="INotification.Category"/>.
/// </remarks>
Generic
}

0 comments on commit fe97662

Please sign in to comment.