Class WicaStreamLifecycleService

java.lang.Object
ch.psi.wica.services.stream.WicaStreamLifecycleService

@Service @ThreadSafe public class WicaStreamLifecycleService extends Object
  • Constructor Details

    • WicaStreamLifecycleService

      public WicaStreamLifecycleService(@Autowired WicaStreamConfigurationDecoder wicaStreamConfigurationDecoder, @Autowired WicaStreamMetadataRequesterService wicaStreamMetadataRequesterService, @Autowired WicaStreamMonitoredValueRequesterService wicaStreamMonitoredValueRequesterService, @Autowired WicaStreamPolledValueRequesterService wicaStreamPolledValueRequesterService, @Autowired WicaStreamMetadataCollectorService wicaStreamMetadataCollectorService, @Autowired WicaStreamMonitoredValueCollectorService wicaStreamMonitoredValueCollectorService, @Autowired WicaStreamPolledValueCollectorService wicaStreamPolledValueCollectorService, @Autowired WicaChannelMetadataMapSerializerService wicaChannelMetadataMapSerializerService, @Autowired WicaChannelValueMapSerializerService wicaChannelValueMapSerializerService, @Autowired StatisticsCollectionService statisticsCollectionService)
      Parameters:
      wicaStreamConfigurationDecoder - reference to the service that can decode the JSON stream configuration.
      wicaStreamMetadataRequesterService - reference to the service used to request the metadata for the stream.
      wicaStreamMonitoredValueRequesterService - reference to the service used to request the monitored values for the stream.
      wicaStreamPolledValueRequesterService - reference to the service used to request the polled values for the stream.
      wicaStreamMetadataCollectorService - reference to the service which collects metadata information for the stream.
      wicaStreamMonitoredValueCollectorService - reference to the service which collects the monitored values for the stream.
      wicaStreamPolledValueCollectorService - reference to the service which collects the polled values for the stream.
      wicaChannelMetadataMapSerializerService - reference to the service that serializes the metadata map.
      wicaChannelValueMapSerializerService - reference to the service that serializes the value map.
      statisticsCollectionService - an object which will collect the statistics associated with this class instance.
  • Method Details

    • create

      public WicaStream create(String jsonStreamConfiguration)
      Creates and returns an active wica stream based on the supplied JSON stream configuration string.
      Parameters:
      jsonStreamConfiguration - the configuration string.
      Returns:
      the returned stream.
      Throws:
      NullPointerException - if the 'jsonStreamConfiguration' argument was null.
      IllegalArgumentException - if the 'jsonStreamConfiguration' argument was empty.
    • delete

      public void delete(WicaStreamId wicaStreamId)
      Deletes the wica stream with the specified ID.
      Parameters:
      wicaStreamId - the ID of the stream to delete.
      Throws:
      NullPointerException - if the 'wicaStreamId' argument was null.
      IllegalStateException - if the 'wicaStreamId' argument was not recognised.
    • restartMonitoring

      public void restartMonitoring(WicaStreamId wicaStreamId)
      Restarts the control system monitoring on the wica stream with the specified ID.
      Parameters:
      wicaStreamId - the ID of the stream to restart.
      Throws:
      NullPointerException - if the 'wicaStreamId' argument was null.
      IllegalStateException - if the 'wicaStreamId' argument was not recognised.
    • restartPolling

      public void restartPolling(WicaStreamId wicaStreamId)
      Restarts the control system polling on the wica stream with the specified ID.
      Parameters:
      wicaStreamId - the ID of the stream to restart.
      Throws:
      NullPointerException - if the 'wicaStreamId' argument was null.
      IllegalStateException - if the 'wicaStreamId' argument was not recognised.
    • getFlux

      public reactor.core.publisher.Flux<org.springframework.http.codec.ServerSentEvent<String>> getFlux(WicaStreamId wicaStreamId)
      Gets the publication flux for the stream with the specified id.
      Parameters:
      wicaStreamId - the id of the flux to fetch.
      Returns:
      the combined flux.
    • isKnown

      public boolean isKnown(WicaStreamId wicaStreamId)
      Returns an flag saying whether the specified id is recognised within the system.
      Parameters:
      wicaStreamId - the id of the stream to check.
      Returns:
      the result.