Package com.wowza.wms.module
Class ModuleBase
- Object
- 
- com.wowza.wms.module.ModuleBase
 
- 
- Direct Known Subclasses:
- ModuleClientLogging,- ModuleCore,- ModuleMediaCaster
 
 public abstract class ModuleBase extends ObjectModuleBase: Base class that all server side modules should extend. Provides basic utility functionality for handling function parameters and return data. Also provides a simplified API for logging. 
- 
- 
Field SummaryFields Modifier and Type Field Description static intCALLBACK_PARAM1Callback param: param1static intCALLBACK_PARAM10Callback param: param10static intCALLBACK_PARAM2Callback param: param2static intCALLBACK_PARAM3Callback param: param3static intCALLBACK_PARAM4Callback param: param4static intCALLBACK_PARAM5Callback param: param5static intCALLBACK_PARAM6Callback param: param6static intCALLBACK_PARAM7Callback param: param7static intCALLBACK_PARAM8Callback param: param8static intCALLBACK_PARAM9Callback param: param9static intPARAM1Method param: param1static intPARAM10Method param: param10static intPARAM2Method param: param2static intPARAM3Method param: param3static intPARAM4Method param: param4static intPARAM5Method param: param5static intPARAM6Method param: param6static intPARAM7Method param: param7static intPARAM8Method param: param8static intPARAM9Method param: param9static intPARAMMETHODNAMEMethod: method namestatic intPLAYTRANSITION_APPENDstatic intPLAYTRANSITION_APPEND_IMMEDIATEstatic intPLAYTRANSITION_RESETstatic intPLAYTRANSITION_RESET_IMMEDIATEstatic intPLAYTRANSITION_STOPstatic intPLAYTRANSITION_SWAPstatic intPLAYTRANSITION_SWITCHstatic intPLAYTRANSITION_UNKNOWNstatic StringPLAYTRANSITIONSTR_APPENDPlay2 transition: APPENDstatic StringPLAYTRANSITIONSTR_RESETPlay2 transition: RESETstatic StringPLAYTRANSITIONSTR_STOPPlay2 transition: STOPstatic StringPLAYTRANSITIONSTR_SWAPPlay2 transition: SWAPstatic StringPLAYTRANSITIONSTR_SWITCHPlay2 transition: SWITCHstatic StringPLAYTRANSITIONSTR_UNKNOWNPlay2 transition: UNKNOWN
 - 
