Class SdcProviderDispatcher

java.lang.Object
com.framed.core.Service
com.framed.io.dispatch.Dispatcher
com.framed.interop.sdc.SdcProviderDispatcher

public final class SdcProviderDispatcher extends Dispatcher
Outbound IEEE 11073 SDC sink (SdcProviderDispatcher, INTEROP_PLAN Step 3 Phase B): exposes FRAMED as a BICEPS provider whose MDIB mirrors the mapped channels, so any SDC consumer can discover the device over WS-Discovery, read the MDIB and subscribe to episodic metric reports and waveform streams (MDPWS/WS-Eventing, via SDCri).

MDIB shape. One MDS ("framed.mds"); per configured device group one VMD and one channel; one metric descriptor per mapped FRAMED channel, created on the first datapoint that flows (so device-agnostic mapping keys and late-announced channels work): mapping kind metric/setting becomes a numeric or string metric (BICEPS metric category MSRMT/SET), waveform becomes a real-time sample array. Descriptors carry a coded type only when the mapping assigns an mdc nomenclature code (never a guessed one); units are encoded as UCUM (http://unitsofmeasure.org).

Cadence. Waveform samples bypass the EmissionGate — SDC's waveform streams are designed for device rate — and are buffered into sample arrays of waveformChunkSize values. Metrics and settings pass the gate like every other interop bridge.

Threading. All MDIB writes happen on the single Dispatcher push worker; SDCri handles report fan-out on its own executors, so the bus handler thread never blocks.

Security. This phase binds plain HTTP (no TLS). Productive SDC deployments require the MDPWS security profile; wiring CryptoConfig is deferred to INTEROP_PLAN Step 3 Phase D and must be addressed before any clinical use.

  • Constructor Details

    • SdcProviderDispatcher

      public SdcProviderDispatcher(EventBus eventBus, org.json.JSONArray devices, String mappingPath, String epr, String iface, double waveformSamplePeriodMs, double waveformChunkSize, org.json.JSONObject gate)
      Config-loadable constructor. Starts the DPWS stack and the SDC device immediately.
      Parameters:
      eventBus - the event bus
      devices - device groups whose announced channels are forwarded
      mappingPath - path to the interop mapping JSON (mdc/kind aware)
      epr - device endpoint reference; empty generates a random urn:uuid
      iface - network interface name to bind (e.g. eth0); empty binds the loopback interface
      waveformSamplePeriodMs - declared sample period of waveform channels, in milliseconds
      waveformChunkSize - samples buffered per emitted real-time sample array
      gate - emission gate config for metrics/settings (onChange, minIntervalMs)
  • Method Details

    • push

      public void push(DataPoint<?> dataPoint) throws IOException
      Description copied from class: Dispatcher
      Pushes a single datapoint to the underlying sink.

      Invoked on the dispatcher's worker thread. Implementations may throw IOException to signal a transient failure, which triggers retry with exponential backoff.

      Specified by:
      push in class Dispatcher
      Parameters:
      dataPoint - the datapoint to push
      Throws:
      IOException - if the push fails due to a transient IO error and should be retried
    • pushBatch

      public void pushBatch(List<DataPoint<?>> batch)
      Description copied from class: Dispatcher
      Pushes a batch of datapoints to the underlying sink.
      Specified by:
      pushBatch in class Dispatcher
      Parameters:
      batch - the datapoints to push
    • stop

      public void stop()
      Description copied from class: Service
      Stops the service.

      By default, this method logs a message indicating that no stop logic is implemented. Subclasses should override this method to provide custom shutdown behavior when necessary.

      Overrides:
      stop in class Dispatcher