org.apache.felix.upnp.basedriver.importer.core.upnp
Class UPnPActionImpl

java.lang.Object
  extended by org.apache.felix.upnp.basedriver.importer.core.upnp.UPnPActionImpl
All Implemented Interfaces:
UPnPAction

public class UPnPActionImpl
extends Object
implements UPnPAction


Constructor Summary
UPnPActionImpl(org.cybergarage.upnp.Action act, UPnPServiceImpl ser)
           
 
Method Summary
 String[] getInputArgumentNames()
          Lists all input arguments for this action.
 String getName()
          Returns the action name.
 String[] getOutputArgumentNames()
          List all output arguments for this action.
 String getReturnArgumentName()
          Returns the name of the designated return argument.
 UPnPStateVariable getStateVariable(String argumentName)
          Finds the state variable associated with an argument name.
 Dictionary invoke(Dictionary args)
          Invokes the action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UPnPActionImpl

public UPnPActionImpl(org.cybergarage.upnp.Action act,
                      UPnPServiceImpl ser)
Parameters:
act -
Method Detail

getName

public String getName()
Description copied from interface: UPnPAction
Returns the action name. The action name corresponds to the name field in the actionList of the service description.

Specified by:
getName in interface UPnPAction
Returns:
Name of action, must not contain a hyphen character or a hash character

getReturnArgumentName

public String getReturnArgumentName()
Description copied from interface: UPnPAction
Returns the name of the designated return argument.

One of the output arguments can be flagged as a designated return argument.

Specified by:
getReturnArgumentName in interface UPnPAction
Returns:
The name of the designated return argument or null if none is marked.

getInputArgumentNames

public String[] getInputArgumentNames()
Description copied from interface: UPnPAction
Lists all input arguments for this action.

Each action may have zero or more input arguments.

Specified by:
getInputArgumentNames in interface UPnPAction
Returns:
Array of input argument names or null if no input arguments.
See Also:
UPnPStateVariable

getOutputArgumentNames

public String[] getOutputArgumentNames()
Description copied from interface: UPnPAction
List all output arguments for this action.

Specified by:
getOutputArgumentNames in interface UPnPAction
Returns:
Array of output argument names or null if there are no output arguments.
See Also:
UPnPStateVariable

getStateVariable

public UPnPStateVariable getStateVariable(String argumentName)
Description copied from interface: UPnPAction
Finds the state variable associated with an argument name. Helps to resolve the association of state variables with argument names in UPnP actions.

Specified by:
getStateVariable in interface UPnPAction
Parameters:
argumentName - The name of the UPnP action argument.
Returns:
State variable associated with the named argument or null if there is no such argument.
See Also:
UPnPStateVariable

invoke

public Dictionary invoke(Dictionary args)
                  throws Exception
Description copied from interface: UPnPAction
Invokes the action. The input and output arguments are both passed as Dictionary objects. Each entry in the Dictionary object has a String object as key representing the argument name and the value is the argument itself. The class of an argument value must be assignable from the class of the associated UPnP state variable. The input argument Dictionary object must contain exactly those arguments listed by getInputArguments method. The output argument Dictionary object will contain exactly those arguments listed by getOutputArguments method.

Specified by:
invoke in interface UPnPAction
Parameters:
args - A Dictionary of arguments. Must contain the correct set and type of arguments for this action. May be null if no input arguments exist.
Returns:
A Dictionary with the output arguments. null if the action has no output arguments.
Throws:
UPnPException - A UPnP error has occured.
Exception - The execution fails for some reason.
See Also:
UPnPStateVariable


Copyright © 2011 Apache Software Foundation. All Rights Reserved.