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 SummaryFields Modifier and Type Field Description protected IApplicationInstanceappInstanceThe app instance within-which the module is running.protected StringclassNamestatic intDESTINATION_BAKstatic intDESTINATION_PRIstatic intDESTINATION_REDprotected StringdestinationNameName of the target destination; e.g.protected intdestinationServerDestination server for Stream Target destinations; can be primary, backup, or redundant.protected StringdstStreamNameThe destination stream name.protected StringentryNameThe map file entry name.protected StringhostnameThe destination host.protected java.net.InetAddressinetAddrThe destination inet address.protected booleanisAdaptiveStreamingThe is adaptive streaming.protected booleanisExternalRedundancyStream Target has a redundant stream being pushed by another WSE instanceprotected WMSLoggerloggerprotected StringmImplementationThe profile implementation.protected java.util.Map<String,String>myMapprotected StringpasswordThe password.protected StringplaybackHostnameThe destination host.protected intportThe destination port.protected StringprofileThe map file entry profile.protected WMSPropertiespropertiesThe properties.protected IPushPublishSessionpushPublishSessionprotected booleanpushPublishStreamDebugEnables stream debug.protected intpushPublishTypeThe type of stream to be published.protected intreconnectWaitTimeThe time between reconnect attempts (only applies to some profiles).protected IOPerformanceCountersendingPerformanceprotected IMediaStreamsrcStreamprotected StringsrcStreamNameThe src stream name.protected IOPerformanceCountertotalIOPerformance2Lastprotected IOPerformanceCountertotalIOPerformanceLastprotected StringuserNameThe user name.- 
Fields inherited from interface com.wowza.wms.pushpublish.model.IPushPublishCONNECTED_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 SummaryConstructors Constructor Description PushPublishBase()Instantiates a new push publisher base.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(IOPerformanceCounter totalValue)voidaddIOPerformance2(IOPerformanceCounter totalIOPerformanceResult)protected voidclearLoggingValues()Clear global logging values previously set by updateLoggingValues.IPushPublishSessioncreatePushPublishSession()IApplicationInstancegetAppInstance()Get appInstance interface.doublegetBandwidth()java.util.Map<String,String>getBaseParams()abstract StringgetContextStr()intgetDestinationID()Get destination ID.StringgetDestinationName()Get destination name.intgetDestinationServer()Get destination server.StringgetDstStreamName()Get destination stream name.StringgetEntryName()Get map file entry name.StringgetHostname()Get destination server host name.StringgetImplementation()Gets the implementation.java.net.InetAddressgetInetAddr()java.util.Map<String,String>getMap()longgetMessagesOutBytes()longgetMessagesOutCount()StringgetPassword()Get password.StringgetPlaybackHostname()Get playback server host name.intgetPort()Get destination server port.StringgetProfile()Get entry profile.WMSPropertiesgetProperties()Get properties.intgetPushPublishType()intgetReconnectWaitTime()Get the reconnect wait time (milliseconds).IMediaStreamgetSrcStream()Get source IMediaStream.StringgetSrcStreamName()Get source stream name.StringgetUserName()Gets the user name.static StringgetWowzaStreamingEngineVersionStr()Gets the server version str.voidincrementMessagesOut(long bytes)voidinit(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.booleanisAdaptiveStreaming()Checks if is adaptive streaming.booleanisDebugLog()booleanisExternalRedundancy()Is there an redundant stream being pushed by an external WSE instance? return true or falsevoidload(java.util.HashMap<String,String> dataMap)Loads map and profile parametersvoidlogDebug(String methodName, String log)voidlogError(String methodName, String log)voidlogError(String methodName, String log, Throwable e)voidlogError(String methodName, Throwable e)voidlogInfo(String methodName, String log)voidlogWarn(String methodName, String log)StringresolveHostName()Resolve host name to connect tovoidsetAdaptiveStreaming(boolean isAdaptiveStreaming)Sets the adaptive streaming.voidsetAdaptiveStreaming(String adaptiveStreamingStr)voidsetAppInstance(IApplicationInstance appInstance)Set appInstance interface.voidsetDebugLog(boolean debugLog)Set debug logging.voidsetDestinationName(String destinationName)Set destination name.voidsetDestinationServer(int destinationServer)Set destination server.voidsetDestinationServer(String destinationServer)Set destination server.voidsetDstStreamName(String dstStreamName)Set destination stream name.voidsetEntryName(String entryName)Set map file entry name.voidsetExternalRedundancy(boolean isExternalRedundancy)Set whether there is an external redundant stream.voidsetExternalRedundancy(String externalRedundancy)voidsetHost(String hostname)Set destination server host name.voidsetHostname(String hostname)voidsetImplementation(String implementation)Sets the implementation.voidsetInetAddr(java.net.InetAddress inetAddr)voidsetPassword(String password)Set password.voidsetPlaybackHostname(String playbackHostname)Set playback server host name.voidsetPort(int port)Set destination server port.voidsetPort(String port)Set destination server port.voidsetProfile(String profile)Set map file entry profile.voidsetReconnectWaitTime(int reconnectWaitTime)Set the reconnect wait time (milliseconds).voidsetSrcStream(IMediaStream srcStream)Sets the source IMediaStream.voidsetSrcStreamName(String srcStreamName)Set source stream name.voidsetStreamName(String streamName)Sets the stream name.voidsetUserName(String userName)Set user name.protected voidupdateLoggingValues(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.voidupdateUsageTracker()- 
Methods inherited from class java.lang.Objectclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.wowza.wms.pushpublish.model.IPushPublishconnect, disconnect, getConnectedState, getMessagesAttemptedCount, getMessagesFailedCount, getMessagesRetriedCount, resetConnection
 
- 
 
- 
- 
- 
Field Detail- 
loggerprotected WMSLogger logger 
 - 
classNameprotected String className 
 - 
pushPublishTypeprotected int pushPublishType The type of stream to be published.
 - 
pushPublishStreamDebugprotected boolean pushPublishStreamDebug Enables stream debug.
 - 
reconnectWaitTimeprotected int reconnectWaitTime The time between reconnect attempts (only applies to some profiles).
 - 
sendingPerformanceprotected IOPerformanceCounter sendingPerformance 
 - 
totalIOPerformanceLastprotected IOPerformanceCounter totalIOPerformanceLast 
 - 
totalIOPerformance2Lastprotected IOPerformanceCounter totalIOPerformance2Last 
 - 
propertiesprotected WMSProperties properties The properties.
 - 
profileprotected String profile The map file entry profile.
 - 
entryNameprotected String entryName The map file entry name.
 - 
isAdaptiveStreamingprotected boolean isAdaptiveStreaming The is adaptive streaming.
 - 
userNameprotected String userName The user name.
 - 
passwordprotected String password The password.
 - 
appInstanceprotected IApplicationInstance appInstance The app instance within-which the module is running.
 - 
srcStreamNameprotected String srcStreamName The src stream name.
 - 
srcStreamprotected IMediaStream srcStream 
 - 
dstStreamNameprotected String dstStreamName The destination stream name.
 - 
hostnameprotected String hostname The destination host.
 - 
playbackHostnameprotected String playbackHostname The destination host.
 - 
inetAddrprotected java.net.InetAddress inetAddr The destination inet address.
 - 
portprotected int port The destination port.
 - 
mImplementationprotected String mImplementation The profile implementation.
 - 
DESTINATION_PRIpublic static final int DESTINATION_PRI - See Also:
- Constant Field Values
 
 - 
DESTINATION_BAKpublic static final int DESTINATION_BAK - See Also:
- Constant Field Values
 
 - 
DESTINATION_REDpublic static final int DESTINATION_RED - See Also:
- Constant Field Values
 
 - 
destinationServerprotected int destinationServer Destination server for Stream Target destinations; can be primary, backup, or redundant.
 - 
isExternalRedundancyprotected boolean isExternalRedundancy Stream Target has a redundant stream being pushed by another WSE instance
 - 
destinationNameprotected String destinationName Name of the target destination; e.g. "wowzavideo", "akamai", "rtmp" (generic).
 - 
pushPublishSessionprotected IPushPublishSession pushPublishSession 
 - 
myMapprotected java.util.Map<String,String> myMap 
 
- 
 - 
Method Detail- 
initpublic 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:
- initin interface- IPushPublish
- Parameters:
- appInstance- the app instance
- streamName- the source stream name
- maps- the map entry params
- profileData- the profile params
- streamDebug- stream debug flag
 
 - 
updateUsageTrackerpublic void updateUsageTracker() - Specified by:
- updateUsageTrackerin interface- IPushPublish
 
 - 
getImplementationpublic String getImplementation() Gets the implementation.- Returns:
- the implementation
 
 - 
setImplementationpublic void setImplementation(String implementation) Sets the implementation.- Parameters:
- implementation- the new implementation
 
 - 
getPropertiespublic WMSProperties getProperties() Get properties.- Specified by:
- getPropertiesin interface- IPushPublish
- Returns:
- properties
 
 - 
getProfilepublic String getProfile() Get entry profile.- Specified by:
- getProfilein interface- IPushPublish
- Returns:
- map entry profile
 
 - 
setProfilepublic void setProfile(String profile) Set map file entry profile.- Specified by:
- setProfilein interface- IPushPublish
- Parameters:
- profile- map entry profile
 
 - 
getEntryNamepublic String getEntryName() Get map file entry name.- Specified by:
- getEntryNamein interface- IPushPublish
- Returns:
- map file entry name
 
 - 
setEntryNamepublic void setEntryName(String entryName) Set map file entry name.- Specified by:
- setEntryNamein interface- IPushPublish
- Parameters:
- entryName- map file entry name
 
 - 
isAdaptiveStreamingpublic boolean isAdaptiveStreaming() Checks if is adaptive streaming.- Returns:
- true, if is adaptive streaming
 
 - 
setAdaptiveStreamingpublic void setAdaptiveStreaming(boolean isAdaptiveStreaming) Sets the adaptive streaming.- Parameters:
- isAdaptiveStreaming- the new adaptive streaming
 
 - 
setAdaptiveStreamingpublic void setAdaptiveStreaming(String adaptiveStreamingStr) 
 - 
getUserNamepublic String getUserName() Gets the user name.- Returns:
- the user name
 
 - 
setUserNamepublic void setUserName(String userName) Set user name.- Parameters:
- userName- user name
 
 - 
getPasswordpublic String getPassword() Get password.- Returns:
- password
 
 - 
setPasswordpublic void setPassword(String password) Set password.- Parameters:
- password- password
 
 - 
getAppInstancepublic IApplicationInstance getAppInstance() Get appInstance interface.- Returns:
- appInstance interface
 
 - 
setAppInstancepublic void setAppInstance(IApplicationInstance appInstance) Set appInstance interface.- Parameters:
- appInstance- appInstance interface
 
 - 
getSrcStreamNamepublic String getSrcStreamName() Get source stream name.- Specified by:
- getSrcStreamNamein interface- IPushPublish
- Returns:
- source stream name
 
 - 
setSrcStreamNamepublic void setSrcStreamName(String srcStreamName) Set source stream name.- Specified by:
- setSrcStreamNamein interface- IPushPublish
- Parameters:
- srcStreamName- source stream name
 
 - 
getDstStreamNamepublic String getDstStreamName() Get destination stream name.- Specified by:
- getDstStreamNamein interface- IPushPublish
- Returns:
- destination stream name
 
 - 
setDstStreamNamepublic void setDstStreamName(String dstStreamName) Set destination stream name.- Specified by:
- setDstStreamNamein interface- IPushPublish
- Parameters:
- dstStreamName- destination stream name
 
 - 
setStreamNamepublic void setStreamName(String streamName) Sets the stream name.- Specified by:
- setStreamNamein interface- IPushPublish
- Parameters:
- streamName- the new stream name
 
 - 
getHostnamepublic String getHostname() Get destination server host name.- Specified by:
- getHostnamein interface- IPushPublish
- Returns:
- destination server host name
 
 - 
setHostpublic void setHost(String hostname) Set destination server host name.- Specified by:
- setHostin interface- IPushPublish
- Parameters:
- hostname- destination server host name
 
 - 
setHostnamepublic void setHostname(String hostname) - Specified by:
- setHostnamein interface- IPushPublish
 
 - 
getPlaybackHostnamepublic String getPlaybackHostname() Get playback server host name.- Returns:
- playback server host name
 
 - 
setPlaybackHostnamepublic void setPlaybackHostname(String playbackHostname) Set playback server host name.- Parameters:
- playbackHostname- playback server host name
 
 - 
getPortpublic int getPort() Get destination server port.- Specified by:
- getPortin interface- IPushPublish
- Returns:
- destination server port
 
 - 
setPortpublic void setPort(int port) Set destination server port.- Specified by:
- setPortin interface- IPushPublish
- Parameters:
- port- destination server port
 
 - 
setPortpublic void setPort(String port) Set destination server port.- Specified by:
- setPortin interface- IPushPublish
- Parameters:
- port- destination server port
 
 - 
setDestinationServerpublic void setDestinationServer(String destinationServer) Set destination server.- Parameters:
- destinationServer- destination server
 
 - 
getDestinationServerpublic int getDestinationServer() Get destination server. return destination server
 - 
setDestinationServerpublic void setDestinationServer(int destinationServer) Set destination server.- Parameters:
- destinationServer- destination server
 
 - 
isExternalRedundancypublic boolean isExternalRedundancy() Is there an redundant stream being pushed by an external WSE instance? return true or false
 - 
setExternalRedundancypublic void setExternalRedundancy(boolean isExternalRedundancy) Set whether there is an external redundant stream.- Parameters:
- isExternalRedundancy-
 
 - 
setExternalRedundancypublic void setExternalRedundancy(String externalRedundancy) 
 - 
getDestinationNamepublic String getDestinationName() Get destination name.- Specified by:
- getDestinationNamein interface- IPushPublish
- Returns:
- destination name
 
 - 
setDestinationNamepublic void setDestinationName(String destinationName) Set destination name.- Specified by:
- setDestinationNamein interface- IPushPublish
- Parameters:
- destinationName- destination name
 
 - 
getWowzaStreamingEngineVersionStrpublic static String getWowzaStreamingEngineVersionStr() Gets the server version str.- Returns:
- the server version str
 
 - 
loadpublic void load(java.util.HashMap<String,String> dataMap) Loads map and profile parameters- Parameters:
- dataMap- the data map
 
 - 
getReconnectWaitTimepublic int getReconnectWaitTime() Get the reconnect wait time (milliseconds). Shortest time between connection attempts.- Specified by:
- getReconnectWaitTimein interface- IPushPublish
- Returns:
- reconnect wait time (milliseconds)
 
 - 
setReconnectWaitTimepublic void setReconnectWaitTime(int reconnectWaitTime) Set the reconnect wait time (milliseconds). Shortest time between connection attempts.- Specified by:
- setReconnectWaitTimein interface- IPushPublish
- Parameters:
- reconnectWaitTime- reconnect wait time (milliseconds)
 
 - 
getBandwidthpublic double getBandwidth() 
 - 
getInetAddrpublic java.net.InetAddress getInetAddr() - Returns:
- the inetAddr
 
 - 
setInetAddrpublic void setInetAddr(java.net.InetAddress inetAddr) - Parameters:
- inetAddr- the inetAddr to set
 
 - 
getPushPublishTypepublic int getPushPublishType() - Specified by:
- getPushPublishTypein interface- IPushPublish
 
 - 
createPushPublishSessionpublic IPushPublishSession createPushPublishSession() - Specified by:
- createPushPublishSessionin interface- IPushPublish
 
 - 
getSrcStreampublic IMediaStream getSrcStream() Get source IMediaStream.- Specified by:
- getSrcStreamin interface- IPushPublish
- Returns:
- source IMediaStream
 
 - 
setSrcStreampublic void setSrcStream(IMediaStream srcStream) Sets the source IMediaStream.- Specified by:
- setSrcStreamin interface- IPushPublish
- Parameters:
- srcStream- the source IMediaStream
 
 - 
getMappublic java.util.Map<String,String> getMap() - Specified by:
- getMapin interface- IPushPublish
 
 - 
getBaseParamspublic java.util.Map<String,String> getBaseParams() 
 - 
incrementMessagesOutpublic void incrementMessagesOut(long bytes) 
 - 
getMessagesOutBytespublic long getMessagesOutBytes() 
 - 
getMessagesOutCountpublic long getMessagesOutCount() 
 - 
addpublic void add(IOPerformanceCounter totalValue) 
 - 
addIOPerformance2public void addIOPerformance2(IOPerformanceCounter totalIOPerformanceResult) 
 - 
getDestinationIDpublic int getDestinationID() Get destination ID. A return value of 0 means the destination ID cannot be determined.- Specified by:
- getDestinationIDin interface- IPushPublish
- Returns:
- destination ID
 
 - 
getContextStrpublic abstract String getContextStr() - Specified by:
- getContextStrin interface- IPushPublish
 
 - 
updateLoggingValuesprotected 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
 
 - 
clearLoggingValuesprotected 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.
 - 
isDebugLogpublic boolean isDebugLog() - Specified by:
- isDebugLogin interface- IPushPublish
 
 - 
setDebugLogpublic void setDebugLog(boolean debugLog) Set debug logging.- Specified by:
- setDebugLogin interface- IPushPublish
- Parameters:
- debugLog- debug logging
 
 - 
logDebugpublic void logDebug(String methodName, String log)
 - 
logInfopublic void logInfo(String methodName, String log)
 - 
logWarnpublic void logWarn(String methodName, String log)
 - 
logErrorpublic void logError(String methodName, String log)
 - 
logErrorpublic void logError(String methodName, String log, Throwable e)
 - 
logErrorpublic void logError(String methodName, Throwable e)
 - 
resolveHostNamepublic String resolveHostName() Resolve host name to connect to- Returns:
- hostname
 
 
- 
 
-