Constructor SummaryConstructors Constructor Description ModuleBase()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static IApplicationInstancegetAppInstance(IClient client)Get applicationInstace of a client.protected static IApplicationgetApplication(IClient client)Get application of a client.protected static intgetCallbackParamCount(AMFDataList params)Get the total number of parameters passed to callback.protected static WMSLoggergetLogger()Get the logging interface.protected static WMSLoggergetLogger(Class classObj)Get the logging interface.protected static WMSLoggergetLogger(Class classObj, IApplicationInstance appInstance)Get the logging interface.protected static AMFDatagetParam(AMFDataList params, int index)Get parameter by index.protected static booleangetParamBoolean(AMFDataList params, int index)Get parameter by index, Return as boolean.protected static booleangetParamBoolean(AMFDataList params, int index, boolean defaultVal)Get parameter by index, Return as boolean.protected static intgetParamCount(AMFDataList params)Get the total number of parameters passed to method.protected static java.util.DategetParamDate(AMFDataList params, int index)Get parameter by index, Return as Date.protected static doublegetParamDouble(AMFDataList params, int index)Get parameter by index, Return as double.protected static doublegetParamDouble(AMFDataList params, int index, double defaultVal)Get parameter by index, Return as double.protected static intgetParamInt(AMFDataList params, int index)Get parameter by index, Return as int.protected static intgetParamInt(AMFDataList params, int index, int defaultVal)Get parameter by index, Return as int.protected static longgetParamLong(AMFDataList params, int index)Get parameter by index, Return as long.protected static longgetParamLong(AMFDataList params, int index, long defaultVal)Get parameter by index, Return as long.protected static AMFDataMixedArraygetParamMixedArray(AMFDataList params, int index)Get parameter by index, Return as AMFDataMixedArray.protected static AMFDataObjgetParamObj(AMFDataList params, int index)Get parameter by index, Return as Object.protected static StringgetParamString(AMFDataList params, int index)Get parameter by index, Return as String.protected static StringgetParamString(AMFDataList params, int index, String defaultVal)Get parameter by index, Return as String.protected static intgetParamType(AMFDataList params, int index)Get parameter type.protected static IMediaStreamgetStream(IClient client, com.wowza.wms.request.RequestFunction function)For methods called from the client side object NetStream (publish, play, deleteStream) get the IMediaStream object associated with the call.protected static IVHostgetVHost(IClient client)Get vHost of a client.protected voidinvokePrevious(IClient client, com.wowza.wms.request.RequestFunction function, AMFDataList params)Wowza Pro will determine command priority based on the order of the modules in the module list.protected static voidinvokePrevious(Object instance, IClient client, com.wowza.wms.request.RequestFunction function, AMFDataList params)Wowza Pro will determine command priority based on the order of the modules in the module list.protected static booleanisSendResult(AMFDataList params)Is this method call expecting sendResult to be called.protected static voidsendClientOnStatusError(IClient client, String code, String description)Send an error message to the client-side client.onStatus handlerprotected static booleansendResult(IClient client, AMFDataList params, boolean value)Send a result to client method call as a single boolean value.protected static booleansendResult(IClient client, AMFDataList params, double value)Send a result to client method call as a single double value.protected static booleansendResult(IClient client, AMFDataList params, int value)Send a result to client method call as a single int value.protected static booleansendResult(IClient client, AMFDataList params, AMFData data)Send a result to client method call as a AMFData object.protected static booleansendResult(IClient client, AMFDataList params, String value)Send a result to client method call as a single String value.protected static voidsendStreamOnStatusError(IMediaStream stream, String code, String description)Send an error to the client-side NetStream.onStatus handler
 
- 
- 
- 
Field Detail- 
PARAMMETHODNAMEpublic static final int PARAMMETHODNAME Method: method name- See Also:
- Constant Field Values
 
 - 
PARAM1public static final int PARAM1 Method param: param1- See Also:
- Constant Field Values
 
 - 
PARAM2public static final int PARAM2 Method param: param2- See Also:
- Constant Field Values
 
 - 
PARAM3public static final int PARAM3 Method param: param3- See Also:
- Constant Field Values
 
 - 
PARAM4public static final int PARAM4 Method param: param4- See Also:
- Constant Field Values
 
 - 
PARAM5public static final int PARAM5 Method param: param5- See Also:
- Constant Field Values
 
 - 
PARAM6public static final int PARAM6 Method param: param6- See Also:
- Constant Field Values
 
 - 
PARAM7public static final int PARAM7 Method param: param7- See Also:
- Constant Field Values
 
 - 
PARAM8public static final int PARAM8 Method param: param8- See Also:
- Constant Field Values
 
 - 
PARAM9public static final int PARAM9 Method param: param9- See Also:
- Constant Field Values
 
 - 
PARAM10public static final int PARAM10 Method param: param10- See Also:
- Constant Field Values
 
 - 
CALLBACK_PARAM1public static final int CALLBACK_PARAM1 Callback param: param1- See Also:
- Constant Field Values
 
 - 
CALLBACK_PARAM2public static final int CALLBACK_PARAM2 Callback param: param2- See Also:
- Constant Field Values
 
 - 
CALLBACK_PARAM3public static final int CALLBACK_PARAM3 Callback param: param3- See Also:
- Constant Field Values
 
 - 
CALLBACK_PARAM4public static final int CALLBACK_PARAM4 Callback param: param4- See Also:
- Constant Field Values
 
 - 
CALLBACK_PARAM5public static final int CALLBACK_PARAM5 Callback param: param5- See Also:
- Constant Field Values
 
 - 
CALLBACK_PARAM6public static final int CALLBACK_PARAM6 Callback param: param6- See Also:
- Constant Field Values
 
 - 
CALLBACK_PARAM7public static final int CALLBACK_PARAM7 Callback param: param7- See Also:
- Constant Field Values
 
 - 
