public class ActionMessage
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
ActionMessage(Service service,
Action serviceAction)
Protected constuctor so that only messages factories can build
it
|
Modifier and Type | Method and Description |
---|---|
void |
clearInputParameters()
Method to clear all set input parameters so that this object can
be reused
|
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.
|
public void clearInputParameters()
public ActionResponse service() throws java.io.IOException, UPNPResponseException
java.io.IOException
- if some IOException occurs during message send and
reception processUPNPResponseException
- if an UPNP error message is returned from the server
or if some parsing exception occurs ( detailErrorCode
= 899, detailErrorDescription = SAXException message
)public ActionMessage setInputParameter(java.lang.String parameterName, java.lang.Object parameterValue) throws java.lang.IllegalArgumentException
parameterName
- the parameter nameparameterValue
- the parameter value as an object, primitive object are
handled, all other object will be assigned with a call
to their toString() method calljava.lang.IllegalArgumentException
- if the provided parameterName is not valid for this
message or if no input parameters are required for
this messagepublic ActionMessage setInputParameter(java.lang.String parameterName, java.lang.String parameterValue) throws java.lang.IllegalArgumentException
parameterName
- the parameter nameparameterValue
- the string parameter valuejava.lang.IllegalArgumentException
- if the provided parameterName is not valid for this
message or if no input parameters are required for
this messagepublic ActionMessage setInputParameter(java.lang.String parameterName, java.util.Date parameterValue) throws java.lang.IllegalArgumentException
parameterName
- the parameter nameparameterValue
- the date parameter value, will be automatically
translated to the correct ISO 8601 date format for the
given action input param related state variablejava.lang.IllegalArgumentException
- if the provided parameterName is not valid for this
message or if no input parameters are required for
this messagepublic ActionMessage setInputParameter(java.lang.String parameterName, boolean parameterValue) throws java.lang.IllegalArgumentException
parameterName
- the parameter nameparameterValue
- the boolean parameter valuejava.lang.IllegalArgumentException
- if the provided parameterName is not valid for this
message or if no input parameters are required for
this messagepublic ActionMessage setInputParameter(java.lang.String parameterName, byte parameterValue) throws java.lang.IllegalArgumentException
parameterName
- the parameter nameparameterValue
- the byte parameter valuejava.lang.IllegalArgumentException
- if the provided parameterName is not valid for this
message or if no input parameters are required for
this messagepublic ActionMessage setInputParameter(java.lang.String parameterName, short parameterValue) throws java.lang.IllegalArgumentException
parameterName
- the parameter nameparameterValue
- the short parameter valuejava.lang.IllegalArgumentException
- if the provided parameterName is not valid for this
message or if no input parameters are required for
this messagepublic ActionMessage setInputParameter(java.lang.String parameterName, int parameterValue) throws java.lang.IllegalArgumentException
parameterName
- the parameter nameparameterValue
- the integer parameter valuejava.lang.IllegalArgumentException
- if the provided parameterName is not valid for this
message or if no input parameters are required for
this messagepublic ActionMessage setInputParameter(java.lang.String parameterName, long parameterValue) throws java.lang.IllegalArgumentException
parameterName
- the parameter nameparameterValue
- the long parameter valuejava.lang.IllegalArgumentException
- if the provided parameterName is not valid for this
message or if no input parameters are required for
this messagepublic ActionMessage setInputParameter(java.lang.String parameterName, float parameterValue) throws java.lang.IllegalArgumentException
parameterName
- the parameter nameparameterValue
- the float parameter valuejava.lang.IllegalArgumentException
- if the provided parameterName is not valid for this
message or if no input parameters are required for
this messagepublic ActionMessage setInputParameter(java.lang.String parameterName, double parameterValue) throws java.lang.IllegalArgumentException
parameterName
- the parameter nameparameterValue
- the double parameter valuejava.lang.IllegalArgumentException
- if the provided parameterName is not valid for this
message or if no input parameters are required for
this message