Skip to content

Commit

Permalink
Added duplex port to HTTP meta, which now allows complete bootstrappi…
Browse files Browse the repository at this point in the history
…ng (#323)
  • Loading branch information
climategadgets committed Aug 27, 2024
1 parent 45144a0 commit 9788700
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import net.sf.dz3r.runtime.config.mqtt.MqttConfigurationParser;
import net.sf.dz3r.runtime.config.onewire.OnewireConfigurationParser;
import net.sf.dz3r.runtime.config.schedule.ScheduleConfigurationParser;
import net.sf.dz3r.view.webui.v2.WebUI;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -199,6 +200,7 @@ private EndpointMeta renderMeta(HccRawConfig source, String digest) throws IOExc
source.instance(),
InstanceIdProvider.getId(),
digest,
Optional.ofNullable(source.webUi().duplexPort()).orElse(WebUI.DEFAULT_PORT_DUPLEX),
new SimpleClientMeta(
zones,
devices
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package com.homeclimatecontrol.hcc.meta;

import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;

/**
* The top level metadata the client will see.
*
* @param version Version for the clients to determine compatibility.
* @param protocolVersion Version for the clients to determine compatibility.
* @param type Endpoint type. Always {@link Type#DIRECT} for the actual HCC instance.
* @param instance Instance metadata.
*
* @author Copyright &copy; <a href="mailto:[email protected]">Vadim Tkachenko</a> 2001-2023
*/
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy.class)
public record EndpointMeta(
String version,
String protocolVersion,
Type type,
InstanceMeta instance
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @param name Instance name, taken from {@code HccRawConfig#instance}.
* @param id Persistent unique system ID.
* @param configDigest Current parsed (not source) configuration message digest.
* @param duplexPort Port to conduct RSocket communications on.
* @param simple Simple UI metadata.
* @param full Full control metadata.
*
Expand All @@ -24,6 +25,7 @@ public record InstanceMeta(
String name,
UUID id,
String configDigest,
int duplexPort,
SimpleClientMeta simple,
InstrumentClusterMeta full
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private void advertise() {
"path", META_PATH, // http://www.dns-sd.org/txtrecords.html#http
"protocol-version", Version.PROTOCOL_VERSION,

"duplex", Integer.toString(config.duplexPort),
"duplex-port", Integer.toString(config.duplexPort),
"type",DIRECT.toString().toLowerCase(),

"name", config.instance,
Expand Down

0 comments on commit 9788700

Please sign in to comment.