Class WicaStreamMetadataRequesterService

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

@Configuration @EnableScheduling @Service @ThreadSafe public class WicaStreamMetadataRequesterService extends Object
Provides a service for starting and stopping the acquisition of metadata for the channels in a WicaStream.
  • Constructor Details

    • WicaStreamMetadataRequesterService

      WicaStreamMetadataRequesterService(@Value("${wica.channel-resource-release-interval-in-secs}") int wicaChannelResourceReleaseIntervalInSecs, @Value("${wica.channel-publish-channel-metadata-initial-state}") boolean wicaChannelPublishChannelMetadataInitialState, @Autowired org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
      Constructs a new instance.
      Parameters:
      wicaChannelResourceReleaseIntervalInSecs - period after which the resources associated with a Wica Channel will be released if they are no longer in use.
      wicaChannelPublishChannelMetadataInitialState - determines whether a channel's initial value will be published as UNKNOWN when a channel is first created or whether nothing will be published until the first metadata information is acquired.
      applicationEventPublisher - reference to the application publisher which will be used to publish the channels to acquire metadata for or which are no longer of interest.
  • Method Details

    • discardChannelsThatHaveReachedEndOfLife

      @Scheduled(fixedRate=1000L) public void discardChannelsThatHaveReachedEndOfLife()
      This method runs periodically to scan the discard list for entries corresponding to channels whose metadata is no longer of interest.
    • startDataAcquisition

      void startDataAcquisition(WicaStream wicaStream)
      Starts metadata data acquisition for the channels in the specified stream.
      Parameters:
      wicaStream - the stream to acquire metadata for.
    • stopDataAcquisition

      void stopDataAcquisition(WicaStream wicaStream)
      Stops for the channels in the specified stream.
      Parameters:
      wicaStream - the stream that is no longer of interest.