com.wowza.wms.server
Class Server

Object
  extended by com.wowza.wms.server.Server
All Implemented Interfaces:
IServer

public class Server
extends Object
implements IServer


Field Summary
static ILogNotify logNotifier
           
 
Constructor Summary
Server()
           
 
Method Summary
 void addServerListener(IServerNotify serverListener)
          Add server listener
 String decodeStorageDir(IVHost vhost, String storageDir)
           
 void doWatchdog()
           
 com.wowza.wms.admin.AdminAgent getAdminAgent()
           
 java.util.List getAdminInterfaceObjectList()
          Get the list of objects exposed through JMX interface
 com.wowza.util.RandomIdGenerator getClientIdGenerator()
          Get the client id generator for the server
 int getClientIdGeneratorRecycleDelaySize()
           
 int getClientIdGeneratorRecycleSize()
           
 long getClientIdGeneratorTimeout()
           
 Object getCommandInterface()
           
 HostPort getCommandInterfaceHostPort()
          Get the definition of the command interface
 long getCommittedVirtuallMemory()
           
 ConnectionCounter getConnectionCounter()
          Get the server connection counter.
 com.wowza.wms.client.ConnectionCounterSimple getConnectionCounter(int counterIndex)
          Get the server connection counter for a specific technology (see IVHost.COUNTER_*)
 IConnectionValidator getConnectionValidator()
           
 int getCoreHandlerPoolSize()
          Get the handler core thread pool size.
 int getCoreTransportPoolSize()
          Get the transport core thread pool size.
 int getCryptoPoolActiveCount()
           
 int getCryptoPoolMaxSize()
           
 long getCurrentHeapSize()
           
 String getDateStarted()
          Get the date and time the server was started.
 java.util.Properties getDynamicLogProperties()
          Get the dynamic log properties defined at the server level in conf/log4j.properties
 String getGUID()
           
 ThreadPool getHandlerThreadPool()
          Get the server handler thread pool.
static Server getInstance()
           
 IOPerformanceCounter getIoPerformanceCounter()
          Get the server performance counter.
 IOPerformanceCounter getIoPerformanceCounter(int counterIndex)
          Get the server performance counter for a specific technology (see IVHost.COUNTER_*)
 com.wowza.wms.server.JMXRemoteConfig getJmxRemoteConfig()
           
 long getLiveThreads()
           
 long getMaxHeapSize()
           
 long getPeakThreads()
           
 WMSProperties getProperties()
          Get server level properties collection
 String getSessionGUID()
           
 ThreadPool getThreadPool()
          Get the server handler thread pool.
 String getTimeRunning()
          Get a formatted String of how long the server has been running.
 double getTimeRunningSeconds()
          Get time running in seconds
 ThreadPool getTransportThreadPool()
          Get the server transport thread pool.
 com.wowza.wms.transport.udp.UDPPortManager getUDPPortManager()
          Get the UDP port manager which manages the allocation of incoming UDP port binding to be sure there are not port conflicts
 com.wowza.wms.transport.udp.UDPPortSharingManager getUDPPortSharingManager()
          Get the UDP port sharing manager.
 String[] getUserAgents()
          Get a pipe "|" delimited list of user agents that the server recognizes as RTMPT client.
 String getVersion()
          Get server version number.
 VHostList getVHostList()
          Returns the interface to the VHostList for the server
 boolean isDynamicLogContextLoaded(String logContext)
          Returns true of the given dynamic log context is already loaded.
 boolean isSuspended()
          Is the server current suspended
static void main(String[] args)
           
 void onNewVHost(IVHost vhost)
           
 String readConfig(String sName)
          Method to read xml config file..
static String readXMLConfig(String sPath)
           
 void reloadVHostConfig()
          Reload the VHosts.xml file.
 void removeServerListener(IServerNotify serverListener)
          Remove server listener
 void setCommandInterface(Object commandInterface)
           
 void setCommandInterfaceHostPort(HostPort commandInterfaceHostPort)
          Set the definition for the command interface.
 void setCoreHandlerPoolSize(int corePoolSize)
          Set the handler core thread pool size.
 void setCoreTransportPoolSize(int corePoolSize)
          Set the transport core thread pool size.
 void setDynamicLogProperties(java.util.Properties dynamicLogProperties)
          Set the dynamic log properties set at the server level
 void setIoPerformanceCounter(IOPerformanceCounter ioPerformanceCounter)
           
 void setUserAgents(String[] userAgents)
          Set a pipe "|" delimited list of user agents that the server recognizes as RTMPT client.
