Control access to Microsoft Smooth Streaming with the Wowza Streaming Engine Java API

The following smoothstreaming example module illustrates how to use the Wowza Streaming Engine™ Java API for controlling access to a Microsoft Smooth Streaming stream.

package com.wowza.wms.example.module;

import com.wowza.wms.application.IApplicationInstance;
import com.wowza.wms.httpstreamer.smoothstreaming.httpstreamer.*;
import com.wowza.wms.module.*;

public class ModuleAccessControlSmoothStreaming extends ModuleBase
{
	public void onHTTPSmoothStreamingSessionCreate(HTTPStreamerSessionSmoothStreamer httpSmoothStreamingSession)
	{
		boolean isGood = true;

		String ipAddressClient = httpCupertinoStreamingSession.getIpAddress();
		String ipAddressServer = httpCupertinoStreamingSession.getServerIp();
		String queryStr = httpSmoothStreamingSession.getQueryStr();
		String referrer = httpSmoothStreamingSession.getReferrer();
		String cookieStr = httpSmoothStreamingSession.getCookieStr();
		String userAgent = httpSmoothStreamingSession.getUserAgent();

		IApplicationInstance appInstance = httpSmoothStreamingSession.getAppInstance();
		String streamName = httpSmoothStreamingSession.getStreamName();

		// Here you can use the request and session information above to determine 
		// if you want to reject the connection
		// isGood = true/false;
		getLogger().info("ModuleAccessControlSmoothStreaming.onHTTPSmoothStreamingSessionCreate["+appInstance.getContextStr()+":"+streamName+"]: accept:"+isGood);

		if (!isGood)
			httpSmoothStreamingSession.rejectSession();
	}

}