org.ocap.hn.upnp.common
Class UPnPActionResponse

java.lang.Object
  extended by org.ocap.hn.upnp.common.UPnPResponse
      extended by org.ocap.hn.upnp.common.UPnPActionResponse

public class UPnPActionResponse
extends UPnPResponse

The class represents a response to a successfully completed UPnP action. It carries only the OUT arguments from the action. Instances of this class are constructed by the UPnPActionHandler on a UPnP server, and are passed to a client in the UPnPActionResponseHandler.

See Also:
UPnPActionHandler.notifyActionReceived(UPnPActionInvocation), UPnPActionResponseHandler.notifyUPnPActionResponse(UPnPResponse)

Constructor Summary
UPnPActionResponse(String[] argVals, UPnPActionInvocation actionInvocation)
          Constructs a UPnPActionResponse that conforms to the OUT argument requirements of its associated UPnPAction.
 
Method Summary
 String[] getArgumentNames()
          Gets the output argument names specified by this action response, in the order they were specified in the constructor.
 String getArgumentValue(String name)
          Gets the value of the specified argument.
 String[] getArgumentValues()
          Gets the output argument values specified by this action response, in the order they were specified in the constructor.
 
Methods inherited from class org.ocap.hn.upnp.common.UPnPResponse
getActionInvocation, getHTTPResponseCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UPnPActionResponse

public UPnPActionResponse(String[] argVals,
                          UPnPActionInvocation actionInvocation)
Constructs a UPnPActionResponse that conforms to the OUT argument requirements of its associated UPnPAction.

This constructor ensures that the resulting action response provides an argument value, in the proper dataType format, for each of the OUT arguments of the UPnP action reported by actionInvocation.getAction().

For objects created through this constructor, getArgumentNames() will report, in order, the required OUT argument names of the associated UPnP action.

Parameters:
argVals - An array of argument values corresponding, in order, to the OUT arguments of actionInvocation.getAction().
actionInvocation - The action invocation that this action response relates to.
Throws:
IllegalArgumentException - if argVals does not conform to the OUT argument requirements of actionInvocation.getAction().
NullPointerException - if action is null, or argVals or any of its array elements is null.
Method Detail

getArgumentNames

public String[] getArgumentNames()
Gets the output argument names specified by this action response, in the order they were specified in the constructor.

Returns:
The action response output argument names. If the action response has no output arguments, returns a zero-length array.

getArgumentValues

public String[] getArgumentValues()
Gets the output argument values specified by this action response, in the order they were specified in the constructor.

Returns:
The action response output argument values. If the action response has no output arguments, returns a zero-length array.

getArgumentValue

public String getArgumentValue(String name)
Gets the value of the specified argument.

Parameters:
name - The name of the argument.
Returns:
The value of the argument.
Throws:
IllegalArgumentException - if name does not match one of the argument names specified for this action response.
See Also:
getArgumentNames()


Copyright © 2011. All Rights Reserved.