static void start()
           
 void startCommandInterface()
          Start the command interface as defined in Server.xml.
 void startServer()
           
 void startVHost(String vhostName)
          Start a vHost by name.
 void startVHosts()
          Start all vHosts
 void stopAdminAgent()
          Stop the JMX interface
 void stopCommandInterface()
          Stop the command interface as defined in Server.xml.
 void stopServer()
           
 void stopVHost(String vhostName)
          Stop a vHost by name.
 void stopVHosts()
          Stop all vHosts
 void suspendAllVHosts()
          Suspend all virtual hosts (Calls IVHost.suspendAllHostPorts for each vhost)
 void suspendCommandInterface()
           
 void suspendServer()
          Suspend all virtual hosts and the command interface
 void unbindAllVHosts()
          Unbind all virtual hosts (Calls IVHost.unbindAllHostPorts for each vhost)
 IOPerformanceCounter updateIOPerformance()
           
 void updateLoggingDuration()
           
 boolean writeConfig(String sName, String data)
          Method to write xml config file..
static boolean writeXMLConfig(String sPath, String data)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logNotifier

public static ILogNotify logNotifier
Constructor Detail

Server

public Server()
Method Detail

addServerListener

public void addServerListener(IServerNotify serverListener)
Description copied from interface: IServer
Add server listener

Specified by:
addServerListener in interface IServer
Parameters:
serverListener - server listener

decodeStorageDir

public String decodeStorageDir(IVHost vhost,
                               String storageDir)

doWatchdog

public void doWatchdog()

getAdminAgent

public com.wowza.wms.admin.AdminAgent getAdminAgent()

getAdminInterfaceObjectList

public java.util.List getAdminInterfaceObjectList()
Description copied from interface: IServer
Get the list of objects exposed through JMX interface

Specified by:
getAdminInterfaceObjectList in interface IServer
Returns:
list of objects exposed through JMX interface

getClientIdGenerator

public com.wowza.util.RandomIdGenerator getClientIdGenerator()
Description copied from interface: IServer
Get the client id generator for the server

Specified by:
getClientIdGenerator in interface IServer
Returns:
client id generator for the server

getClientIdGeneratorRecycleDelaySize

public int getClientIdGeneratorRecycleDelaySize()

getClientIdGeneratorRecycleSize

public int getClientIdGeneratorRecycleSize()

getClientIdGeneratorTimeout

public long getClientIdGeneratorTimeout()

getCommandInterface

public Object getCommandInterface()

getCommandInterfaceHostPort

public HostPort getCommandInterfaceHostPort()
Description copied from interface: IServer
Get the definition of the command interface

Specified by:
getCommandInterfaceHostPort in interface IServer
Returns:
host port definition of command interface

getCommittedVirtuallMemory

public long getCommittedVirtuallMemory()

getConnectionCounter

public ConnectionCounter getConnectionCounter()
Description copied from interface: IServer
Get the server connection counter.

Specified by:
getConnectionCounter in interface IServer
Returns:
connection counter

getConnectionCounter

public com.wowza.wms.client.ConnectionCounterSimple getConnectionCounter(int counterIndex)
Description copied from interface: IServer
Get the server connection counter for a specific technology (see IVHost.COUNTER_*)

Specified by:
getConnectionCounter in interface IServer
Parameters:
counterIndex - counter index (see IVHost.COUNTER_*)
Returns:
connection counter

getConnectionValidator

public IConnectionValidator getConnectionValidator()

getCoreHandlerPoolSize

public int getCoreHandlerPoolSize()
Description copied from interface: IServer
Get the handler core thread pool size.

Specified by:
getCoreHandlerPoolSize in interface IServer
Returns:
default core thread pool size

getCoreTransportPoolSize

public int getCoreTransportPoolSize()
Description copied from interface: IServer
Get the transport core thread pool size.

Specified by:
getCoreTransportPoolSize in interface IServer
Returns:
default core thread pool size

getCryptoPoolActiveCount

public int getCryptoPoolActiveCount()

getCryptoPoolMaxSize

public int getCryptoPoolMaxSize()

getCurrentHeapSize

public long getCurrentHeapSize()

getDateStarted

public String getDateStarted()
Description copied from interface: IServer
Get the date and time the server was started.

Specified by:
getDateStarted in interface IServer
Returns:
date and time the server was started

getDynamicLogProperties

public java.util.Properties getDynamicLogProperties()
Description copied from interface: IServer
Get the dynamic log properties defined at the server level in conf/log4j.properties

Specified by:
getDynamicLogProperties in interface IServer
Returns:
dynamic log properties defined at the server level