CALLBACK_PARAM8public static final int CALLBACK_PARAM8 Callback param: param8- See Also:
- Constant Field Values
 
 - 
CALLBACK_PARAM9public static final int CALLBACK_PARAM9 Callback param: param9- See Also:
- Constant Field Values
 
 - 
CALLBACK_PARAM10public static final int CALLBACK_PARAM10 Callback param: param10- See Also:
- Constant Field Values
 
 - 
PLAYTRANSITIONSTR_APPENDpublic static final String PLAYTRANSITIONSTR_APPEND Play2 transition: APPEND- See Also:
- Constant Field Values
 
 - 
PLAYTRANSITIONSTR_RESETpublic static final String PLAYTRANSITIONSTR_RESET Play2 transition: RESET- See Also:
- Constant Field Values
 
 - 
PLAYTRANSITIONSTR_STOPpublic static final String PLAYTRANSITIONSTR_STOP Play2 transition: STOP- See Also:
- Constant Field Values
 
 - 
PLAYTRANSITIONSTR_SWAPpublic static final String PLAYTRANSITIONSTR_SWAP Play2 transition: SWAP- See Also:
- Constant Field Values
 
 - 
PLAYTRANSITIONSTR_SWITCHpublic static final String PLAYTRANSITIONSTR_SWITCH Play2 transition: SWITCH- See Also:
- Constant Field Values
 
 - 
PLAYTRANSITIONSTR_UNKNOWNpublic static final String PLAYTRANSITIONSTR_UNKNOWN Play2 transition: UNKNOWN- See Also:
- Constant Field Values
 
 - 
PLAYTRANSITION_APPENDpublic static final int PLAYTRANSITION_APPEND - See Also:
- Constant Field Values
 
 - 
PLAYTRANSITION_RESETpublic static final int PLAYTRANSITION_RESET - See Also:
- Constant Field Values
 
 - 
PLAYTRANSITION_APPEND_IMMEDIATEpublic static final int PLAYTRANSITION_APPEND_IMMEDIATE - See Also:
- Constant Field Values
 
 - 
PLAYTRANSITION_RESET_IMMEDIATEpublic static final int PLAYTRANSITION_RESET_IMMEDIATE - See Also:
- Constant Field Values
 
 - 
PLAYTRANSITION_STOPpublic static final int PLAYTRANSITION_STOP - See Also:
- Constant Field Values
 
 - 
PLAYTRANSITION_SWAPpublic static final int PLAYTRANSITION_SWAP - See Also:
- Constant Field Values
 
 - 
PLAYTRANSITION_SWITCHpublic static final int PLAYTRANSITION_SWITCH - See Also:
- Constant Field Values
 
 - 
PLAYTRANSITION_UNKNOWNpublic static final int PLAYTRANSITION_UNKNOWN - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getParamCountprotected static int getParamCount(AMFDataList params) Get the total number of parameters passed to method.- Parameters:
- params- parameters
- Returns:
- total number of parameters
 
 - 
getCallbackParamCountprotected static int getCallbackParamCount(AMFDataList params) Get the total number of parameters passed to callback.- Parameters:
- params- parameters
- Returns:
- total number of parameters
 
 - 
getParamTypeprotected static int getParamType(AMFDataList params, int index) Get parameter type.- Parameters:
- params- parameters
- index- parameter index
- Returns:
- parameter type (AMFData.DATA_TYPE_*)
 
 - 
getParamprotected static AMFData getParam(AMFDataList params, int index) Get parameter by index. Return as AMFData object.- Parameters:
- params- parameters
- index- parameter index
- Returns:
- parameter value as AMFData object, null if out of bounds
 
 - 
getParamMixedArrayprotected static AMFDataMixedArray getParamMixedArray(AMFDataList params, int index) Get parameter by index, Return as AMFDataMixedArray.- Parameters:
- params- parameters
- index- parameter index
- Returns:
- parameter value as AMFDataMixedArray object, null if out of bounds
 
 - 
getParamObjprotected static AMFDataObj getParamObj(AMFDataList params, int index) Get parameter by index, Return as Object.- Parameters:
- params- parameters
- index- parameter index
- Returns:
- parameter value as Object object, null if out of bounds
 
 - 
