Skip to content

Commit

Permalink
stip "lastModified" timestamp from QueryThingResponses (which was onl…
Browse files Browse the repository at this point in the history
…y required for new search cutover and was filtered away in old concierge)

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
  • Loading branch information
thjaeckle committed Jun 22, 2022
1 parent e1d0c68 commit 99df1d8
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public Receive createReceive() {
// shortcuts: we don't have to look up the things
// - for no search results
// - if only the "thingId" was selected in the QueryThings commands
originatingSender.tell(qtr, getSelf());
originatingSender.tell(stripLastModifiedTimestampFromSearchResult(qtr), getSelf());
stopMyself();
} else {
final Optional<JsonFieldSelector> selectedFieldsWithThingId = getSelectedFieldsWithThingId();
Expand Down Expand Up @@ -166,6 +166,15 @@ public Receive createReceive() {
.build();
}

private static QueryThingsResponse stripLastModifiedTimestampFromSearchResult(
final QueryThingsResponse queryThingsResponse) {

return queryThingsResponse.setEntity(queryThingsResponse.getSearchResult().toBuilder()
.lastModified(null)
.build()
.toJson());
}

private boolean queryThingsOnlyContainsThingIdSelector() {
final Optional<JsonFieldSelector> fields = queryThings.getFields();
return fields.isPresent() && fields.get().getPointers()
Expand Down

0 comments on commit 99df1d8

Please sign in to comment.