public interface ExpressionClient extends BaseClient
ClientFactory
class.
Obtaining an Instance of a Given Client
The Java client API implements a standard Factory design pattern for client instance creation.
ClientFactory
is the class that implements a factory and provides a way to obtain a
client object of a given type by calling a relevant method. For example:
string serviceUrl = "http://localhost:8080/SplusServer";
string username = "myusername";
string password = "mypassword";
ExpressionClient api = ClientFactory.getExpressionClient(serviceUrl, username, password);
You can use the expression service API to send TIBCO Enterprise Runtime for R or open-source R expressions directly to the engine on the server. When you send an expression request to server, you can send it synchronously or asynchronously, or you can schedule it to run at a specified time.
SplusDataResult
object containing the jobID
and
the status immediately. You can use the jobID to query the status of the job later.
The server returns an SplusDataResult
object, which contains data, a path to any
image, text, any errors or warnings, and (optionally) detailed log files.
When you create a Java application to run against a server where authentication is
activated, you should provide authentication with your application.
That is, when you create an an ExpressionClient
object, you add the parameters for
authenticating the user's name and password.
If the user's credentials cannot be validated, then the server
returns a NotAuthenticatedException
.
Note: If you plan to call the Java APIs on an https server, the client machine calling the APIs must first import the SSL certificate for that server machine. For more information about importing the certificate, see SSL Configuration HOW-TO on the Apache Tomcat Web site (external link).
TIBCO_STATSVCS_SSL_ALLOW_ANY_CERTIFICATE
Modifier and Type | Method and Description |
---|---|
SplusDataResult |
eval(java.lang.String command,
java.lang.Boolean isAsync)
Deprecated.
|
SplusDataResult |
eval(java.lang.String command,
java.lang.Boolean isAsync,
SplusDataRequest inputData)
Deprecated.
|
SplusDataResult |
eval(java.lang.String command,
java.util.Date startTime)
Deprecated.
|
SplusDataResult |
eval(java.lang.String command,
java.util.Date startTime,
SplusDataRequest inputData)
Deprecated.
|
SplusDataResult |
eval(java.lang.String command,
JobStartup jobStartup)
Sends a string containing one or more TIBCO Enterprise Runtime for R or open-source R command(s) to the server and
retrieves the results.
|
SplusDataResult |
eval(java.lang.String command,
JobStartup jobStartup,
BinaryDataRequest inputData)
Sends a string containing one or more TIBCO Enterprise Runtime for R or open-source R command(s), and optionally
a binary object containing data, to the server.
|
SplusDataResult |
eval(java.lang.String command,
JobStartup jobStartup,
SplusDataRequest inputData)
Sends a string containing one or more TIBCO Enterprise Runtime for R or open-source R command(s) to the server and
retrieves the results.
|
getConfigurationInfo, getExtendedServerInfo, getJobDetails, getNotificationListener, getNotificationListener, getPassword, getUserName, receiveBinaryObject, removeNotificationListener, removeNotificationListener, setNotificationListener, setNotificationListener, startSession, stopSession
SplusDataResult eval(java.lang.String command, java.lang.Boolean isAsync) throws BridgeException, NotAuthenticatedException
If the code contains a problem, the warning(s) or error are returned in the
SplusDataResult
object. That is, errors with code do not result in an
ApiException
being thrown; those occur only with server connection errors.
command
- TIBCO Enterprise Runtime for R or open-source R command(s) to be evaluated. Cannot be null
.isAsync
- true
if the command(s) should be run asynchronously; otherwise
false
. Required. An asynchronous command immediately returns an SplusDataResult
object containing the jobId
and status. You can retain the jobId
and use it later to query
the job status.SplusDataResult
object containing the results of the evaluation.
(An asynchronous evaluation immediately returns the SplusDataResult
object
containing only the jobId
and status; a synchronous request returns an SplusDataResult
object containing all appropriate properties.)NotAuthenticatedException
- if the server refuses to fulfill the request due to security requirements.BridgeException
- if the client is unable to communicate with the server.java.lang.IllegalArgumentException
- if command
is null
or empty.SplusDataResult
,
NotAuthenticatedException
,
BridgeException
SplusDataResult eval(java.lang.String command, java.lang.Boolean isAsync, SplusDataRequest inputData) throws BridgeException, NotAuthenticatedException
If the code contains a problem, the warning(s) or error are returned in the
SplusDataResult
object. That is, errors with code do not result in an
ApiException
being thrown; those occur only with server connection errors.
command
- TIBCO Enterprise Runtime for R or open-source R command(s) to be evaluated. Cannot be null
.isAsync
- true
if the command(s) should be run asynchronously; otherwise
false
. Required. An asynchronous command immediately returns an SplusDataResult
object containing the jobId
and status. You can retain the jobId
and use it later to query
the job status.inputData
- contains a list of objects that are passed in as input arguments for evaluationSplusDataResult
object containing the results of the evaluation.
(An asynchronous evaluation immediately returns the SplusDataResult
object
containing only the jobId
and status; a synchronous request returns an SplusDataResult
object containing all appropriate properties.)NotAuthenticatedException
- if the server refuses to fulfill the request due to security requirements.BridgeException
- if the client is unable to communicate with the server.java.lang.IllegalArgumentException
- if command
is null
or empty.SplusDataResult
,
NotAuthenticatedException
,
BridgeException
SplusDataResult eval(java.lang.String command, java.util.Date startTime) throws BridgeException, NotAuthenticatedException
You can specify the time to run this job. If the time contains an error (for example, if it is in the past), then the job runs as an asynchronous job on the first available engine.
If the code contains a problem, the warning(s) or error are returned in the
SplusDataResult
object. That is, errors with code do not result in an
ApiException
being thrown; those occur only with server connection errors.
command
- TIBCO Enterprise Runtime for R or open-source R command(s) to be evaluated.startTime
- The time to start the job. Cannot be null
.SplusDataResult
object containing the results of the evaluation.
(An asynchronous evaluation immediately returns the SplusDataResult
object
containing only the jobId
and status; a synchronous request returns an SplusDataResult
object containing all appropriate properties.)NotAuthenticatedException
- if the server refuses to fulfill the request due to security requirements.BridgeException
- if the client is unable to communicate with the server.java.lang.IllegalArgumentException
- if command
is null
or empty, or startTime is
null
.SplusDataResult
,
NotAuthenticatedException
,
BridgeException
SplusDataResult eval(java.lang.String command, java.util.Date startTime, SplusDataRequest inputData) throws BridgeException, NotAuthenticatedException
You can specify the time to run this job. If the time contains an error (for example, if it is in the past), then the job runs as an asynchronous job on the first available S engine.
If the code contains a problem, the warning(s) or error are returned in the
SplusDataResult
object. That is, errors with code do not result in an
ApiException
being thrown; those occur only with server connection errors.
command
- TIBCO Enterprise Runtime for R or open-source R command(s) to be evaluated.startTime
- The time to start the job. Cannot be null
.inputData
- contains a list of objects that are passed in as input arguments for evaluationSplusDataResult
object containing the results of the evaluation.
(An asynchronous evaluation immediately returns the SplusDataResult
object
containing only the jobId
and status; a synchronous request returns an SplusDataResult
object containing all appropriate properties.)NotAuthenticatedException
- if the server refuses to fulfill the request due to security requirements.BridgeException
- if the client is unable to communicate with the server.java.lang.IllegalArgumentException
- if command
is null
or empty, or startTime is
null
.SplusDataResult
,
NotAuthenticatedException
,
BridgeException
SplusDataResult eval(java.lang.String command, JobStartup jobStartup, SplusDataRequest inputData) throws NotAuthenticatedException, ServerTimeoutException
command
- The TIBCO Enterprise Runtime for R or open-source R command(s) to be evaluated.inputData
- Contains a list of objects that are passed in as input arguments for evaluation.jobStartup
- The job startup specification.SplusDataResult
object containing the results of the job.NotAuthenticatedException
- if the user could not be authenticated.ServerTimeoutException
- if a synchronous job doesn't compete within the timeout specified.JobStartup
SplusDataResult eval(java.lang.String command, JobStartup jobStartup) throws NotAuthenticatedException, ServerTimeoutException
command
- The TIBCO Enterprise Runtime for R or open-source R command(s) to be evaluated.jobStartup
- The job startup specification.SplusDataResult
object containing the results of the job.NotAuthenticatedException
- if the user could not be authenticated.ServerTimeoutException
- if a synchronous job doesn't compete within the timeout specified.JobStartup
SplusDataResult eval(java.lang.String command, JobStartup jobStartup, BinaryDataRequest inputData) throws NotAuthenticatedException, ServerTimeoutException
eval
that manages sending and receiving binary objects.)command
- The TIBCO Enterprise Runtime for R or open-source R command(s) to be evaluated.jobStartup
- The job startup specification.inputData
- a BinaryDataResquest
object containing zero or more serialized arguments.SplusDataResult
object containing the SplusDataResult
and
a serialized binary object (if one exists).NotAuthenticatedException
- if the user could not be authenticated.ServerTimeoutException
- if a synchronous job doesn't compete within the timeout specified.JobStartup