Skip to content

Commit 360d30e

Browse files
committed
refactor: Added the queryName to the browse request interceptor interface.
1 parent 7ff483d commit 360d30e

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

RELEASE_NOTES

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Incompatible changes
2020
Java 17 to allow alternate driver implementations to support
2121
Java 17.
2222
- Updated the signature of the PlcBrowseRequestInterceptor to
23-
also accept a tag and item instead of just an item.
23+
also accept a queryName, query and item instead of just an
24+
item.
2425

2526
Bug Fixes
2627
---------

plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcBrowseRequestInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222

2323
public interface PlcBrowseRequestInterceptor {
2424

25-
boolean intercept(PlcQuery query, PlcBrowseItem item);
25+
boolean intercept(String queryName, PlcQuery query, PlcBrowseItem item);
2626

2727
}

plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/protocol/AdsProtocolLogic.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ public void onDisconnect(ConversationContext<AmsTCPPacket> context) {
492492

493493
@Override
494494
public CompletableFuture<PlcBrowseResponse> browse(PlcBrowseRequest browseRequest) {
495-
return browseWithInterceptor(browseRequest, (query, item) -> true);
495+
return browseWithInterceptor(browseRequest, (queryName, query, item) -> true);
496496
}
497497

498498
public CompletableFuture<PlcBrowseResponse> browseWithInterceptor(PlcBrowseRequest browseRequest, PlcBrowseRequestInterceptor interceptor) {
@@ -540,7 +540,7 @@ public CompletableFuture<PlcBrowseResponse> browseWithInterceptor(PlcBrowseReque
540540
true, !symbol.getFlagReadOnly(), true, false, itemArrayInfo, childMap, options);
541541

542542
// Check if this item should be added to the result
543-
if (interceptor.intercept(query, item)) {
543+
if (interceptor.intercept(queryName, query, item)) {
544544
// Add the type itself.
545545
resultsForQuery.add(item);
546546
}

plc4j/drivers/ads/src/test/java/org/apache/plc4x/protocol/ads/ManualAdsBrowse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static void main(String[] args) throws Exception {
3131
PlcBrowseResponse plcBrowseResponse = connection.browseRequestBuilder()
3232
//.addQuery("all", "**")
3333
.addQuery("allMain", "MAIN.*")
34-
.build().executeWithInterceptor((tag, item) -> {
34+
.build().executeWithInterceptor((gueryName, query, item) -> {
3535
outputItem(item, 0);
3636
return true;
3737
}).get();

plc4j/drivers/ctrlx/src/main/java/org/apache/plc4x/java/ctrlx/readwrite/connection/CtrlXConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public CompletableFuture<PlcPingResponse> ping(PlcPingRequest pingRequest) {
205205

206206
@Override
207207
public CompletableFuture<PlcBrowseResponse> browse(PlcBrowseRequest browseRequest) {
208-
return browseWithInterceptor(browseRequest, (query, item) -> true);
208+
return browseWithInterceptor(browseRequest, (queryName,query, item) -> true);
209209
}
210210

211211
@Override

protocols/bacnetip/src/test/java/org/apache/plc4x/protocol/bacnetip/ObjectPropertyDeDuplicationTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
import org.apache.plc4x.plugins.codegenerator.types.fields.ValidationField;
2828
import org.junit.jupiter.api.*;
2929
import org.opentest4j.TestAbortedException;
30-
import org.slf4j.Logger;
31-
import org.slf4j.LoggerFactory;
3230

3331
import java.util.*;
3432
import java.util.regex.Matcher;

0 commit comments

Comments
 (0)