Package cern.nxcals.api.ingestion
Class PublisherFactory
- java.lang.Object
-
- cern.nxcals.api.ingestion.PublisherFactory
-
public final class PublisherFactory extends java.lang.Object
The main entry point to the NXCALS service. Creates the @seePublisher
instance for a given system name and data converting function.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> Publisher<V>
createBufferedPublisher(java.lang.String systemName, java.util.function.Function<V,cern.cmw.datax.ImmutableData> converter, java.time.Duration bufferTime, java.time.Duration flushingFrequency)
Creating the publisher from the system name and conversion function.<V> Publisher<V>
createPublisher(java.lang.String systemName, java.util.function.Function<V,cern.cmw.datax.ImmutableData> convertingFunction)
Creating the publisher from the system name and conversion function.static PublisherFactory
newInstance()
Factory method.
-
-
-
Method Detail
-
createPublisher
public <V> Publisher<V> createPublisher(java.lang.String systemName, java.util.function.Function<V,cern.cmw.datax.ImmutableData> convertingFunction)
Creating the publisher from the system name and conversion function.- Type Parameters:
V
- Type of data to publish.- Parameters:
systemName
- Name of system to publish.convertingFunction
- Function used to convert data.- Returns:
- Publisher which can publish data of type
<V>
-
createBufferedPublisher
public <V> Publisher<V> createBufferedPublisher(java.lang.String systemName, java.util.function.Function<V,cern.cmw.datax.ImmutableData> converter, java.time.Duration bufferTime, java.time.Duration flushingFrequency)
Creating the publisher from the system name and conversion function.- Type Parameters:
V
- Type of data to publish.- Parameters:
systemName
- Name of system to publish.converter
- Function used to convert data.bufferTime
- specifies how long messages should be internally buffered before being sent to NXCALSflushingFrequency
- specifies how often the internal buffer should be checked for flushing- Returns:
- Publisher which can publish data of type
<V>
-
newInstance
public static PublisherFactory newInstance()
Factory method.- Returns:
- New instance of
PublisherFactory
-
-