-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
context source implementation for query entities #1282
context source implementation for query entities #1282
Conversation
<ID>LongMethod:EntityHandler.kt$EntityHandler$@GetMapping("/{entityId}", produces = [APPLICATION_JSON_VALUE, JSON_LD_CONTENT_TYPE, GEO_JSON_CONTENT_TYPE]) suspend fun getByURI( @RequestHeader httpHeaders: HttpHeaders, @PathVariable entityId: URI, @AllowedParameters( implemented = [ QP.OPTIONS, QP.TYPE, QP.ATTRS, QP.GEOMETRY_PROPERTY, QP.LANG, QP.CONTAINED_BY, QP.JOIN, QP.JOIN_LEVEL, QP.DATASET_ID, ], notImplemented = [QP.FORMAT, QP.PICK, QP.OMIT, QP.ENTITY_MAP, QP.LOCAL, QP.VIA] ) @RequestParam queryParams: MultiValueMap<String, String> ): ResponseEntity<*></ID> | ||
<ID>LongMethod:EntityHandler.kt$EntityHandler$@GetMapping(produces = [APPLICATION_JSON_VALUE, JSON_LD_CONTENT_TYPE, GEO_JSON_CONTENT_TYPE]) suspend fun getEntities( @RequestHeader httpHeaders: HttpHeaders, @AllowedParameters( implemented = [ QP.OPTIONS, QP.COUNT, QP.OFFSET, QP.LIMIT, QP.ID, QP.TYPE, QP.ID_PATTERN, QP.ATTRS, QP.Q, QP.GEOMETRY, QP.GEOREL, QP.COORDINATES, QP.GEOPROPERTY, QP.GEOMETRY_PROPERTY, QP.LANG, QP.SCOPEQ, QP.CONTAINED_BY, QP.JOIN, QP.JOIN_LEVEL, QP.DATASET_ID, ], notImplemented = [QP.FORMAT, QP.PICK, QP.OMIT, QP.EXPAND_VALUES, QP.CSF, QP.ENTITY_MAP, QP.LOCAL, QP.VIA] ) @RequestParam queryParams: MultiValueMap<String, String> ): ResponseEntity<*></ID> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solution for this is to put csr related calculation into its own layer.
Should i do it in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will also be cleaner, the handlers are getting hard to read with all the CSR stuff in them.
preferably in another PR (just after this one is merged)
Test Results 69 files ± 0 69 suites ±0 1m 20s ⏱️ -11s Results for commit 9ab1be9. ± Comparison against base commit 22a8d72. This pull request removes 191 and adds 45 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
search-service/src/main/kotlin/com/egm/stellio/search/entity/web/EntityHandler.kt
Outdated
Show resolved
Hide resolved
search-service/src/main/kotlin/com/egm/stellio/search/entity/web/EntityHandler.kt
Show resolved
Hide resolved
search-service/src/main/kotlin/com/egm/stellio/search/entity/web/EntityHandler.kt
Outdated
Show resolved
Hide resolved
search-service/src/main/kotlin/com/egm/stellio/search/entity/web/EntityHandler.kt
Outdated
Show resolved
Hide resolved
...rvice/src/main/kotlin/com/egm/stellio/search/csr/service/ContextSourceRegistrationService.kt
Outdated
Show resolved
Hide resolved
search-service/src/main/kotlin/com/egm/stellio/search/csr/service/ContextSourceCaller.kt
Show resolved
Hide resolved
search-service/src/main/kotlin/com/egm/stellio/search/csr/service/ContextSourceCaller.kt
Outdated
Show resolved
Hide resolved
search-service/src/main/kotlin/com/egm/stellio/search/csr/service/ContextSourceUtils.kt
Outdated
Show resolved
Hide resolved
search-service/src/main/kotlin/com/egm/stellio/search/csr/service/ContextSourceUtils.kt
Show resolved
Hide resolved
search-service/src/test/resources/ngsild/csr/contextSourceRegistration_minimal_entities.json
Show resolved
Hide resolved
|
@@ -49,22 +105,23 @@ object ContextSourceCaller { | |||
.path(uri.path) | |||
.queryParams(queryParams) | |||
.build() | |||
}.headers { newHeaders -> | |||
httpHeaders.getOrNone(HttpHeaders.LINK).onSome { link -> newHeaders[HttpHeaders.LINK] = link } | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous implementation was sending the Link header to the contextSource even if it received a null.
This implementation prevent this.
search-service/src/test/kotlin/com/egm/stellio/search/csr/service/ContextSourceCallerTests.kt
Outdated
Show resolved
Hide resolved
search-service/src/main/kotlin/com/egm/stellio/search/csr/service/ContextSourceCaller.kt
Outdated
Show resolved
Hide resolved
search-service/src/main/kotlin/com/egm/stellio/search/csr/service/ContextSourceCaller.kt
Outdated
Show resolved
Hide resolved
search-service/src/main/kotlin/com/egm/stellio/search/csr/service/ContextSourceCaller.kt
Outdated
Show resolved
Hide resolved
search-service/src/main/kotlin/com/egm/stellio/search/csr/service/ContextSourceCaller.kt
Outdated
Show resolved
Hide resolved
c50ee39
to
7d4294a
Compare
Co-authored-by: Benoit Orihuela <[email protected]> Co-authored-by: Ranim Naimi <[email protected]>
7d4294a
to
9ab1be9
Compare
Quality Gate passedIssues Measures |
No description provided.