Class UdpStreamMonitor
java.lang.Object
org.codice.alliance.video.stream.mpegts.UdpStreamMonitor
- All Implemented Interfaces:
StreamMonitor
Starts a Netty server with a pipeline specified by
UdpStreamProcessor. The following
properties must be set:
setMonitoredAddress(String)setFilenameTemplate(String)setRolloverCondition(RolloverCondition)setFilenameGenerator(FilenameGenerator)setMetacardTypeList(List)setCatalogFramework(CatalogFramework)NOTE: The unicast and multicast code can not be unit tested in a meaningful manner. And only unicast can be itest'ed. If any changes are made to the unicast/multicast code, be sure to manually test.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final longstatic final longstatic final longstatic final Stringstatic final StringThis is the id string used in metatype.xml.static final Stringstatic final StringThis is the id string used in metatype.xml.static final StringThis is the id string used in metatype.xml.static final StringThis is the id string used in metatype.xml.static final StringThis is the id string used in metatype.xml.static final Stringstatic final Stringstatic final Stringstatic final StringThis is the id string used in metatype.xml.static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy(int arg) Called by osgi to destroy the monitor.Get the string that uniquely identifies this stream.Get the URI of the stream associated with this stream processor.getTitle()Get the title string to be used for the parent metacard.voidinit()Called by osgi to initialize the monitor.booleanvoidsetAdditionalProperties(List<String> properties) voidsetCatalogFramework(ddf.catalog.CatalogFramework catalogFramework) voidsetDistanceTolerance(Double distanceTolerance) voidsetElapsedTimeRolloverCondition(Long milliseconds) voidsetFilenameGenerator(FilenameGenerator filenameGenerator) voidsetFilenameTemplate(String template) voidvoidsetMetacardTypeList(List<ddf.catalog.data.MetacardType> metacardTypeList) voidsetMetacardUpdateInitialDelay(Long metacardUpdateInitialDelay) voidsetMonitoredAddress(String monitoredAddress) voidsetNetworkInterface(String networkInterface) voidsetParentMetacardUpdater(MetacardUpdater parentMetacardUpdater) voidsetParentTitle(String parentTitle) voidsetRolloverCondition(RolloverCondition rolloverCondition) voidsetStartImmediately(Boolean startImmediately) voidsetStreamCreationPlugin(StreamCreationPlugin streamCreationPlugin) voidsetStreamEndPlugin(StreamEndPlugin streamEndPlugin) The StreamEndPlugin gets called when a stream ends by either being stopped or timed-out.voidsetStreamId(String streamId) voidsetStreamShutdownPlugin(StreamShutdownPlugin streamShutdownPlugin) voidsetUuidGenerator(org.codice.ddf.platform.util.uuidgenerator.UuidGenerator uuidGenerator) voidStarts the monitoring mechanism on the streamvoidStops the monitoring mechanism on the streamvoidupdateCallback(Map<String, Object> properties) Called by osgi to update the properties defined in metatype.xml
-
Field Details
-
MEGABYTE_COUNT_MIN
public static final long MEGABYTE_COUNT_MIN- See Also:
-
MEGABYTE_COUNT_MAX
public static final long MEGABYTE_COUNT_MAX- See Also:
-
ELAPSED_TIME_MIN
public static final long ELAPSED_TIME_MIN- See Also:
-
ELAPSED_TIME_MAX
public static final long ELAPSED_TIME_MAX- See Also:
-
METATYPE_TITLE
This is the id string used in metatype.xml.- See Also:
-
METATYPE_MONITORED_ADDRESS
This is the id string used in metatype.xml.- See Also:
-
METATYPE_BYTE_COUNT_ROLLOVER_CONDITION
This is the id string used in metatype.xml.- See Also:
-
METATYPE_ELAPSED_TIME_ROLLOVER_CONDITION
This is the id string used in metatype.xml.- See Also:
-
METATYPE_METACARD_UPDATE_INITIAL_DELAY
This is the id string used in metatype.xml.- See Also:
-
METATYPE_FILENAME_TEMPLATE
This is the id string used in metatype.xml.- See Also:
-
METATYPE_DISTANCE_TOLERANCE
- See Also:
-
METATYPE_NETWORK_INTERFACE
- See Also:
-
METATYPE_START_IMMEDIATELY
- See Also:
-
METATYPE_STREAM_ID
- See Also:
-
METATYPE_ADDITIONAL_PROPERTIES
- See Also:
-
STREAM_ID
- See Also:
-
-
Constructor Details
-
UdpStreamMonitor
public UdpStreamMonitor(org.osgi.framework.BundleContext bundleContext)
-
-
Method Details
-
setStreamCreationPlugin
-
setStreamShutdownPlugin
-
getStartImmediately
-
setStartImmediately
-
getDistanceTolerance
-
setDistanceTolerance
-
setAdditionalProperties
-
getNetworkInterface
-
setNetworkInterface
- Parameters:
networkInterface- may be null or empty/blank string
-
setParentMetacardUpdater
- Parameters:
parentMetacardUpdater- must be non-null
-
getMetacardUpdateInitialDelay
-
setMetacardUpdateInitialDelay
- Parameters:
metacardUpdateInitialDelay- must be non-null and >=0 and <=UdpStreamProcessor.MAX_METACARD_UPDATE_INITIAL_DELAY
-
setFilenameGenerator
- Parameters:
filenameGenerator- must be non-null
-
setFilenameTemplate
- Parameters:
template- must be non-null and non-blank
-
getFileNameTemplate
-
setRolloverCondition
- Parameters:
rolloverCondition- must be non-null
-
setUuidGenerator
public void setUuidGenerator(org.codice.ddf.platform.util.uuidgenerator.UuidGenerator uuidGenerator) -
init
public void init()Called by osgi to initialize the monitor. Makes sure it is already shutdown before initializing. Will throw a RuntimeException if not properly initialized. -
startMonitoring
public void startMonitoring()Description copied from interface:StreamMonitorStarts the monitoring mechanism on the stream- Specified by:
startMonitoringin interfaceStreamMonitor
-
stopMonitoring
public void stopMonitoring()Description copied from interface:StreamMonitorStops the monitoring mechanism on the stream- Specified by:
stopMonitoringin interfaceStreamMonitor
-
isMonitoring
public boolean isMonitoring()- Specified by:
isMonitoringin interfaceStreamMonitor- Returns:
- returns true when actively monitoring stream
-
setParentTitle
-
getStartDateAsString
-
setStreamId
-
getStreamId
Description copied from interface:StreamMonitorGet the string that uniquely identifies this stream.- Specified by:
getStreamIdin interfaceStreamMonitor- Returns:
- a unique identifier for this stream
-
getStreamUri
Description copied from interface:StreamMonitorGet the URI of the stream associated with this stream processor.- Specified by:
getStreamUriin interfaceStreamMonitor- Returns:
- optional uri of the stream
-
getTitle
Description copied from interface:StreamMonitorGet the title string to be used for the parent metacard.- Specified by:
getTitlein interfaceStreamMonitor- Returns:
- optional title of the stream
-
setMetacardTypeList
- Parameters:
metacardTypeList- must be non-null
-
setCatalogFramework
public void setCatalogFramework(ddf.catalog.CatalogFramework catalogFramework) - Parameters:
catalogFramework- must be non-null
-
destroy
public void destroy(int arg) Called by osgi to destroy the monitor.- Parameters:
arg- osgi destroy argument
-
setStreamEndPlugin
The StreamEndPlugin gets called when a stream ends by either being stopped or timed-out.- Parameters:
streamEndPlugin- the plugin
-
updateCallback
Called by osgi to update the properties defined in metatype.xml- Parameters:
properties- properties being updated
-
getMonitoredAddress
-
setMonitoredAddress
- Parameters:
monitoredAddress- must be non-null and resolvable
-
getByteCountRolloverCondition
-
setMegabyteCountRolloverCondition
- Parameters:
count- must be non-null and positive
-
getElapsedTimeRolloverCondition
-
setElapsedTimeRolloverCondition
- Parameters:
milliseconds- must be non-null and >=ELAPSED_TIME_MIN
-