Package com.metratec.lib.upnp
Class CallAction
- java.lang.Object
-
- com.metratec.lib.upnp.CallAction
-
public class CallAction extends java.lang.Object
Class allows a control point to execute an UPnP action.The implementation also allows executing an action which is protected by basic/digest authentication. One has to set the authentication credentials using
setCredentials(java.lang.String, java.lang.String)
before executing the action.
-
-
Constructor Summary
Constructors Constructor Description CallAction(Action action, int timeout)
Create an instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Argument>
execute()
Executes the action and returns the output arguments.void
setCredentials(java.lang.String username, java.lang.String password)
Set the credentials for HTTP basic/digest authentication.
-
-
-
Constructor Detail
-
CallAction
public CallAction(Action action, int timeout) throws java.net.MalformedURLException, javax.xml.parsers.ParserConfigurationException, java.io.UnsupportedEncodingException
Create an instance of this class.- Parameters:
action
- the action to be calledtimeout
- the connection timeout- Throws:
java.net.MalformedURLException
javax.xml.parsers.ParserConfigurationException
java.io.UnsupportedEncodingException
-
-
Method Detail
-
setCredentials
public void setCredentials(java.lang.String username, java.lang.String password)
Set the credentials for HTTP basic/digest authentication. This is only necessary if the action is protected via basic/digest authentication.- Parameters:
username
- the usernamepassword
- the password
-
execute
public java.util.List<Argument> execute() throws java.io.IOException, java.net.ProtocolException, java.lang.Exception
Executes the action and returns the output arguments.The control point should set the input argument(s) of the action to be called before hand by fetching the input arguments using
Action.getInputArguments()
.The method also automatically tries to perform basic/digest authentication if required by the action.
- Returns:
- the list of output arguments
- Throws:
java.io.IOException
java.net.ProtocolException
java.lang.Exception
-
-