public final class RobotExecutor
extends java.lang.Object
Request
Modifier and Type | Method and Description |
---|---|
RQLResult |
execute(ExecuteRequestBuilder executeRequestBuilder)
Deprecated.
Extracts an
ExecuteRequest from the supplied
ExecuteRequestBuilder , and executes it. |
RQLResult |
execute(java.lang.String robotUrl)
Deprecated.
Executes a robot specific robot with no input.
|
RQLResult |
execute(java.lang.String robotUrl,
RQLObject inputObject)
Deprecated.
will be removed in a future release, use execute(ExecuteRequestBuilder)
|
RQLResult |
execute(java.lang.String robotUrl,
RQLObjects inputObjects)
Deprecated.
will be removed in a future release, use execute(ExecuteRequestBuilder)
|
static RobotExecutor |
getRobotExecuter(RQLEngine engine,
RQLHandler handler)
Deprecated.
this method has been renamed to
getRobotExecutor(com.kapowtech.robosuite.api.java.rql.engine.RQLEngine, com.kapowtech.robosuite.api.java.rql.engine.RQLHandler) . |
static RobotExecutor |
getRobotExecutor()
Deprecated.
Returns a
RobotExecutor instance that uses the default RQL engine. |
static RobotExecutor |
getRobotExecutor(RQLEngine engine)
Deprecated.
Returns a
RobotExecutor instance that uses the specified RQL engine. |
static RobotExecutor |
getRobotExecutor(RQLEngine engine,
RQLHandler handler)
Deprecated.
Returns a
RobotExecutor instance that uses the specified RQL engine
and RQL handler. |
static RobotExecutor |
getRobotExecutor(RQLHandler handler)
Deprecated.
Returns a
RobotExecutor instance that uses the default RQL engine,
and the specified RQL handler. |
static RobotExecutor |
getRobotExecutor(java.lang.String host,
int port)
Deprecated.
Returns a
RobotExecutor instance that uses a RemoteRQLEngine
using a socket based protocol, and the specified host and port. |
RQLEngine |
getRQLEngine()
Deprecated.
Returns the
RQLEngine that is used to execute the queries. |
RQLHandler |
getRQLHandler()
Deprecated.
Resutns the
RQLHandler that is used to handle the
RQLResponse s and exceptions generated by the
RQLEngine . |
RQLResult |
ping()
Deprecated.
Ping's RoboServer.
|
RQLResult |
request(RQLRequest request)
Deprecated.
Processes an
RQLRequest . |
RQLResult |
stop(java.lang.String executeId)
Deprecated.
Requests that a robot with a specific execution id is stopped.
|
RQLResult |
stop(java.lang.String executeId,
java.lang.String username,
java.lang.String password)
Deprecated.
Requests that a robot with a specific execution id is stopped.
|
public static RobotExecutor getRobotExecutor()
RobotExecutor
instance that uses the default RQL engine.
The default RQL Engine is a DeploymentSupportRQLEngine
that
can be configured by editing the resource:
com.kapowtech.robosuite.api.java.rql.default-engine-deploy.xml
.
To override the default engine settings, place a file with an identical name in
the classpath.
RobotExecutor
instance that uses the default RQL engine.DeploymentSupportRQLEngine
public static RobotExecutor getRobotExecutor(RQLEngine engine)
RobotExecutor
instance that uses the specified RQL engine.engine
- the RQLEngine
that will process the requests.RobotExecutor
instance that uses the specified RQL engine.public static RobotExecutor getRobotExecutor(java.lang.String host, int port)
RobotExecutor
instance that uses a RemoteRQLEngine
using a socket based protocol, and the specified host and port.host
- the host name to connect to. A RoboServer running on the same machine will
have a host name of localhost
.port
- the port number that RoboServer listens on. RoboServers default listen port
is 50000.RobotExecutor
instance that uses a RemoteRQLEngine
using a socket based protocol, and the specified host and port.public static RobotExecutor getRobotExecutor(RQLHandler handler)
RobotExecutor
instance that uses the default RQL engine,
and the specified RQL handler.
The default RQL Engine is a DeploymentSupportRQLEngine
that
can be configured by editing the resource:
com.kapowtech.robosuite.api.java.rql.default-engine-deploy.xml
.
To override the default engine settings, place a file with an identical name in
the classpath.
handler
- the RQLHandler
to use.RobotExecutor
instance that uses the default RQL engine.DeploymentSupportRQLEngine
public static RobotExecutor getRobotExecutor(RQLEngine engine, RQLHandler handler)
RobotExecutor
instance that uses the specified RQL engine
and RQL handler.engine
- the RQLEngine
to use when executing the requests.handler
- the RQLHandler
to use.RobotExecutor
instance that uses the default RQL engine.DeploymentSupportRQLEngine
public static RobotExecutor getRobotExecuter(RQLEngine engine, RQLHandler handler)
getRobotExecutor(com.kapowtech.robosuite.api.java.rql.engine.RQLEngine, com.kapowtech.robosuite.api.java.rql.engine.RQLHandler)
.RobotExecutor
instance that uses the specified RQL engine
and RQL handler.engine
- the RQLEngine
to use when executing the requests.handler
- the RQLHandler
to use.RobotExecutor
instance that uses the default RQL engine.DeploymentSupportRQLEngine
public RQLResult execute(java.lang.String robotUrl, RQLObjects inputObjects) throws RQLException
ExecuteRequest
to a RoboServer.
The objects that are extracted by the robot can be accessed
by invoking the getObjects
method on the returned
RQLResult
object.
robotUrl
- the robot URL to requestinputObjects
- the input objects to pass to the robot.RQLException
- if the execution fails for some reason.java.lang.NullPointerException
- if either of the parameters are null
.ExecuteRequest
,
RQLResult.getObjects()
public RQLResult execute(java.lang.String robotUrl, RQLObject inputObject) throws RQLException
ExecuteRequest
to a RoboServer.
The objects that are extracted by the robot can be accessed
by invoking the getObjects
method on the returned
RQLResult
object.
robotUrl
- the robot URL to requestinputObject
- the single input object to pass to the robot.RQLException
- if the execution fails for some reason.java.lang.NullPointerException
- if either of the parameters are null
.ExecuteRequest
,
RQLResult.getObjects()
public RQLResult execute(java.lang.String robotUrl) throws RQLException
ExecuteRequest
to a RoboServer.
The objects that are extracted by the robot can be accessed
by invoking the getObjects
method on the returned
RQLResult
object.
robotUrl
- the robot URL to requestRQLException
- if the execution fails for some reason.java.lang.NullPointerException
- if the robotUrl
parameter is null
.ExecuteRequest
,
RQLResult.getObjects()
public RQLResult execute(ExecuteRequestBuilder executeRequestBuilder) throws RQLException
ExecuteRequest
from the supplied
ExecuteRequestBuilder
, and executes it.
This convenience method performs the equivalent
action as a call to execute(executeRequestBuilder.toExecuteRequest()
.executeRequestBuilder
- a mutable version of an ExecuteRequest
that is provided for convenience.RQLException
- if the execution fails for some reason.java.lang.IllegalArgumentException
- if the robotUrl
parameter is
not set in the ExecuteRequestBuilder
.ExecuteRequest
,
RQLResult.getObjects()
public RQLResult stop(java.lang.String executeId) throws RQLException
StopRequest
to a RoboServer.
Normally this method does not make much sense when executing robots synchronously. When a robot is executed synchronously with a call to RobotExecutor.request(), the execution has ended when the method returns. It can be used to stop robots that are being run by another thread. Use a status request to get a snapshot of all executing robots and their ids, and invoke this method to stop them.
executeId
- the execution Id of the robot. This id is the same as the
one returned from an ServerExecutionEventResponse
.
It can also be obtained from an asynchronously executing robot
by calling getExecutionId
on its FutureRQLResult
.RQLException
- if the execution fails for some reason.java.lang.NullPointerException
- if executeId
parameter is null
.StopRequest
public RQLResult stop(java.lang.String executeId, java.lang.String username, java.lang.String password) throws RQLException
StopRequest
to a RoboServer.
Normally this method does not make much sense when executing robots synchronously. When a robot is executed synchronously with a call to RobotExecutor.request(), the execution has ended when the method returns. It can be used to stop robots that are being run by another thread. Use a status request to get a snapshot of all executing robots and their ids, and invoke this method to stop them.
executeId
- the execution Id of the robot. This id is the same as the
one returned from an ServerExecutionEventResponse
.
It can also be obtained from an asynchronously executing robot
by calling getExecutionId
on its FutureRQLResult
.username
- userName if RoboServer authentication is enabledpassword
- password if password authentication is enabledRQLException
- if the execution fails for some reason.java.lang.NullPointerException
- if executeId
parameter is null
.StopRequest
public RQLResult ping() throws RQLException
PingResponse
objects.RQLException
- if the execution fails for some reason.PingRequest
,
PingResponse
public RQLResult request(RQLRequest request) throws RQLException
RQLRequest
.
This method is more general than the other methods in this class.request
- the RQLRequest
to send to the RoboServer.RQLException
- if the execution fails for some reason.java.lang.NullPointerException
- if either of the parameters are null
.ExecuteRequest
,
StopRequest
public RQLEngine getRQLEngine()
RQLEngine
that is used to execute the queries.
This method provides a way to access the default RQL engine:
RQLEngine defaultEngine = RobotExecutor.getRobotQuery().getRQLEngine();
RQLEngine
that is used to execute the queries.public RQLHandler getRQLHandler()
RQLHandler
that is used to handle the
RQLResponse
s and exceptions generated by the
RQLEngine
.RQLHandler
that is used to handle the
RQLResponse
s and exceptions generated by the
RQLEngine
.RoboSuite Java API, v11.4.7880