Package com.wowza.wms.module
Class ModuleBase
Object
com.wowza.wms.module.ModuleBase
- Direct Known Subclasses:
ModuleClientLogging,ModuleCore,ModuleMediaCaster
ModuleBase: 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intCallback param: param1static final intCallback param: param10static final intCallback param: param2static final intCallback param: param3static final intCallback param: param4static final intCallback param: param5static final intCallback param: param6static final intCallback param: param7static final intCallback param: param8static final intCallback param: param9static final intMethod param: param1static final intMethod param: param10static final intMethod param: param2static final intMethod param: param3static final intMethod param: param4static final intMethod param: param5static final intMethod param: param6static final intMethod param: param7static final intMethod param: param8static final intMethod param: param9static final intMethod: method namestatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final StringPlay2 transition: APPENDstatic final StringPlay2 transition: RESETstatic final StringPlay2 transition: STOPstatic final StringPlay2 transition: SWAPstatic final StringPlay2 transition: SWITCHstatic final StringPlay2 transition: UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 WMSLoggerGet the logging interface.protected static WMSLoggerGet 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 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 IMediaStreamFor methods called from the client side object NetStream (publish, play, deleteStream) get the IMediaStream object associated with the call.protected static IVHostGet 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 Details
-
PARAMMETHODNAME
public static final int PARAMMETHODNAMEMethod: method name- See Also:
-
PARAM1
public static final int PARAM1Method param: param1- See Also:
-
PARAM2
public static final int PARAM2Method param: param2- See Also:
-
PARAM3
public static final int PARAM3Method param: param3- See Also:
-
PARAM4
public static final int PARAM4Method param: param4- See Also:
-
PARAM5
public static final int PARAM5Method param: param5- See Also:
-
PARAM6
public static final int PARAM6Method param: param6- See Also:
-
PARAM7
public static final int PARAM7Method param: param7- See Also:
-
PARAM8
public static final int PARAM8Method param: param8- See Also:
-
PARAM9
public static final int PARAM9Method param: param9- See Also:
-
PARAM10
public static final int PARAM10Method param: param10- See Also:
-
CALLBACK_PARAM1
public static final int CALLBACK_PARAM1Callback param: param1- See Also:
-
CALLBACK_PARAM2
public static final int CALLBACK_PARAM2Callback param: param2- See Also:
-
CALLBACK_PARAM3
public static final int CALLBACK_PARAM3Callback param: param3- See Also:
-
CALLBACK_PARAM4
public static final int CALLBACK_PARAM4Callback param: param4- See Also:
-
CALLBACK_PARAM5
public static final int CALLBACK_PARAM5Callback param: param5- See Also:
-
CALLBACK_PARAM6
public static final int CALLBACK_PARAM6Callback param: param6- See Also:
-
CALLBACK_PARAM7
public static final int CALLBACK_PARAM7Callback param: param7- See Also:
-
CALLBACK_PARAM8
public static final int CALLBACK_PARAM8Callback param: param8- See Also:
-
CALLBACK_PARAM9
public static final int CALLBACK_PARAM9Callback param: param9- See Also:
-
CALLBACK_PARAM10
public static final int CALLBACK_PARAM10Callback param: param10- See Also:
-
PLAYTRANSITIONSTR_APPEND
Play2 transition: APPEND- See Also:
-
PLAYTRANSITIONSTR_RESET
Play2 transition: RESET- See Also:
-
PLAYTRANSITIONSTR_STOP
Play2 transition: STOP- See Also:
-
PLAYTRANSITIONSTR_SWAP
Play2 transition: SWAP- See Also:
-
PLAYTRANSITIONSTR_SWITCH
Play2 transition: SWITCH- See Also:
-
PLAYTRANSITIONSTR_UNKNOWN
Play2 transition: UNKNOWN- See Also:
-
PLAYTRANSITION_APPEND
public static final int PLAYTRANSITION_APPEND- See Also:
-
PLAYTRANSITION_RESET
public static final int PLAYTRANSITION_RESET- See Also:
-
PLAYTRANSITION_APPEND_IMMEDIATE
public static final int PLAYTRANSITION_APPEND_IMMEDIATE- See Also:
-
PLAYTRANSITION_RESET_IMMEDIATE
public static final int PLAYTRANSITION_RESET_IMMEDIATE- See Also:
-
PLAYTRANSITION_STOP
public static final int PLAYTRANSITION_STOP- See Also:
-
PLAYTRANSITION_SWAP
public static final int PLAYTRANSITION_SWAP- See Also:
-
PLAYTRANSITION_SWITCH
public static final int PLAYTRANSITION_SWITCH- See Also:
-
PLAYTRANSITION_UNKNOWN
public static final int PLAYTRANSITION_UNKNOWN- See Also:
-
-
Constructor Details
-
ModuleBase
public ModuleBase()
-
-
Method Details
-
getParamCount
Get the total number of parameters passed to method.- Parameters:
params- parameters- Returns:
- total number of parameters
-
getCallbackParamCount
Get the total number of parameters passed to callback.- Parameters:
params- parameters- Returns:
- total number of parameters
-
getParamType
Get parameter type.- Parameters:
params- parametersindex- parameter index- Returns:
- parameter type (AMFData.DATA_TYPE_*)
-
getParam
Get parameter by index. Return as AMFData object.- Parameters:
params- parametersindex- parameter index- Returns:
- parameter value as AMFData object, null if out of bounds
-
getParamMixedArray
Get parameter by index, Return as AMFDataMixedArray.- Parameters:
params- parametersindex- parameter index- Returns:
- parameter value as AMFDataMixedArray object, null if out of bounds
-
getParamObj
Get parameter by index, Return as Object.- Parameters:
params- parametersindex- parameter index- Returns:
- parameter value as Object object, null if out of bounds
-
getParamString
Get parameter by index, Return as String.- Parameters:
params- parametersindex- parameter index- Returns:
- parameter value as String object, null if out of bounds
-
getParamString
Get parameter by index, Return as String.- Parameters:
params- parametersindex- parameter indexdefaultVal- default value- Returns:
- parameter value as String object, defaultVal if out of bounds
-
getParamDate
Get parameter by index, Return as Date.- Parameters:
params- parametersindex- parameter index- Returns:
- parameter value as Date object, null if out of bounds
-
getParamInt
Get parameter by index, Return as int.- Parameters:
params- parametersindex- parameter index- Returns:
- parameter value as int, 0 if out of bounds
-
getParamInt
Get parameter by index, Return as int.- Parameters:
params- parametersindex- parameter indexdefaultVal- default value- Returns:
- parameter value as int, defaultVal if out of bounds
-
getParamDouble
Get parameter by index, Return as double.- Parameters:
params- parametersindex- parameter index- Returns:
- parameter value as double, 0 if out of bounds
-
getParamDouble
Get parameter by index, Return as double.- Parameters:
params- parametersindex- parameter indexdefaultVal- default value- Returns:
- parameter value as double, 0 if out of bounds
-
getParamLong
Get parameter by index, Return as long.- Parameters:
params- parametersindex- parameter index- Returns:
- parameter value as long, 0 if out of bounds
-
getParamLong
Get parameter by index, Return as long.- Parameters:
params- parametersindex- parameter indexdefaultVal- default value- Returns:
- parameter value as long, defaultVal if out of bounds
-
getParamBoolean
Get parameter by index, Return as boolean.- Parameters:
params- parametersindex- parameter index- Returns:
- parameter value as boolean, false if out of bounds
-
getParamBoolean
Get parameter by index, Return as boolean.- Parameters:
params- parametersindex- parameter indexdefaultVal- default value- Returns:
- parameter value as boolean, defaultVal if out of bounds
-
getAppInstance
Get applicationInstace of a client.- Parameters:
client- client- Returns:
- applicationInstance
-
getApplication
Get application of a client.- Parameters:
client- client- Returns:
- application
-
isSendResult
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
-
getVHost
Get vHost of a client.- Parameters:
client- client- Returns:
- vHost
-
sendResult
Send a result to client method call as a single String value.- Parameters:
client- clientparams- parametersvalue- return value- Returns:
- true if client side call is expecting call to sendResult
-
sendResult
Send a result to client method call as a single boolean value.- Parameters:
client- clientparams- parametersvalue- return value- Returns:
- true if client side call is expecting call to sendResult
-
sendResult
Send a result to client method call as a single int value.- Parameters:
client- clientparams- parametersvalue- return value- Returns:
- true if client side call is expecting call to sendResult
-
sendResult
Send a result to client method call as a single double value.- Parameters:
client- clientparams- parametersvalue- return value- Returns:
- true if client side call is expecting call to sendResult
-
sendResult
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- clientparams- parametersdata- return value- Returns:
- true if client side call is expecting call to sendResult
-
getLogger
Get the logging interface.- Returns:
- logging interface
-
getLogger
Get the logging interface.- Parameters:
classObj- class object- Returns:
- logging interface
-
getLogger
Get the logging interface.- Parameters:
classObj- class objectappInstance- application instance- Returns:
- logging interface
-
getStream
protected 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- clientfunction- functions- Returns:
- media stream
-
invokePrevious
protected 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 moduleclient- client object passed into commandfunction- function passed into commandparams- parameters passed into command
-
invokePrevious
protected 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 commandfunction- function passed into commandparams- parameters passed into command
-
sendClientOnStatusError
Send an error message to the client-side client.onStatus handler- Parameters:
client- destination clientcode- codedescription- description
-
sendStreamOnStatusError
Send an error to the client-side NetStream.onStatus handler- Parameters:
stream- destination streamcode- codedescription- description
-