public class Action extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ELEM_NAME
The element name for action nodes in XML
|
| Constructor and Description |
|---|
Action(Action action)
Creates a copy of an existing Action.
|
Action(Node serviceNode)
Creates a new Action with a given service node.
|
Action(Node serviceNode,
Node actionNode)
Creates a new Action with given service and action nodes.
|
| Modifier and Type | Method and Description |
|---|---|
ActionListener |
getActionListener()
Gets the action listener for this action.
|
Node |
getActionNode()
Gets the action node.
|
Argument |
getArgument(String name)
Gets an argument by name.
|
int |
getArgumentIntegerValue(String name)
Gets the integer value of an argument by name.
|
ArgumentList |
getArgumentList()
Gets list of all arguments for this action.
|
String |
getArgumentValue(String name)
Gets the value of an argument by name.
|
UPnPStatus |
getControlStatus()
Gets the control status for this action.
|
ArgumentList |
getInputArgumentList()
Gets the list of input arguments for this action.
|
String |
getName()
Gets name of this action.
|
ArgumentList |
getOutputArgumentList()
Gets the list of output arguments for this action.
|
Service |
getService()
Gets the service this action belongs to.
|
UPnPStatus |
getStatus()
Gets the UPnP status for this action.
|
Object |
getUserData()
Gets the user-defined data associated with this action.
|
static boolean |
isActionNode(Node node)
Checks if the given node is an action node.
|
void |
lock()
Locks the mutex for this action.
|
boolean |
performActionListener(ActionRequest actionReq)
Performs the action listener for this action.
|
boolean |
postControlAction()
Posts this control action without binding to a specific local address.
|
boolean |
postControlAction(String fromHost)
Posts this control action, optionally binding to a specific local host address.
|
void |
print()
Prints debug information about this action and its arguments.
|
void |
setActionListener(ActionListener listener)
Sets the action listener for this action.
|
void |
setArgumentList(ArgumentList al)
Sets the argument list for this action.
|
void |
setArgumentValue(String name,
int value)
Sets the value of an argument by name using an integer value.
|
void |
setArgumentValue(String name,
String value)
Sets the value of an argument by name.
|
void |
setInArgumentValues(ArgumentList argList)
Sets the values of input arguments.
|
void |
setName(String value)
Sets name of this action.
|
void |
setOutArgumentValues(ArgumentList argList)
Sets the values of output arguments.
|
(package private) void |
setService(Service s)
Sets the service this action belongs to.
|
void |
setStatus(int code)
Sets the status code for this action using the default description.
|
void |
setStatus(int code,
String descr)
Sets the status code and description for this action.
|
void |
setUserData(Object data)
Sets user-defined data for this action.
|
void |
unlock()
Unlocks the mutex for this action.
|
public static final String ELEM_NAME
public Action(Action action)
action - Action to copypublic Action(Node serviceNode)
serviceNode - service node this action belongs topublic ActionListener getActionListener()
public Node getActionNode()
public Argument getArgument(String name)
name - the name of the argument to findpublic int getArgumentIntegerValue(String name)
name - the name of the argumentpublic ArgumentList getArgumentList()
public String getArgumentValue(String name)
name - the name of the argumentpublic UPnPStatus getControlStatus()
public ArgumentList getInputArgumentList()
public String getName()
public ArgumentList getOutputArgumentList()
public Service getService()
public UPnPStatus getStatus()
public Object getUserData()
public static boolean isActionNode(Node node)
node - node to checkpublic void lock()
public boolean performActionListener(ActionRequest actionReq)
actionReq - the action requestpublic boolean postControlAction()
public boolean postControlAction(String fromHost)
fromHost - null to not bind to a particular local addresspublic void print()
public void setActionListener(ActionListener listener)
listener - the action listener to setpublic void setArgumentList(ArgumentList al)
al - the argument list to setpublic void setArgumentValue(String name, int value)
name - the name of the argumentvalue - the integer value to setpublic void setArgumentValue(String name, String value)
name - the name of the argumentvalue - the value to setpublic void setInArgumentValues(ArgumentList argList)
argList - the argument list containing input valuespublic void setName(String value)
value - name to setpublic void setOutArgumentValues(ArgumentList argList)
argList - the argument list containing output valuesvoid setService(Service s)
s - the service to setpublic void setStatus(int code)
code - the status codepublic void setStatus(int code,
String descr)
code - the status codedescr - the status descriptionpublic void setUserData(Object data)
data - the user data to setpublic void unlock()