You can use JMX as shown here. This is how to setup JMX command line interface that you can use in your integration
Or you could use an HTTPProvider. This should provide the basic functionality found in the Module
package test;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import com.wowza.wms.application.IApplicationInstance;
import com.wowza.wms.http.*;
import com.wowza.wms.logging.*;
import com.wowza.wms.plugin.collection.serverlistener.ServerListenerStreamPublisher;
import com.wowza.wms.server.Server;
import com.wowza.wms.stream.publish.Stream;
import com.wowza.wms.vhost.*;
public class HTTPReloadSchedule extends HTTProvider2Base {
public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp) {
if (!doHTTPAuthentication(vhost, req, resp))
return;
final String PROP_NAME_PREFIX = "streamPublisher";
req.parseBodyForParams(true);
Map<String, List<String>> params = req.getParameterMap();
String action = "";
String app = "";
String report = "Nothing to do";
ServerListenerStreamPublisher streamPublisher;
IApplicationInstance appInstance = null;
WMSLogger logger;
streamPublisher = (ServerListenerStreamPublisher)Server.getInstance().getProperties().get(ServerListenerStreamPublisher.PROP_STREAMPUBLISHER);
if (params.containsKey("action"))
action = params.get("action").get(0);
if (params.containsKey("app"))
{
app = params.get("app").get(0);
}
if (vhost.applicationExists(app)) {
appInstance = vhost.getApplication(app).getAppInstance("_definst_");
}
if (action.equalsIgnoreCase("load"))
{
try {
streamPublisher.loadSchedule(appInstance);
report = "Schedule Loaded";
}
catch (Exception e) {
e.printStackTrace();
report = "Load Schedule Error: " + e.getMessage();
}
}
else if (action.equalsIgnoreCase("unload"))
{
Map<String, Stream> streams = (Map<String, Stream>)appInstance.getProperties().remove(PROP_NAME_PREFIX + "Streams");
if(streams != null)
{
for(Stream stream : streams.values())
{
streamPublisher.shutdownStream(appInstance, stream);
}
streams.clear();
}
report = "Schedule Unloaded";
}
String retStr = "<html><head><title>Schedule Loader</title></head><body><h1>Schedule Loader</h1>" + report + "</body></html>";
try {
OutputStream out = resp.getOutputStream();
byte[] outBytes = retStr.getBytes();
out.write(outBytes);
} catch (Exception e) {
WMSLoggerFactory.getLogger(null).error(
"MediaCasterHTTP: " + e.toString());
}
}
}
If added to the first /conf/VHost.xml /HostPort (IpAddress 1935), make it 2nd to last HTTPProvider:
<HTTPProvider>
<BaseClass>test.HTTPReloadSchedule</BaseClass>
<RequestFilters>scheduleloader*</RequestFilters>
<AuthenticationMethod>none</AuthenticationMethod>
</HTTPProvider>
Call like this:
http://[wowza-address]:1935/scheduleloader?action=load&app=live
Unload like this:
http://[wowza-address]:1935/scheduleloader?action=unload&app=live
Richard