-
Notifications
You must be signed in to change notification settings - Fork 137
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
JDBC backend search filter for listing only devices or only gateways #3518
JDBC backend search filter for listing only devices or only gateways #3518
Conversation
Sonatype Lift is retiringSonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. |
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.
Can you also please rebase the PR?
site/documentation/content/api/management/device-registry-v1.yaml
Outdated
Show resolved
Hide resolved
The branch is rebased |
hmm, GitHub still seems to believe that there are conflicts with the main branch that need to be resolved ... |
fc33987
to
5921cc9
Compare
rebase should be ok now |
core/src/main/java/org/eclipse/hono/util/RegistryManagementConstants.java
Outdated
Show resolved
Hide resolved
...jdbc/src/main/java/org/eclipse/hono/service/base/jdbc/store/device/TableManagementStore.java
Outdated
Show resolved
Hide resolved
site/documentation/content/api/management/device-registry-v1.yaml
Outdated
Show resolved
Hide resolved
...jdbc/src/main/java/org/eclipse/hono/service/base/jdbc/store/device/TableManagementStore.java
Show resolved
Hide resolved
...ain/java/org/eclipse/hono/deviceregistry/service/device/AbstractDeviceManagementService.java
Outdated
Show resolved
Hide resolved
...ain/java/org/eclipse/hono/deviceregistry/service/device/AbstractDeviceManagementService.java
Outdated
Show resolved
Hide resolved
...y-base/src/main/java/org/eclipse/hono/service/management/device/DeviceManagementService.java
Outdated
Show resolved
Hide resolved
.../java/org/eclipse/hono/service/management/device/DelegatingDeviceManagementHttpEndpoint.java
Outdated
Show resolved
Hide resolved
.../java/org/eclipse/hono/service/management/device/DelegatingDeviceManagementHttpEndpoint.java
Show resolved
Hide resolved
...a/org/eclipse/hono/service/management/device/DelegatingDeviceManagementHttpEndpointTest.java
Outdated
Show resolved
Hide resolved
...dbc/src/main/java/org/eclipse/hono/deviceregistry/jdbc/impl/DeviceManagementServiceImpl.java
Outdated
Show resolved
Hide resolved
service-base/src/main/java/org/eclipse/hono/service/http/AbstractHttpEndpoint.java
Show resolved
Hide resolved
service-base/src/main/java/org/eclipse/hono/service/http/AbstractHttpEndpoint.java
Outdated
Show resolved
Hide resolved
.../src/main/resources/org/eclipse/hono/service/base/jdbc/store/device/base.postgresql.sql.yaml
Show resolved
Hide resolved
@gdimitropoulos-sotec before we go on with this review: I appreciate all the effort you have put into this PR so far. However, the longer I think about the changes you have introduced, the less I am convinced that this is the right way to address the issue. The JSON functions used in the queries in conjunction with regex based replace functions etc all indicate to me that these queries will have quite substantial execution times while Hono's protocol adapters themselves do not need any of this functionality. I guess what I am trying to say is that I believe that without substantial changes to the underlying database schema, in particular replacing the In addition, I am also no longer convinced that adding a separate query parameter {
"field": "is-gateway",
"op": "eq",
"value": "true"
} this might require special handling when parsing the query but it should make the overall user experience more convenient. Another approach that I can think of could be to define a query view on top the device and tenant tables which could produce this synthetic property and then run the queries against the view ... WDYT? |
Hi @sophokles73: We thought of this as well and agree with you in terms of general usability. We came to the conclustion that we want to accomplish this with changing the jdbc database schema in a new issue. |
@gdimitropoulos-sotec what's your opinion on this? |
Hello @sophokles73 I agree with Julian. We have discussed this together with Julian and the team and we agree, that will be better, to have a separate table to hold the relationships between a gateway and devices (instead of the "Via" attribute). |
This implementation seems to take into consideration only the This applies also to the |
@gdimitropoulos-sotec are you working on this? |
Hello @sophokles73 I just resolved all comments. From our side, we wait until the branch is merged. |
- add optional parameter "isGateway" - functionality for listing only devices or gateways - add documentation Also-by: Matthias Feurer [email protected] Signed-off-by: g.dimitropoulos <[email protected]>
fa7de2e
to
ee04d53
Compare
@gdimitropoulos-sotec sorry, but it doesn't look like you have changed any code at all. Can you double check? |
Also-by: Matthias Feurer [email protected] Signed-off-by: georgios dimitropoulos <[email protected]>
Hello, I am very sorry about that. I am trying to find my commit from yesterday but I can't. I just made a new commit with all the changes. |
Hi @sophokles73, I fix all the issues from review comments, can this PR be merged? |
...jdbc/src/main/java/org/eclipse/hono/service/base/jdbc/store/device/TableManagementStore.java
Outdated
Show resolved
Hide resolved
site/documentation/content/api/management/device-registry-v1.yaml
Outdated
Show resolved
Hide resolved
...jdbc/src/main/java/org/eclipse/hono/service/base/jdbc/store/device/TableManagementStore.java
Show resolved
Hide resolved
...va/org/eclipse/hono/service/management/device/AbstractDeviceManagementSearchDevicesTest.java
Show resolved
Hide resolved
Also-by: Matthias Feurer [email protected] Signed-off-by: georgios dimitropoulos <[email protected]>
Hi @sophokles73 thank you for your comments. The "isGateway" is documented in both the JavaDoc and device-registry-v1.yaml file. |
...jdbc/src/main/java/org/eclipse/hono/service/base/jdbc/store/device/TableManagementStore.java
Show resolved
Hide resolved
...va/org/eclipse/hono/service/management/device/AbstractDeviceManagementSearchDevicesTest.java
Outdated
Show resolved
Hide resolved
Also-by: Matthias Feurer [email protected] Signed-off-by: georgios dimitropoulos <[email protected]>
Hi @sophokles73, I understand if the isGateway is documented. I changed the documentation so that is clear if the parameter isGateway is used then the parameter filter will be ignored. |
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.
LGTM
Hono Issue for PR
Based on PR
Implement gateway filter for JDBC (H2 & Postgresql) device registry:
Also-by: Matthias Feurer [email protected]
Signed-off-by: g.dimitropoulos [email protected]