예제 #1
0
 /**
  * Publish the description for this timeseries This is performed automatically at start of series
  * data publication, but subsequent changes to the description will not be published
  * automatically, and this method provides a means to send an update
  */
 public void publishDescription(IdentifiableTimeSeries identifiable) {
   SeriesDescriptionMessage d =
       udpMessageFactory.createTimeSeriesDescriptionMessage(
           identifiable.getPath(), identifiable.getDescription());
   seriesWithDescriptionsPublished.put(identifiable, null);
   safelyAddToQueue(d);
 }
예제 #2
0
    public void itemsAddedOrInserted(TimeSeriesEvent e) {
      if (e.isAppend()) {
        IdentifiableTimeSeries i = (IdentifiableTimeSeries) e.getSource();

        // only publish the description at the first point we actually have valid data to publish
        // this avoids creating unnecessary empty series in downstream components
        if (!isDescriptionPublished(i)) {
          publishDescription(i);
        }

        if (e.getItems().size() == 1) {
          TimeSeriesValueMessage m =
              udpMessageFactory.createTimeSeriesValueMessage(i.getPath(), e.getItems().get(0));
          safelyAddToQueue(m);

          if (!started.getAndSet(true)) {
            startPublisherQueue();
          }
        }
      }
    }
예제 #3
0
 /** Stop publishing single items appends for series s */
 public void stopPublishing(IdentifiableTimeSeries s) {
   s.removeTimeSeriesListener(appendPublishingListener);
 }
예제 #4
0
 /** Publish all single item appends to series s */
 public void publishAppends(IdentifiableTimeSeries s) {
   s.addTimeSeriesListener(appendPublishingListener);
 }