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 int
Callback param: param1static final int
Callback param: param10static final int
Callback param: param2static final int
Callback param: param3static final int
Callback param: param4static final int
Callback param: param5static final int
Callback param: param6static final int
Callback param: param7static final int
Callback param: param8static final int
Callback param: param9static final int
Method param: param1static final int
Method param: param10static final int
Method param: param2static final int
Method param: param3static final int
Method param: param4static final int
Method param: param5static final int
Method param: param6static final int
Method param: param7static final int
Method param: param8static final int
Method param: param9static final int
Method: method namestatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final String
Play2 transition: APPENDstatic final String
Play2 transition: RESETstatic final String
Play2 transition: STOPstatic final String
Play2 transition: SWAPstatic final String
Play2 transition: SWITCHstatic final String
Play2 transition: UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static IApplicationInstance
getAppInstance
(IClient client) Get applicationInstace of a client.protected static IApplication
getApplication
(IClient client) Get application of a client.protected static int
getCallbackParamCount
(AMFDataList params) Get the total number of parameters passed to callback.protected static WMSLogger
Get the logging interface.protected static WMSLogger
Get the logging interface.protected static WMSLogger
getLogger
(Class classObj, IApplicationInstance appInstance) Get the logging interface.protected static AMFData
getParam
(AMFDataList params, int index) Get parameter by index.protected static boolean
getParamBoolean
(AMFDataList params, int index) Get parameter by index, Return as boolean.protected static boolean
getParamBoolean
(AMFDataList params, int index, boolean defaultVal) Get parameter by index, Return as boolean.protected static int
getParamCount
(AMFDataList params) Get the total number of parameters passed to method.protected static Date
getParamDate
(AMFDataList params, int index) Get parameter by index, Return as Date.protected static double
getParamDouble
(AMFDataList params, int index) Get parameter by index, Return as double.protected static double
getParamDouble
(AMFDataList params, int index, double defaultVal) Get parameter by index, Return as double.protected static int
getParamInt
(AMFDataList params, int index) Get parameter by index, Return as int.protected static int
getParamInt
(AMFDataList params, int index, int defaultVal) Get parameter by index, Return as int.protected static long
getParamLong
(AMFDataList params, int index) Get parameter by index, Return as long.protected static long
getParamLong
(AMFDataList params, int index, long defaultVal) Get parameter by index, Return as long.protected static AMFDataMixedArray
getParamMixedArray
(AMFDataList params, int index) Get parameter by index, Return as AMFDataMixedArray.protected static AMFDataObj
getParamObj
(AMFDataList params, int index) Get parameter by index, Return as Object.protected static String
getParamString
(AMFDataList params, int index) Get parameter by index, Return as String.protected static String
getParamString
(AMFDataList params, int index, String defaultVal) Get parameter by index, Return as String.protected static int
getParamType
(AMFDataList params, int index) Get parameter type.protected static IMediaStream
For methods called from the client side object NetStream (publish, play, deleteStream) get the IMediaStream object associated with the call.protected static IVHost
Get vHost of a client.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.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.protected static boolean
isSendResult
(AMFDataList params) Is this method call expecting sendResult to be called.protected static void
sendClientOnStatusError
(IClient client, String code, String description) Send an error message to the client-side client.onStatus handlerprotected static boolean
sendResult
(IClient client, AMFDataList params, boolean value) Send a result to client method call as a single boolean value.protected static boolean
sendResult
(IClient client, AMFDataList params, double value) Send a result to client method call as a single double value.protected static boolean
sendResult
(IClient client, AMFDataList params, int value) Send a result to client method call as a single int value.protected static boolean
sendResult
(IClient client, AMFDataList params, AMFData data) Send a result to client method call as a AMFData object.protected static boolean
sendResult
(IClient client, AMFDataList params, String value) Send a result to client method call as a single String value.protected static void
sendStreamOnStatusError
(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
-