Which ways exists to get the current state of a device with Java

The best thing would be that the state.json file would be updated after every change. But it doesn’t.

So I know that you can subscribe to the topic.

I want a tomcat webserver to show the current state.

So the state could be updated when the webserver isn’t listening to the topic.

Are the other ways?

Thanks for your help:D