Override publish to remap a stream name with the Wowza Streaming Engine Java API

The following Wowza Streaming Engine™ Java API code example shows how to change the name of the stream being published. In this example, the stream named myStream is changed to yourStream.

package com.wowza.wms.example.module;

import com.wowza.wms.amf.*;
import com.wowza.wms.client.*;
import com.wowza.wms.module.*;
import com.wowza.wms.request.*;
import com.wowza.wms.stream.*;

public class ModuleOverridePublishRemapStream extends ModuleBase {

	public void publish(IClient client, RequestFunction function,
	        AMFDataList params) {
		getLogger().info("Overriding Publish");

		String streamName = getParamString(params, PARAM1);

		if (streamName.startsWith("myStream"))
				params.set(PARAM1, "yourStream");

		invokePrevious(client, function, params);
	}

public void releaseStream(IClient client, RequestFunction function, AMFDataList params)
	{
		String streamName = getParamString(params, PARAM1);

		if (streamName.startsWith("myStream"))
				params.set(PARAM1, "yourStream");

		invokePrevious(client, function, params);
	}

}