How to call the gateway by java, not from cloud?

I have Digi X4 Ethernet gateway(wifi) with smartplug and sensor.

Is there a way to call the gatway using java? Not using the Digi cloud and ESP?

Cause I want to write a program is that "depends on the level of brightness from the sensor, the smartplug turn on/off automatically "

Thank you for your answer.

The Developer Wiki might be a good place to start in that it has various examples of data extraction: