net.sbbi.upnp.messages
Class ActionMessage

java.lang.Object
  extended bynet.sbbi.upnp.messages.ActionMessage

public class ActionMessage
extends java.lang.Object

Message object for an UPNP action, simply call setInputParameter() to add the required action message params and then service() to receive the ActionResponse built with the parsed UPNP device SOAP xml response.

Version:
1.0
Author:
SuperBonBon

Method Summary
 void clearInputParameters()
          Method to clear all set input parameters so that this object can be reused
 java.util.List getInputParameterNames()
          The list of input parameters that should be accepted by the device service for this message
 java.util.List getOutputParameterNames()
          The list of output parameters that should be returned by the device service
 ActionResponse service()
          Executes the message and retuns the UPNP device response, according to the UPNP specs, this method could take up to 30 secs to process ( time allowed for a device to respond to a request )
 ActionMessage setInputParameter(java.lang.String parameterName, boolean parameterValue)
          Set the value of an input parameter before a message service call
 ActionMessage setInputParameter(java.lang.String parameterName, byte parameterValue)
          Set the value of an input parameter before a message service call
 ActionMessage setInputParameter(java.lang.String parameterName, java.util.Date parameterValue)
          Set the value of an input parameter before a message service call
 ActionMessage setInputParameter(java.lang.String parameterName, double parameterValue)
          Set the value of an input parameter before a message service call
 ActionMessage setInputParameter(java.lang.String parameterName, float parameterValue)
          Set the value of an input parameter before a message service call
 ActionMessage setInputParameter(java.lang.String parameterName, int parameterValue)
          Set the value of an input parameter before a message service call
 ActionMessage setInputParameter(java.lang.String parameterName, long parameterValue)
          Set the value of an input parameter before a message service call
 ActionMessage setInputParameter(java.lang.String parameterName, java.lang.Object parameterValue)
          Set the value of an input parameter before a message service call.
 ActionMessage setInputParameter(java.lang.String parameterName, short parameterValue)
          Set the value of an input parameter before a message service call
 ActionMessage setInputParameter(java.lang.String parameterName, java.lang.String parameterValue)
          Set the value of an input parameter before a message service call.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clearInputParameters

public void clearInputParameters()
Method to clear all set input parameters so that this object can be reused


service

public ActionResponse service()
                       throws java.io.IOException,
                              UPNPResponseException
Executes the message and retuns the UPNP device response, according to the UPNP specs, this method could take up to 30 secs to process ( time allowed for a device to respond to a request )

Returns:
a response object containing the UPNP parsed response
Throws:
java.io.IOException - if some IOException occurs during message send and reception process
UPNPResponseException - if an UPNP error message is returned from the server or if some parsing exception occurs ( detailErrorCode = 899, detailErrorDescription = SAXException message )

getInputParameterNames

public java.util.List getInputParameterNames()
The list of input parameters that should be accepted by the device service for this message

Returns:
a list of required input parameters ServiceActionArgument objects for this message or null if the message does not require any input params

getOutputParameterNames

public java.util.List getOutputParameterNames()
The list of output parameters that should be returned by the device service

Returns:
a list of output parameters ServiceActionArgument objects for this message or null if the message does not contains any output params.

setInputParameter

public ActionMessage setInputParameter(java.lang.String parameterName,
                                       java.lang.Object parameterValue)
                                throws java.lang.IllegalArgumentException
Set the value of an input parameter before a message service call. If the param name already exists, the param value will be overwritten with the new value provided.

Parameters:
parameterName - the parameter name
parameterValue - the parameter value as an object, primitive object are handled, all other object will be assigned with a call to their toString() method call
Returns:
the current ActionMessage object instance
Throws:
java.lang.IllegalArgumentException - if the provided parameterName is not valid for this message or if no input parameters are required for this message

setInputParameter

public ActionMessage setInputParameter(java.lang.String parameterName,
                                       java.lang.String parameterValue)
                                throws java.lang.IllegalArgumentException
Set the value of an input parameter before a message service call. If the param name already exists, the param value will be overwritten with the new value provided

Parameters:
parameterName - the parameter name
parameterValue - the string parameter value
Returns:
the current ActionMessage object instance
Throws:
java.lang.IllegalArgumentException - if the provided parameterName is not valid for this message or if no input parameters are required for this message

setInputParameter

public ActionMessage setInputParameter(java.lang.String parameterName,
                                       java.util.Date parameterValue)
                                throws java.lang.IllegalArgumentException
Set the value of an input parameter before a message service call

Parameters:
parameterName - the parameter name
parameterValue - the date parameter value, will be automatically translated to the correct ISO 8601 date format for the given action input param related state variable
Returns:
the current ActionMessage object instance
Throws:
java.lang.IllegalArgumentException - if the provided parameterName is not valid for this message or if no input parameters are required for this message

setInputParameter

public ActionMessage setInputParameter(java.lang.String parameterName,
                                       boolean parameterValue)
                                throws java.lang.IllegalArgumentException
Set the value of an input parameter before a message service call

Parameters:
parameterName - the parameter name
parameterValue - the boolean parameter value
Returns:
the current ActionMessage object instance
Throws:
java.lang.IllegalArgumentException - if the provided parameterName is not valid for this message or if no input parameters are required for this message

setInputParameter

public ActionMessage setInputParameter(java.lang.String parameterName,
                                       byte parameterValue)
                                throws java.lang.IllegalArgumentException
Set the value of an input parameter before a message service call

Parameters:
parameterName - the parameter name
parameterValue - the byte parameter value
Returns:
the current ActionMessage object instance
Throws:
java.lang.IllegalArgumentException - if the provided parameterName is not valid for this message or if no input parameters are required for this message

setInputParameter

public ActionMessage setInputParameter(java.lang.String parameterName,
                                       short parameterValue)
                                throws java.lang.IllegalArgumentException
Set the value of an input parameter before a message service call

Parameters:
parameterName - the parameter name
parameterValue - the short parameter value
Returns:
the current ActionMessage object instance
Throws:
java.lang.IllegalArgumentException - if the provided parameterName is not valid for this message or if no input parameters are required for this message

setInputParameter

public ActionMessage setInputParameter(java.lang.String parameterName,
                                       int parameterValue)
                                throws java.lang.IllegalArgumentException
Set the value of an input parameter before a message service call

Parameters:
parameterName - the parameter name
parameterValue - the integer parameter value
Returns:
the current ActionMessage object instance
Throws:
java.lang.IllegalArgumentException - if the provided parameterName is not valid for this message or if no input parameters are required for this message

setInputParameter

public ActionMessage setInputParameter(java.lang.String parameterName,
                                       long parameterValue)
                                throws java.lang.IllegalArgumentException
Set the value of an input parameter before a message service call

Parameters:
parameterName - the parameter name
parameterValue - the long parameter value
Returns:
the current ActionMessage object instance
Throws:
java.lang.IllegalArgumentException - if the provided parameterName is not valid for this message or if no input parameters are required for this message

setInputParameter

public ActionMessage setInputParameter(java.lang.String parameterName,
                                       float parameterValue)
                                throws java.lang.IllegalArgumentException
Set the value of an input parameter before a message service call

Parameters:
parameterName - the parameter name
parameterValue - the float parameter value
Returns:
the current ActionMessage object instance
Throws:
java.lang.IllegalArgumentException - if the provided parameterName is not valid for this message or if no input parameters are required for this message

setInputParameter

public ActionMessage setInputParameter(java.lang.String parameterName,
                                       double parameterValue)
                                throws java.lang.IllegalArgumentException
Set the value of an input parameter before a message service call

Parameters:
parameterName - the parameter name
parameterValue - the double parameter value
Returns:
the current ActionMessage object instance
Throws:
java.lang.IllegalArgumentException - if the provided parameterName is not valid for this message or if no input parameters are required for this message


Copyright © 2005 SuperBonBon Industries. All Rights Reserved.