thermostat server rewritten in java