getGUID

public String getGUID()

getHandlerThreadPool

public ThreadPool getHandlerThreadPool()
Description copied from interface: IServer
Get the server handler thread pool. This thread pool is used to process the incoming events.

Specified by:
getHandlerThreadPool in interface IServer
Returns:
server handler thread pool

getInstance

public static Server getInstance()

getIoPerformanceCounter

public IOPerformanceCounter getIoPerformanceCounter()
Description copied from interface: IServer
Get the server performance counter.

Specified by:
getIoPerformanceCounter in interface IServer
Returns:
io performance counter

getIoPerformanceCounter

public IOPerformanceCounter getIoPerformanceCounter(int counterIndex)
Description copied from interface: IServer
Get the server performance counter for a specific technology (see IVHost.COUNTER_*)

Specified by:
getIoPerformanceCounter in interface IServer
Parameters:
counterIndex - counter index (see IVHost.COUNTER_*)
Returns:
io performance counter

getJmxRemoteConfig

public com.wowza.wms.server.JMXRemoteConfig getJmxRemoteConfig()

getLiveThreads

public long getLiveThreads()

getMaxHeapSize

public long getMaxHeapSize()

getPeakThreads

public long getPeakThreads()

getProperties

public WMSProperties getProperties()
Description copied from interface: IServer
Get server level properties collection

Specified by:
getProperties in interface IServer
Returns:
server level properties collection

getSessionGUID

public String getSessionGUID()

getThreadPool

public ThreadPool getThreadPool()
Description copied from interface: IServer
Get the server handler thread pool. Same as getHandlerThreadPool.

Specified by:
getThreadPool in interface IServer
Returns:
server handler thread pool

getTimeRunning

public String getTimeRunning()
Description copied from interface: IServer
Get a formatted String of how long the server has been running.

Specified by:
getTimeRunning in interface IServer
Returns:
formatted String of how long the server has been running

getTimeRunningSeconds

public double getTimeRunningSeconds()
Description copied from interface: IServer
Get time running in seconds

Specified by:
getTimeRunningSeconds in interface IServer
Returns:
time running in seconds

getTransportThreadPool

public ThreadPool getTransportThreadPool()
Description copied from interface: IServer
Get the server transport thread pool. This thread pool is used to read/write data from the transports sockets.

Specified by:
getTransportThreadPool in interface IServer
Returns:
server transport thread pool

getUDPPortManager

public com.wowza.wms.transport.udp.UDPPortManager getUDPPortManager()
Description copied from interface: IServer
Get the UDP port manager which manages the allocation of incoming UDP port binding to be sure there are not port conflicts

Specified by:
getUDPPortManager in interface IServer
Returns:
UDP port manager

getUDPPortSharingManager

public com.wowza.wms.transport.udp.UDPPortSharingManager getUDPPortSharingManager()
Description copied from interface: IServer
Get the UDP port sharing manager.

Specified by:
getUDPPortSharingManager in interface IServer
Returns:
UDP port sharing manager

getUserAgents

public String[] getUserAgents()
Description copied from interface: IServer
Get a pipe "|" delimited list of user agents that the server recognizes as RTMPT client.

Specified by:
getUserAgents in interface IServer
Returns:
pipe "|" delimited list of user agents that the server recognizes as RTMPT client

getVersion

public String getVersion()
Description copied from interface: IServer
Get server version number.

Specified by:
getVersion in interface IServer
Returns:
server version number

getVHostList

public VHostList getVHostList()
Description copied from interface: IServer
Returns the interface to the VHostList for the server

Specified by:
getVHostList in interface IServer
Returns:
vhostList

isDynamicLogContextLoaded

public boolean isDynamicLogContextLoaded(String logContext)
Description copied from interface: IServer
Returns true of the given dynamic log context is already loaded. If not loaded it will return false and add it to the a Set of loaded log context. Log context is [VHost].[Application].[AppInstance]

Specified by:
isDynamicLogContextLoaded in interface IServer

isSuspended

public boolean isSuspended()
Description copied from interface: IServer
Is the server current suspended

Specified by:
isSuspended in interface IServer

main

public static void main(String[] args)

onNewVHost

public void onNewVHost(IVHost vhost)

readConfig

public String readConfig(String sName)
Description copied from interface: IServer
Method to read xml config file..

Specified by:
readConfig in interface IServer

readXMLConfig

public static String readXMLConfig(String sPath)

reloadVHostConfig

public void reloadVHostConfig()
Description copied from interface: IServer
Reload the VHosts.xml file. This method can be invoked through the JMX interface to manage vHosts while the server is running.

