-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Allow managing persistence configurations and enable filters #2871
Conversation
@ghys Can you have a look at the REST part and let me know if that is a good design for the UI? |
I'll add more extensive test coverage to ensure that my refactoring are all correct. |
d0dba2d
to
b360c1f
Compare
c56d40c
to
d78ed90
Compare
Since you touch fairly important base - have a look on |
549e233
to
22e6de1
Compare
4bf6efe
to
78575a8
Compare
@splatch I enabled the |
Yes, I saw it and see you use it to throttle or limit writes to persistence stuff. It makes a lot of sense cause this can be used when multiple stores are used. My approach so far was focusing on use of profiles which worked for single persistence but not for all. I think there is still an area for improvement in excluding certain items, cause |
The two filters I added were already defined in the model, that's why I implemented them. If someone knows how to properly extend that, more filters can be added. Maybe something like |
@J-N-K I'm perfectly fine with your work, my stuff is sitting on OH 3.0.x fork, so I still have plenty of time to fight with 3.3 updates. ;-) |
8121a8f
to
f93e881
Compare
f93e881
to
a94fffb
Compare
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/is-there-a-way-to-limit-the-precision-of-number-items/141006/7 |
df77f51
to
e4cc100
Compare
e4cc100
to
df3bd28
Compare
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/profiling-results-using-jprofiler/143073/2 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-4-0-wishlist/142388/248 |
df3bd28
to
dfde419
Compare
@florian-h05 FYI. This is also lacking UI support and I don't have a good idea how this should look like. |
Thanks for the hint, I have also seen openhab/openhab-webui#1463. |
May the force be with you ! |
Best of luck! |
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
dfde419
to
5a17529
Compare
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.
Many thanks! I have just a few small comments below.
...del.persistence/src/org/openhab/core/model/persistence/internal/PersistenceModelManager.java
Show resolved
Hide resolved
...del.persistence/src/org/openhab/core/model/persistence/internal/PersistenceModelManager.java
Show resolved
Hide resolved
...del.persistence/src/org/openhab/core/model/persistence/internal/PersistenceModelManager.java
Show resolved
Hide resolved
...del.persistence/src/org/openhab/core/model/persistence/internal/PersistenceModelManager.java
Outdated
Show resolved
Hide resolved
.../org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/FilterCriteria.java
Outdated
Show resolved
Hide resolved
....core.persistence/src/main/java/org/openhab/core/persistence/dto/PersistenceStrategyDTO.java
Outdated
Show resolved
Hide resolved
...ab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceFilter.java
Outdated
Show resolved
Hide resolved
...ersistence/src/main/java/org/openhab/core/persistence/filter/PersistenceThresholdFilter.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
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.
Thanks again!
@J-N-K : What exactly is missing in current XText for persistence? |
Filters are already enabled (I think we need documentation for that). Currently there are two types of filters: value-based and time-based. If we would add more, then there would also be the need for XText support, but I think currently we are fine. |
Fine. |
Closes #1463. Refs openhab/openhab-core#2871. Refs openhab/openhab-core#3642. It is accessible from the add-on settings page and has both a design and a code tab. The design tab allows to set persistence strategies for Items, define cron strategies and set the default strategies. It does not duplicate names for (cron) persistence strategies and filters as well as configs for the same set of Items. All four filters provided by openHAB core (treshold, time, equals/not equals, include/exclude) can be configured. When the user removes a cron strategy or a filter, it is automatically removed from all configs so that there is no API failure (400 Bad Request). No code completion is not provided, but required attributes for filters are automatically set on save to avoid API failure (500 Internal Server Error). A few words about order and sorting: - openHAB Core seems to sort the cron strategies. - Configurations itself are unsorted, they could be sorted alphabetically by the UI. - Items of configuration are sorted by their type (groups before normal Items) as well as alphabetically. -- Signed-off-by: Florian Hotze <[email protected]> Co-authored-by: J-N-K <[email protected]>
…#2871) * Allow managing persistence configurations Signed-off-by: Jan N. Klug <[email protected]> GitOrigin-RevId: 2e00efc
Depends on #2994
Fixes #3590
The aim of this PR is to allow managing persistence service configurations via the REST API (UI).
To achieve this
PersistenceServiceConfigurationRegistry
has been introduced. It needs to add an own interface for the change listener because one class can't inherit twoRegistryChangeListener<T>
with different types and the persistence manager needs to listen to both, theItemRegistry
and thePersistenceServiceConfigurationRegistry
.PersistenceManager
interface has been removed.PersistenceManagerImpl
has been renamed toPersistenceManager
and makes use of the new registry.PersistenceModelManager
has been refactored to aPersistenceServiceConfigurationProvider
.ManagedPersistenceServiceConfigurationProvider
has been introduced.Signed-off-by: Jan N. Klug [email protected]