23
23
24
24
import org .apache .commons .logging .LogFactory ;
25
25
import org .jspecify .annotations .Nullable ;
26
- import org .neo4j .driver .NotificationClassification ;
26
+ import org .neo4j .driver .NotificationCategory ;
27
27
import org .neo4j .driver .NotificationSeverity ;
28
28
import org .neo4j .driver .summary .InputPosition ;
29
29
import org .neo4j .driver .summary .Notification ;
@@ -94,8 +94,8 @@ private static void logNotifications(ResultSummary resultSummary) {
94
94
Predicate <Notification > isDeprecationWarningForId ;
95
95
try {
96
96
isDeprecationWarningForId = notification -> supressIdDeprecations
97
- && notification .classification ()
98
- .orElse (NotificationClassification .UNRECOGNIZED ) == NotificationClassification .DEPRECATION
97
+ && notification .category ()
98
+ .orElse (NotificationCategory .UNRECOGNIZED ) == NotificationCategory .DEPRECATION
99
99
&& DEPRECATED_ID_PATTERN .matcher (notification .description ()).matches ();
100
100
}
101
101
finally {
@@ -107,7 +107,7 @@ private static void logNotifications(ResultSummary resultSummary) {
107
107
.stream ()
108
108
.filter (Predicate .not (isDeprecationWarningForId ))
109
109
.forEach (notification -> notification .severityLevel ().ifPresent (severityLevel -> {
110
- var category = notification .classification ().orElse (null );
110
+ var category = notification .category ().orElse (null );
111
111
112
112
var logger = getLogAccessor (category );
113
113
Consumer <String > logFunction ;
@@ -129,21 +129,35 @@ else if (severityLevel == NotificationSeverity.OFF) {
129
129
}));
130
130
}
131
131
132
- private static LogAccessor getLogAccessor (@ Nullable NotificationClassification category ) {
132
+ private static LogAccessor getLogAccessor (@ Nullable NotificationCategory category ) {
133
133
if (category == null ) {
134
134
return Neo4jClient .cypherLog ;
135
135
}
136
- return switch (category ) {
137
- case HINT -> cypherHintNotificationLog ;
138
- case DEPRECATION -> cypherDeprecationNotificationLog ;
139
- case PERFORMANCE -> cypherPerformanceNotificationLog ;
140
- case GENERIC -> cypherGenericNotificationLog ;
141
- case UNSUPPORTED -> cypherUnsupportedNotificationLog ;
142
- case UNRECOGNIZED -> cypherUnrecognizedNotificationLog ;
143
- case SECURITY -> cypherSecurityNotificationLog ;
144
- case TOPOLOGY -> cypherTopologyNotificationLog ;
145
- default -> Neo4jClient .cypherLog ;
146
- };
136
+ if (category .equals (NotificationCategory .HINT )) {
137
+ return cypherHintNotificationLog ;
138
+ }
139
+ else if (category .equals (NotificationCategory .DEPRECATION )) {
140
+ return cypherDeprecationNotificationLog ;
141
+ }
142
+ else if (category .equals (NotificationCategory .PERFORMANCE )) {
143
+ return cypherPerformanceNotificationLog ;
144
+ }
145
+ else if (category .equals (NotificationCategory .GENERIC )) {
146
+ return cypherGenericNotificationLog ;
147
+ }
148
+ else if (category .equals (NotificationCategory .UNSUPPORTED )) {
149
+ return cypherUnsupportedNotificationLog ;
150
+ }
151
+ else if (category .equals (NotificationCategory .UNRECOGNIZED )) {
152
+ return cypherUnrecognizedNotificationLog ;
153
+ }
154
+ else if (category .equals (NotificationCategory .SECURITY )) {
155
+ return cypherSecurityNotificationLog ;
156
+ }
157
+ else if (category .equals (NotificationCategory .TOPOLOGY )) {
158
+ return cypherTopologyNotificationLog ;
159
+ }
160
+ return Neo4jClient .cypherLog ;
147
161
}
148
162
149
163
/**
0 commit comments