org.ocap.hn.upnp.common
Class UPnPActionInvocation

java.lang.Object
  extended by org.ocap.hn.upnp.common.UPnPActionInvocation

public class UPnPActionInvocation
extends Object

This class represents a UPnP service action invocation, carrying only IN arguments and a reference to the action definition (UPnPAction). It is constructed by a client application and passed to a UPnPService via the postActionInvocation method in order to invoke an action on a UPnP server.

See Also:
UPnPClientService.postActionInvocation(UPnPActionInvocation, UPnPActionResponseHandler), UPnPActionHandler.notifyActionReceived(UPnPActionInvocation)

Constructor Summary
UPnPActionInvocation(String[] argVals, UPnPAction action)
          Constructs a UPnPActionInvocation that conforms to the IN argument requirements of its associated UPnPAction.
 
Method Summary
 UPnPAction getAction()
          Gets the UPnPAction that this UPnPActionInvocation is associated with.
 String[] getArgumentNames()
          Gets the argument names specified by this action invocation, in the order they were specified in the constructor.
 String getArgumentValue(String name)
          Gets the value of the specified argument.
 String getName()
          Gets the name of the action as specifed by the action name element in the UPnP service description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UPnPActionInvocation

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

This constructor ensures that the resulting action invocation provides an argument value, in the proper dataType format, for each of the IN arguments of the specified UPnP action.

For objects created through this constructor, getArgumentNames() will report, in order, the required IN argument names of the specified UPnPAction.

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

getName

public String getName()
Gets the name of the action as specifed by the action name element in the UPnP service description. Calls getAction().getName().

Returns:
the name of the action.
See Also:
getAction()

getArgumentNames

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

Returns:
The argument names of this action invocation. If no arguments have been specified, 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 invocation.
See Also:
getArgumentNames()

getAction

public UPnPAction getAction()
Gets the UPnPAction that this UPnPActionInvocation is associated with.

Returns:
The UPnPAction that this action invocation is associated with.


Copyright © 2011. All Rights Reserved.