Specified by:
reloadVHostConfig in interface IServer

removeServerListener

public void removeServerListener(IServerNotify serverListener)
Description copied from interface: IServer
Remove server listener

Specified by:
removeServerListener in interface IServer
Parameters:
serverListener - server listener

setCommandInterface

public void setCommandInterface(Object commandInterface)

setCommandInterfaceHostPort

public void setCommandInterfaceHostPort(HostPort commandInterfaceHostPort)
Description copied from interface: IServer
Set the definition for the command interface.

Specified by:
setCommandInterfaceHostPort in interface IServer
Parameters:
commandInterfaceHostPort - host port definition of command interface

setCoreHandlerPoolSize

public void setCoreHandlerPoolSize(int corePoolSize)
Description copied from interface: IServer
Set the handler core thread pool size.

Specified by:
setCoreHandlerPoolSize in interface IServer
Parameters:
corePoolSize - core thread pool size

setCoreTransportPoolSize

public void setCoreTransportPoolSize(int corePoolSize)
Description copied from interface: IServer
Set the transport core thread pool size.

Specified by:
setCoreTransportPoolSize in interface IServer
Parameters:
corePoolSize - core thread pool size

setDynamicLogProperties

public void setDynamicLogProperties(java.util.Properties dynamicLogProperties)
Description copied from interface: IServer
Set the dynamic log properties set at the server level

Specified by:
setDynamicLogProperties in interface IServer
Parameters:
dynamicLogProperties - dynamic log properties defined at the server level

setIoPerformanceCounter

public void setIoPerformanceCounter(IOPerformanceCounter ioPerformanceCounter)

setUserAgents

public void setUserAgents(String[] userAgents)
Description copied from interface: IServer
Set a pipe "|" delimited list of user agents that the server recognizes as RTMPT client.

Specified by:
setUserAgents in interface IServer
Parameters:
userAgents - pipe "|" delimited list of user agents that the server recognizes as RTMPT client

start

public static void start()

startCommandInterface

public void startCommandInterface()
Description copied from interface: IServer
Start the command interface as defined in Server.xml. The command interface is used by shutdown.sh script to stop the server. It is also used by ant task to stop and start the server on build events.

Specified by:
startCommandInterface in interface IServer

startServer

public void startServer()

startVHost

public void startVHost(String vhostName)
Description copied from interface: IServer
Start a vHost by name.

Specified by:
startVHost in interface IServer
Parameters:
vhostName - vHost name

startVHosts

public void startVHosts()
Description copied from interface: IServer
Start all vHosts

Specified by:
startVHosts in interface IServer

stopAdminAgent

public void stopAdminAgent()
Description copied from interface: IServer
Stop the JMX interface

Specified by:
stopAdminAgent in interface IServer

stopCommandInterface

public void stopCommandInterface()
Description copied from interface: IServer
Stop the command interface as defined in Server.xml. The command interface is used by shutdown.sh script to stop the server. It is also used by ant task to stop and start the server on build events.

Specified by:
stopCommandInterface in interface IServer

stopServer

public void stopServer()

stopVHost

public void stopVHost(String vhostName)
Description copied from interface: IServer
Stop a vHost by name.

Specified by:
stopVHost in interface IServer
Parameters:
vhostName - vHost name

stopVHosts

public void stopVHosts()
Description copied from interface: IServer
Stop all vHosts

Specified by:
stopVHosts in interface IServer

suspendAllVHosts

public void suspendAllVHosts()
Description copied from interface: IServer
Suspend all virtual hosts (Calls IVHost.suspendAllHostPorts for each vhost)

Specified by:
suspendAllVHosts in interface IServer

suspendCommandInterface

public void suspendCommandInterface()

suspendServer

public void suspendServer()
Description copied from interface: IServer
Suspend all virtual hosts and the command interface

Specified by:
suspendServer in interface IServer

unbindAllVHosts

public void unbindAllVHosts()
Description copied from interface: IServer
Unbind all virtual hosts (Calls IVHost.unbindAllHostPorts for each vhost)

Specified by:
unbindAllVHosts in interface IServer

updateIOPerformance

public IOPerformanceCounter updateIOPerformance()

updateLoggingDuration

public void updateLoggingDuration()

writeConfig

public boolean writeConfig(String sName,
                           String data)
Description copied from interface: IServer
Method to write xml config file..

Specified by:
writeConfig in interface IServer

writeXMLConfig

public static boolean writeXMLConfig(String sPath,
                                     String data)