Class PushPublishBase

    • Field Detail

      • 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).
      • 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.
      • 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.
      • 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).
      • myMap

        protected java.util.Map<String,​String> myMap
    • Constructor Detail

      • PushPublishBase

        public PushPublishBase()
                        throws com.wowza.wms.server.LicensingException
        Instantiates a new push publisher base.
        Throws:
        com.wowza.wms.server.LicensingException
    • 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 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
      • getImplementation

        public String getImplementation()
        Gets the implementation.
        Returns:
        the implementation
      • setImplementation

        public void setImplementation​(String implementation)
        Sets the implementation.
        Parameters:
        implementation - the new implementation
      • getProfile

        public String getProfile()
        Get entry profile.
        Specified by:
        getProfile in interface IPushPublish
        Returns:
        map entry profile
      • setProfile

        public void setProfile​(String profile)
        Set map file entry profile.
        Specified by:
        setProfile in interface IPushPublish
        Parameters:
        profile - map entry profile
      • getEntryName

        public String getEntryName()
        Get map file entry name.
        Specified by:
        getEntryName in interface IPushPublish
        Returns:
        map file entry name
      • setEntryName

        public void setEntryName​(String entryName)
        Set map file entry name.
        Specified by:
        setEntryName in interface IPushPublish
        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 interface IPushPublish
        Returns:
        source stream name
      • setSrcStreamName

        public void setSrcStreamName​(String srcStreamName)
        Set source stream name.
        Specified by:
        setSrcStreamName in interface IPushPublish
        Parameters:
        srcStreamName - source stream name
      • getDstStreamName

        public String getDstStreamName()
        Get destination stream name.
        Specified by:
        getDstStreamName in interface IPushPublish
        Returns:
        destination stream name
      • setDstStreamName

        public void setDstStreamName​(String dstStreamName)
        Set destination stream name.
        Specified by:
        setDstStreamName in interface IPushPublish
        Parameters:
        dstStreamName - destination stream name
      • setStreamName

        public void setStreamName​(String streamName)
        Sets the stream name.
        Specified by:
        setStreamName in interface IPushPublish
        Parameters:
        streamName - the new stream name
      • getHostname

        public String getHostname()
        Get destination server host name.
        Specified by:
        getHostname in interface IPushPublish
        Returns:
        destination server host name
      • setHost

        public void setHost​(String hostname)
        Set destination server host name.
        Specified by:
        setHost in interface IPushPublish
        Parameters:
        hostname - destination server host name
      • 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 interface IPushPublish
        Returns:
        destination server port
      • setPort

        public void setPort​(int port)
        Set destination server port.
        Specified by:
        setPort in interface IPushPublish
        Parameters:
        port - destination server port
      • setPort

        public void setPort​(String port)
        Set destination server port.
        Specified by:
        setPort in interface IPushPublish
        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 interface IPushPublish
        Returns:
        destination name
      • setDestinationName

        public void setDestinationName​(String destinationName)
        Set destination name.
        Specified by:
        setDestinationName in interface IPushPublish
        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 interface IPushPublish
        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 interface IPushPublish
        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
      • setSrcStream

        public void setSrcStream​(IMediaStream srcStream)
        Sets the source IMediaStream.
        Specified by:
        setSrcStream in interface IPushPublish
        Parameters:
        srcStream - the source IMediaStream
      • getMap

        public java.util.Map<String,​String> getMap()
        Specified by:
        getMap in interface IPushPublish
      • getBaseParams

        public java.util.Map<String,​String> getBaseParams()
      • incrementMessagesOut

        public void incrementMessagesOut​(long bytes)
      • getMessagesOutBytes

        public long getMessagesOutBytes()
      • getMessagesOutCount

        public long getMessagesOutCount()
      • 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 interface IPushPublish
        Returns:
        destination ID
      • 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.
      • setDebugLog

        public void setDebugLog​(boolean debugLog)
        Set debug logging.
        Specified by:
        setDebugLog in interface IPushPublish
        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