getParamStringprotected static String getParamString(AMFDataList params, int index) Get parameter by index, Return as String.- Parameters:
- params- parameters
- index- parameter index
- Returns:
- parameter value as String object, null if out of bounds
 
 - 
getParamStringprotected static String getParamString(AMFDataList params, int index, String defaultVal) Get parameter by index, Return as String.- Parameters:
- params- parameters
- index- parameter index
- defaultVal- default value
- Returns:
- parameter value as String object, defaultVal if out of bounds
 
 - 
getParamDateprotected static java.util.Date getParamDate(AMFDataList params, int index) Get parameter by index, Return as Date.- Parameters:
- params- parameters
- index- parameter index
- Returns:
- parameter value as Date object, null if out of bounds
 
 - 
getParamIntprotected static int getParamInt(AMFDataList params, int index) Get parameter by index, Return as int.- Parameters:
- params- parameters
- index- parameter index
- Returns:
- parameter value as int, 0 if out of bounds
 
 - 
getParamIntprotected static int getParamInt(AMFDataList params, int index, int defaultVal) Get parameter by index, Return as int.- Parameters:
- params- parameters
- index- parameter index
- defaultVal- default value
- Returns:
- parameter value as int, defaultVal if out of bounds
 
 - 
getParamDoubleprotected static double getParamDouble(AMFDataList params, int index) Get parameter by index, Return as double.- Parameters:
- params- parameters
- index- parameter index
- Returns:
- parameter value as double, 0 if out of bounds
 
 - 
getParamDoubleprotected static double getParamDouble(AMFDataList params, int index, double defaultVal) Get parameter by index, Return as double.- Parameters:
- params- parameters
- index- parameter index
- defaultVal- default value
- Returns:
- parameter value as double, 0 if out of bounds
 
 - 
getParamLongprotected static long getParamLong(AMFDataList params, int index) Get parameter by index, Return as long.- Parameters:
- params- parameters
- index- parameter index
- Returns:
- parameter value as long, 0 if out of bounds
 
 - 
getParamLongprotected static long getParamLong(AMFDataList params, int index, long defaultVal) Get parameter by index, Return as long.- Parameters:
- params- parameters
- index- parameter index
- defaultVal- default value
- Returns:
- parameter value as long, defaultVal if out of bounds
 
 - 
getParamBooleanprotected static boolean getParamBoolean(AMFDataList params, int index) Get parameter by index, Return as boolean.- Parameters:
- params- parameters
- index- parameter index
- Returns:
- parameter value as boolean, false if out of bounds
 
 - 
getParamBooleanprotected static boolean getParamBoolean(AMFDataList params, int index, boolean defaultVal) Get parameter by index, Return as boolean.- Parameters:
- params- parameters
- index- parameter index
- defaultVal- default value
- Returns:
- parameter value as boolean, defaultVal if out of bounds
 
 - 
getAppInstanceprotected static IApplicationInstance getAppInstance(IClient client) Get applicationInstace of a client.- Parameters:
- client- client
- Returns:
- applicationInstance
 
 - 
getApplicationprotected static IApplication getApplication(IClient client) Get application of a client.- Parameters:
- client- client
- Returns:
- application
 
 - 
isSendResultprotected static boolean isSendResult(AMFDataList params) Is this method call expecting sendResult to be called. If on the client side the call toNetConnection.call("handlerName", resultObj, param1...);had a value for resultObj (non-null), then the method is expecting some type of result or return data. Calling a variant of sendResult will provide this callback.- Parameters:
- params- parameters
- Returns:
- true if client side call is expecting call to sendResult
 
 - 
getVHostprotected static IVHost getVHost(IClient client) Get vHost of a client.- Parameters:
- client- client
- Returns:
- vHost
 
 - 
sendResultprotected static boolean sendResult(IClient client, AMFDataList params, String value) Send a result to client method call as a single String value.- Parameters:
- client- client
- params- parameters
- value- return value
- Returns:
- true if client side call is expecting call to sendResult
 
 - 
