Control access to Adobe HDS streaming with the Wowza Streaming Engine Java API

The following sanjosestreaming example module illustrates how to use the API for controlling access to an Adobe HDS stream.

package com.wowza.wms.example.module;

import com.wowza.wms.httpstreamer.sanjosestreaming.httpstreamer.HTTPStreamerSessionSanJose;
import com.wowza.wms.module.*;
import com.wowza.wms.application.*;

public class ModuleAccessControlSanJoseStreaming extends ModuleBase
{
public void onHTTPSanJoseStreamingSessionCreate(HTTPStreamerSessionSanJose httpSanJoseStreamingSession)
{
boolean isGood = true;

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

	IApplicationInstance appInstance = httpSanJoseStreamingSession.getAppInstance();
	String streamName = httpSanJoseStreamingSession.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("ModuleAccessControlCupertinoStreaming.onHTTPCupertinoStreamingSessionCreate["+appInstance.getContextStr()+":"+streamName+"]: accept:"+isGood);

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

<Module>
	<Name>ModuleAccessControlSanJoseStreaming</Name>
	<Description>ModuleAccessControlSanJoseStreaming</Description>
	<Class>com.wowza.wms.example.module.ModuleAccessControlSanJoseStreaming</Class>
</Module>