Package com.wowza.wms.pushpublish.model
Class PushPublishBase
- Object
-
- com.wowza.wms.pushpublish.model.PushPublishBase
-
- All Implemented Interfaces:
IPushPublish
- Direct Known Subclasses:
PushPublishHTTPBase
,PushPublishRTMP
,PushPublishRTP
,PushPublishShoutcast
public abstract class PushPublishBase extends Object implements IPushPublish
The Class PushPublishBase.
-
-
Field Summary
Fields Modifier and Type Field Description protected IApplicationInstance
appInstance
The app instance within-which the module is running.protected String
className
static int
DESTINATION_BAK
static int
DESTINATION_PRI
static int
DESTINATION_RED
protected String
destinationName
Name of the target destination; e.g.protected int
destinationServer
Destination server for Stream Target destinations; can be primary, backup, or redundant.protected String
dstStreamName
The destination stream name.protected String
entryName
The map file entry name.protected String
hostname
The destination host.protected java.net.InetAddress
inetAddr
The destination inet address.protected boolean
isAdaptiveStreaming
The is adaptive streaming.protected boolean
isExternalRedundancy
Stream Target has a redundant stream being pushed by another WSE instanceprotected WMSLogger
logger
protected String
mImplementation
The profile implementation.protected java.util.Map<String,String>
myMap
protected String
password
The password.protected String
playbackHostname
The destination host.protected int
port
The destination port.protected String
profile
The map file entry profile.protected WMSProperties
properties
The properties.protected IPushPublishSession
pushPublishSession
protected boolean
pushPublishStreamDebug
Enables stream debug.protected int
pushPublishType
The type of stream to be published.protected int
reconnectWaitTime
The time between reconnect attempts (only applies to some profiles).protected IOPerformanceCounter
sendingPerformance
protected IMediaStream
srcStream
protected String
srcStreamName
The src stream name.protected IOPerformanceCounter
totalIOPerformance2Last
protected IOPerformanceCounter
totalIOPerformanceLast
protected String
userName
The user name.-
Fields inherited from interface com.wowza.wms.pushpublish.model.IPushPublish
CONNECTED_STATE_CONNECTED, CONNECTED_STATE_CONNECTING, CONNECTED_STATE_NOT_CONNECTED, CONNECTED_STATE_WAITING, PUSHPUBLISH_TYPE_CUPERTINO, PUSHPUBLISH_TYPE_MPEGDASH, PUSHPUBLISH_TYPE_NOTIFY_PACKET, PUSHPUBLISH_TYPE_RTMP, PUSHPUBLISH_TYPE_RTP, PUSHPUBLISH_TYPE_RTP_BUFFERED, PUSHPUBLISH_TYPE_SANJOSE, PUSHPUBLISH_TYPE_SRT, PUSHPUBLISH_TYPE_UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description PushPublishBase()
Instantiates a new push publisher base.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(IOPerformanceCounter totalValue)
void
addIOPerformance2(IOPerformanceCounter totalIOPerformanceResult)
protected void
clearLoggingValues()
Clear global logging values previously set by updateLoggingValues.IPushPublishSession
createPushPublishSession()
IApplicationInstance
getAppInstance()
Get appInstance interface.double
getBandwidth()
java.util.Map<String,String>
getBaseParams()
abstract String
getContextStr()
int
getDestinationID()
Get destination ID.String
getDestinationName()
Get destination name.int
getDestinationServer()
Get destination server.String
getDstStreamName()
Get destination stream name.String
getEntryName()
Get map file entry name.String
getHostname()
Get destination server host name.String
getImplementation()
Gets the implementation.java.net.InetAddress
getInetAddr()
java.util.Map<String,String>
getMap()
long
getMessagesOutBytes()
long
getMessagesOutCount()
String
getPassword()
Get password.String
getPlaybackHostname()
Get playback server host name.int
getPort()
Get destination server port.String
getProfile()
Get entry profile.WMSProperties
getProperties()
Get properties.int
getPushPublishType()
int
getReconnectWaitTime()
Get the reconnect wait time (milliseconds).IMediaStream
getSrcStream()
Get source IMediaStream.String
getSrcStreamName()
Get source stream name.String
getUserName()
Gets the user name.static String
getWowzaStreamingEngineVersionStr()
Gets the server version str.void
incrementMessagesOut(long bytes)
void
init(IApplicationInstance appInstance, String streamName, IMediaStream stream, java.util.Map<String,String> profileData, java.util.Map<String,String> maps, com.wowza.wms.pushpublish.manager.IPushPublisher pushPublisher, boolean streamDebug)
Inits the instance.boolean
isAdaptiveStreaming()
Checks if is adaptive streaming.boolean
isDebugLog()
boolean
isExternalRedundancy()
Is there an redundant stream being pushed by an external WSE instance? return true or falsevoid
load(java.util.HashMap<String,String> dataMap)
Loads map and profile parametersvoid
logDebug(String methodName, String log)
void
logError(String methodName, String log)
void
logError(String methodName, String log, Throwable e)
void
logError(String methodName, Throwable e)
void
logInfo(String methodName, String log)
void
logWarn(String methodName, String log)
String
resolveHostName()
Resolve host name to connect tovoid
setAdaptiveStreaming(boolean isAdaptiveStreaming)
Sets the adaptive streaming.void
setAdaptiveStreaming(String adaptiveStreamingStr)
void
setAppInstance(IApplicationInstance appInstance)
Set appInstance interface.void
setDebugLog(boolean debugLog)
Set debug logging.void
setDestinationName(String destinationName)
Set destination name.void
setDestinationServer(int destinationServer)
Set destination server.void
setDestinationServer(String destinationServer)
Set destination server.void
setDstStreamName(String dstStreamName)
Set destination stream name.void
setEntryName(String entryName)
Set map file entry name.void
setExternalRedundancy(boolean isExternalRedundancy)
Set whether there is an external redundant stream.void
setExternalRedundancy(String externalRedundancy)
void
setHost(String hostname)
Set destination server host name.void
setHostname(String hostname)
void
setImplementation(String implementation)
Sets the implementation.void
setInetAddr(java.net.InetAddress inetAddr)
void
setPassword(String password)
Set password.void
setPlaybackHostname(String playbackHostname)
Set playback server host name.void
setPort(int port)
Set destination server port.void
setPort(String port)
Set destination server port.void
setProfile(String profile)
Set map file entry profile.void
setReconnectWaitTime(int reconnectWaitTime)
Set the reconnect wait time (milliseconds).void
setSrcStream(IMediaStream srcStream)
Sets the source IMediaStream.void
setSrcStreamName(String srcStreamName)
Set source stream name.void
setStreamName(String streamName)
Sets the stream name.void
setUserName(String userName)
Set user name.protected void
updateLoggingValues(String protocol)
Update global logging values: protocol (logger ID: WMSLoggerIDs.PROTO_XXX) application name application instance name vhost name source stream name IOPerformanceCounter message out bytes This call is inherently threadsafe as it sets values in the log4j MDC, which is managed on a per thread basis.void
updateUsageTracker()
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.wowza.wms.pushpublish.model.IPushPublish
connect, disconnect, getConnectedState, getMessagesAttemptedCount, getMessagesFailedCount, getMessagesRetriedCount, resetConnection
-
-
-
-
Field Detail
-
logger
protected WMSLogger logger
-
className
protected String className
-
pushPublishType
protected int pushPublishType
The type of stream to be published.
-
pushPublishStreamDebug
protected boolean pushPublishStreamDebug
Enables stream debug.
-
reconnectWaitTime
protected int reconnectWaitTime
The time between reconnect attempts (only applies to some profiles).
-
sendingPerformance
protected IOPerformanceCounter sendingPerformance
-
totalIOPerformanceLast
protected IOPerformanceCounter totalIOPerformanceLast
-
totalIOPerformance2Last
protected IOPerformanceCounter totalIOPerformance2Last
-
properties
protected WMSProperties properties
The properties.
-
profile
protected String profile
The map file entry profile.
-
entryName
protected String entryName
The map file entry name.
-
isAdaptiveStreaming
protected boolean isAdaptiveStreaming
The is adaptive streaming.
-
userName
protected String userName
The user name.
-
password
protected String password
The password.
-
appInstance
protected IApplicationInstance appInstance
The app instance within-which the module is running.
-
srcStreamName
protected String srcStreamName
The src stream name.
-
srcStream
protected IMediaStream srcStream
-
dstStreamName
protected String dstStreamName
The destination stream name.
-
hostname
protected String hostname
The destination host.
-
playbackHostname
protected String playbackHostname
The destination host.
-
inetAddr
protected java.net.InetAddress inetAddr
The destination inet address.
-
port
protected int port
The destination port.
-
mImplementation
protected String mImplementation
The profile implementation.
-
DESTINATION_PRI
public static final int DESTINATION_PRI
- See Also:
- Constant Field Values
-
DESTINATION_BAK
public static final int DESTINATION_BAK
- See Also:
- Constant Field Values
-
DESTINATION_RED
public static final int DESTINATION_RED
- See Also:
- Constant Field Values
-
destinationServer
protected int destinationServer
Destination server for Stream Target destinations; can be primary, backup, or redundant.
-
isExternalRedundancy
protected boolean isExternalRedundancy
Stream Target has a redundant stream being pushed by another WSE instance
-
destinationName
protected String destinationName
Name of the target destination; e.g. "wowzavideo", "akamai", "rtmp" (generic).
-
pushPublishSession
protected IPushPublishSession pushPublishSession
-
myMap
protected java.util.Map<String,String> myMap
-
-
Method Detail
-
init
public void init(IApplicationInstance appInstance, String streamName, IMediaStream stream, java.util.Map<String,String> profileData, java.util.Map<String,String> maps, com.wowza.wms.pushpublish.manager.IPushPublisher pushPublisher, boolean streamDebug)
Inits the instance.- Specified by:
init
in interfaceIPushPublish
- Parameters:
appInstance
- the app instancestreamName
- the source stream namemaps
- the map entry paramsprofileData
- the profile paramsstreamDebug
- stream debug flag
-
updateUsageTracker
public void updateUsageTracker()
- Specified by:
updateUsageTracker
in interfaceIPushPublish
-
getImplementation
public String getImplementation()
Gets the implementation.- Returns:
- the implementation
-
setImplementation
public void setImplementation(String implementation)
Sets the implementation.- Parameters:
implementation
- the new implementation
-
getProperties
public WMSProperties getProperties()
Get properties.- Specified by:
getProperties
in interfaceIPushPublish
- Returns:
- properties
-
getProfile
public String getProfile()
Get entry profile.- Specified by:
getProfile
in interfaceIPushPublish
- Returns:
- map entry profile
-
setProfile
public void setProfile(String profile)
Set map file entry profile.- Specified by:
setProfile
in interfaceIPushPublish
- Parameters:
profile
- map entry profile
-
getEntryName
public String getEntryName()
Get map file entry name.- Specified by:
getEntryName
in interfaceIPushPublish
- Returns:
- map file entry name
-
setEntryName
public void setEntryName(String entryName)
Set map file entry name.- Specified by:
setEntryName
in interfaceIPushPublish
- Parameters:
entryName
- map file entry name
-
isAdaptiveStreaming
public boolean isAdaptiveStreaming()
Checks if is adaptive streaming.- Returns:
- true, if is adaptive streaming
-
setAdaptiveStreaming
public void setAdaptiveStreaming(boolean isAdaptiveStreaming)
Sets the adaptive streaming.- Parameters:
isAdaptiveStreaming
- the new adaptive streaming
-
setAdaptiveStreaming
public void setAdaptiveStreaming(String adaptiveStreamingStr)
-
getUserName
public String getUserName()
Gets the user name.- Returns:
- the user name
-
setUserName
public void setUserName(String userName)
Set user name.- Parameters:
userName
- user name
-
getPassword
public String getPassword()
Get password.- Returns:
- password
-
setPassword
public void setPassword(String password)
Set password.- Parameters:
password
- password
-
getAppInstance
public IApplicationInstance getAppInstance()
Get appInstance interface.- Returns:
- appInstance interface
-
setAppInstance
public void setAppInstance(IApplicationInstance appInstance)
Set appInstance interface.- Parameters:
appInstance
- appInstance interface
-
getSrcStreamName
public String getSrcStreamName()
Get source stream name.- Specified by:
getSrcStreamName
in interfaceIPushPublish
- Returns:
- source stream name
-
setSrcStreamName
public void setSrcStreamName(String srcStreamName)
Set source stream name.- Specified by:
setSrcStreamName
in interfaceIPushPublish
- Parameters:
srcStreamName
- source stream name
-
getDstStreamName
public String getDstStreamName()
Get destination stream name.- Specified by:
getDstStreamName
in interfaceIPushPublish
- Returns:
- destination stream name
-
setDstStreamName
public void setDstStreamName(String dstStreamName)
Set destination stream name.- Specified by:
setDstStreamName
in interfaceIPushPublish
- Parameters:
dstStreamName
- destination stream name
-
setStreamName
public void setStreamName(String streamName)
Sets the stream name.- Specified by:
setStreamName
in interfaceIPushPublish
- Parameters:
streamName
- the new stream name
-
getHostname
public String getHostname()
Get destination server host name.- Specified by:
getHostname
in interfaceIPushPublish
- Returns:
- destination server host name
-
setHost
public void setHost(String hostname)
Set destination server host name.- Specified by:
setHost
in interfaceIPushPublish
- Parameters:
hostname
- destination server host name
-
setHostname
public void setHostname(String hostname)
- Specified by:
setHostname
in interfaceIPushPublish
-
getPlaybackHostname
public String getPlaybackHostname()
Get playback server host name.- Returns:
- playback server host name
-
setPlaybackHostname
public void setPlaybackHostname(String playbackHostname)
Set playback server host name.- Parameters:
playbackHostname
- playback server host name
-
getPort
public int getPort()
Get destination server port.- Specified by:
getPort
in interfaceIPushPublish
- Returns:
- destination server port
-
setPort
public void setPort(int port)
Set destination server port.- Specified by:
setPort
in interfaceIPushPublish
- Parameters:
port
- destination server port
-
setPort
public void setPort(String port)
Set destination server port.- Specified by:
setPort
in interfaceIPushPublish
- Parameters:
port
- destination server port
-
setDestinationServer
public void setDestinationServer(String destinationServer)
Set destination server.- Parameters:
destinationServer
- destination server
-
getDestinationServer
public int getDestinationServer()
Get destination server. return destination server
-
setDestinationServer
public void setDestinationServer(int destinationServer)
Set destination server.- Parameters:
destinationServer
- destination server
-
isExternalRedundancy
public boolean isExternalRedundancy()
Is there an redundant stream being pushed by an external WSE instance? return true or false
-
setExternalRedundancy
public void setExternalRedundancy(boolean isExternalRedundancy)
Set whether there is an external redundant stream.- Parameters:
isExternalRedundancy
-
-
setExternalRedundancy
public void setExternalRedundancy(String externalRedundancy)
-
getDestinationName
public String getDestinationName()
Get destination name.- Specified by:
getDestinationName
in interfaceIPushPublish
- Returns:
- destination name
-
setDestinationName
public void setDestinationName(String destinationName)
Set destination name.- Specified by:
setDestinationName
in interfaceIPushPublish
- Parameters:
destinationName
- destination name
-
getWowzaStreamingEngineVersionStr
public static String getWowzaStreamingEngineVersionStr()
Gets the server version str.- Returns:
- the server version str
-
load
public void load(java.util.HashMap<String,String> dataMap)
Loads map and profile parameters- Parameters:
dataMap
- the data map
-
getReconnectWaitTime
public int getReconnectWaitTime()
Get the reconnect wait time (milliseconds). Shortest time between connection attempts.- Specified by:
getReconnectWaitTime
in interfaceIPushPublish
- Returns:
- reconnect wait time (milliseconds)
-
setReconnectWaitTime
public void setReconnectWaitTime(int reconnectWaitTime)
Set the reconnect wait time (milliseconds). Shortest time between connection attempts.- Specified by:
setReconnectWaitTime
in interfaceIPushPublish
- Parameters:
reconnectWaitTime
- reconnect wait time (milliseconds)
-
getBandwidth
public double getBandwidth()
-
getInetAddr
public java.net.InetAddress getInetAddr()
- Returns:
- the inetAddr
-
setInetAddr
public void setInetAddr(java.net.InetAddress inetAddr)
- Parameters:
inetAddr
- the inetAddr to set
-
getPushPublishType
public int getPushPublishType()
- Specified by:
getPushPublishType
in interfaceIPushPublish
-
createPushPublishSession
public IPushPublishSession createPushPublishSession()
- Specified by:
createPushPublishSession
in interfaceIPushPublish
-
getSrcStream
public IMediaStream getSrcStream()
Get source IMediaStream.- Specified by:
getSrcStream
in interfaceIPushPublish
- Returns:
- source IMediaStream
-
setSrcStream
public void setSrcStream(IMediaStream srcStream)
Sets the source IMediaStream.- Specified by:
setSrcStream
in interfaceIPushPublish
- Parameters:
srcStream
- the source IMediaStream
-
getMap
public java.util.Map<String,String> getMap()
- Specified by:
getMap
in interfaceIPushPublish
-
getBaseParams
public java.util.Map<String,String> getBaseParams()
-
incrementMessagesOut
public void incrementMessagesOut(long bytes)
-
getMessagesOutBytes
public long getMessagesOutBytes()
-
getMessagesOutCount
public long getMessagesOutCount()
-
add
public void add(IOPerformanceCounter totalValue)
-
addIOPerformance2
public void addIOPerformance2(IOPerformanceCounter totalIOPerformanceResult)
-
getDestinationID
public int getDestinationID()
Get destination ID. A return value of 0 means the destination ID cannot be determined.- Specified by:
getDestinationID
in interfaceIPushPublish
- Returns:
- destination ID
-
getContextStr
public abstract String getContextStr()
- Specified by:
getContextStr
in interfaceIPushPublish
-
updateLoggingValues
protected void updateLoggingValues(String protocol)
Update global logging values: protocol (logger ID: WMSLoggerIDs.PROTO_XXX) application name application instance name vhost name source stream name IOPerformanceCounter message out bytes This call is inherently threadsafe as it sets values in the log4j MDC, which is managed on a per thread basis.- Parameters:
c_proto
- protocol
-
clearLoggingValues
protected void clearLoggingValues()
Clear global logging values previously set by updateLoggingValues. This call is inherently threadsafe as it clears values in the log4j MDC, which is managed on a per thread basis.
-
isDebugLog
public boolean isDebugLog()
- Specified by:
isDebugLog
in interfaceIPushPublish
-
setDebugLog
public void setDebugLog(boolean debugLog)
Set debug logging.- Specified by:
setDebugLog
in interfaceIPushPublish
- Parameters:
debugLog
- debug logging
-
logDebug
public void logDebug(String methodName, String log)
-
logInfo
public void logInfo(String methodName, String log)
-
logWarn
public void logWarn(String methodName, String log)
-
logError
public void logError(String methodName, String log)
-
logError
public void logError(String methodName, String log, Throwable e)
-
logError
public void logError(String methodName, Throwable e)
-
resolveHostName
public String resolveHostName()
Resolve host name to connect to- Returns:
- hostname
-
-