sendResultprotected static boolean sendResult(IClient client, AMFDataList params, boolean value) Send a result to client method call as a single boolean value.- Parameters:
- client- client
- params- parameters
- value- return value
- Returns:
- true if client side call is expecting call to sendResult
 
 - 
sendResultprotected static boolean sendResult(IClient client, AMFDataList params, int value) Send a result to client method call as a single int value.- Parameters:
- client- client
- params- parameters
- value- return value
- Returns:
- true if client side call is expecting call to sendResult
 
 - 
sendResultprotected static boolean sendResult(IClient client, AMFDataList params, double value) Send a result to client method call as a single double value.- Parameters:
- client- client
- params- parameters
- value- return value
- Returns:
- true if client side call is expecting call to sendResult
 
 - 
sendResultprotected static boolean sendResult(IClient client, AMFDataList params, AMFData data) Send a result to client method call as a AMFData object. This can be a single AMFData value likenew AMFDataItem((double)1.234)or a complex type like AMFDataMixedArray, AMFDataArray or AMFDataObj.- Parameters:
- client- client
- params- parameters
- data- return value
- Returns:
- true if client side call is expecting call to sendResult
 
 - 
getLoggerprotected static WMSLogger getLogger() Get the logging interface.- Returns:
- logging interface
 
 - 
getLoggerprotected static WMSLogger getLogger(Class classObj) Get the logging interface.- Parameters:
- classObj- class object
- Returns:
- logging interface
 
 - 
getLoggerprotected static WMSLogger getLogger(Class classObj, IApplicationInstance appInstance) Get the logging interface.- Parameters:
- classObj- class object
- appInstance- application instance
- Returns:
- logging interface
 
 - 
getStreamprotected static IMediaStream getStream(IClient client, com.wowza.wms.request.RequestFunction function) For methods called from the client side object NetStream (publish, play, deleteStream) get the IMediaStream object associated with the call.- Parameters:
- client- client
- function- functions
- Returns:
- media stream
 
 - 
invokePreviousprotected static void invokePrevious(Object instance, IClient client, com.wowza.wms.request.RequestFunction function, AMFDataList params)Wowza Pro will determine command priority based on the order of the modules in the module list. Wowza Pro by default will only invoke the last module that defines a given command. This method enables you to call the method by the same name in the previous module that defines that command. For example if you have three modules defined in the module list; ModuleCore, ModuleSecureURLParams and ModuleMyModule and all three modules implement the "play" command. When "play" is invoked it will invoke the "play" command in ModuleMyModule. If in ModuleMyModule you would like to call the "play" command in ModuleSecureURLParams, you can call: invokePrevious(this, client, function, params); and it will invoke the "play" command defined in ModuleSecureURLParams.- Parameters:
- instance- instance of the current module
- client- client object passed into command
- function- function passed into command
- params- parameters passed into command
 
 - 
invokePreviousprotected void invokePrevious(IClient client, com.wowza.wms.request.RequestFunction function, AMFDataList params) Wowza Pro will determine command priority based on the order of the modules in the module list. Wowza Pro by default will only invoke the last module that defines a given command. This method enables you to call the method by the same name in the previous module that defines that command. For example if you have three modules defined in the module list; ModuleCore, ModuleSecureURLParams and ModuleMyModule and all three modules implement the "play" command. When "play" is invoked it will invoke the "play" command in ModuleMyModule. If in ModuleMyModule you would like to call the "play" command in ModuleSecureURLParams, you can call: this.invokePrevious(client, function, params); and it will invoke the "play" command defined in ModuleSecureURLParams.- Parameters:
- client- client object passed into command
- function- function passed into command
- params- parameters passed into command
 
 - 
sendClientOnStatusErrorprotected static void sendClientOnStatusError(IClient client, String code, String description) Send an error message to the client-side client.onStatus handler- Parameters:
- client- destination client
- code- code
- description- description
 
 - 
sendStreamOnStatusErrorprotected static void sendStreamOnStatusError(IMediaStream stream, String code, String description) Send an error to the client-side NetStream.onStatus handler- Parameters:
- stream- destination stream
- code- code
- description- description
 
 
- 
 
-