public interface FunctionClient 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";
FunctionClient api = ClientFactory.getFunctionClient(serviceUrl, username, password);
You can identify an R language (TIBCO Enterprise Runtime for R or open-source R) function by providing its package name, along with the function name. You can also provide any function arguments, whether they are strings or objects.
When you send a function to the server, you can send it synchronously or asynchronously, or you can schedule it to run at a specified time.
The function service processes only one function at a time, and the function must exist in a library on the server. Most of the time, you will probably want to perform a series of tasks on a data set, including importing the data, cleaning it, modeling it, and graphing the results of your analysis. To accomplish complex analyses with TIBCO Spotfire Statistics Services function service, you can:
eval()
to run your function, specify your library or
package name in the packageName
argument.
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 a FunctionClient
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).
ClientFactory
TIBCO_STATSVCS_SSL_ALLOW_ANY_CERTIFICATE
Modifier and Type | Method and Description |
---|---|
SplusDataResult |
eval(java.lang.String functionName,
java.lang.String packageName,
JobStartup jobStartup,
BinaryDataRequest inputData)
Sends one function to the server, and optionally a binary object containing data,
to the server.
|
SplusDataResult |
eval(java.lang.String functionName,
java.lang.String packageName,
java.util.Map<java.lang.String,java.lang.String[]> args,
boolean isAsync)
Deprecated.
use eval() with JobStartup definition instead.
|
SplusDataResult |
eval(java.lang.String functionName,
java.lang.String packageName,
java.util.Map<java.lang.String,java.lang.String[]> args,
java.util.Date startTime)
Deprecated.
use eval() with JobStartup definition instead.
|
SplusDataResult |
eval(java.lang.String functionName,
java.lang.String packageName,
java.util.Map<java.lang.String,java.lang.String[]> args,
JobStartup jobStartup)
Sends one R language (TIBCO Enterprise Runtime for R or open-source R) function to the server and retrieves the results.
|
SplusDataResult |
eval(java.lang.String functionName,
java.lang.String packageName,
SplusDataRequest dataSet,
boolean isAsync)
Deprecated.
use eval() with JobStartup definition instead.
|
SplusDataResult |
eval(java.lang.String functionName,
java.lang.String packageName,
SplusDataRequest dataSet,
java.util.Date startTime)
Deprecated.
use eval() with JobStartup definition instead.
|
SplusDataResult |
eval(java.lang.String functionName,
java.lang.String packageName,
SplusDataRequest dataSet,
JobStartup jobStartup)
Sends one R language (TIBCO Enterprise Runtime for R or open-source R) function 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 functionName, java.lang.String packageName, java.util.Map<java.lang.String,java.lang.String[]> args, JobStartup jobStartup) throws NotAuthenticatedException, ServerTimeoutException
The server evaluates only one function at a time, and that function must exist on the server. If your evaluation requires a complex set of instructions (for example, cleaning data, modeling data, and graphing results), wrap your code in one function and save it to a library that you can deploy on the server. See the TIBCO Spotfire Statistics Services User's Guide and the TIBCO Enterprise Runtime for R documentation for more information.
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.
functionName
- The name of the function that you want to run. Required. Cannot be null
or empty.packageName
- The name of the package containing the function.args
- The function arguments. Optional.jobStartup
- Job Startup specification - can be either ImmediateJobStartup
,
which can be either synchronous or asynchronous or ScheduledJobStartup
, which causes a job
to be scheduled at a specified time in the future.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 user or password cannot be authenticated.BridgeException
- if the client is unable to communicate with the server.java.lang.IllegalArgumentException
- if the functionName
is null
or empty.ServerTimeoutException
- if a synchronous job doesn't compete within the timeout specifieduploadPackageVersion
SplusDataResult eval(java.lang.String functionName, java.lang.String packageName, java.util.Map<java.lang.String,java.lang.String[]> args, boolean isAsync) throws NotAuthenticatedException
functionName
- The name of the function that you want to run. Required. Cannot be null
or empty.packageName
- The name of the package containing the function.args
- The function arguments. Optional.isAsync
- NotAuthenticatedException
- if the user or password cannot be authenticated.eval(String, String, Map, JobStartup)
SplusDataResult eval(java.lang.String functionName, java.lang.String packageName, SplusDataRequest dataSet, JobStartup jobStartup) throws NotAuthenticatedException, ServerTimeoutException
The server evaluates only one function at a time, and that function must exist
on the server. If your evaluation requires a complex set of instructions (for example,
cleaning data, modeling data, and graphing results), wrap your code in one function
and save it to a package that you can deploy on the server. See the TIBCO Spotfire Statistics
Services User's Guide and the SplusDataResult
object. That is, errors with code do not result in an
ApiException
being thrown. These occur only with server connection errors.
functionName
- The name of the function that you want to run. Required. Cannot be null
or empty.packageName
- The name of the package containing the function.dataSet
- A data set object containing a list of objects to be used as arguments. Optional.jobStartup
- The Job Startup specification. Can be either ImmediateJobStartup
,
which can be either synchronous or asynchronous or ScheduledJobStartup
, which causes a job
to be scheduled at a specified time in the future.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 the functionName
is null
or empty.ServerTimeoutException
- if a synchronous job doesn't compete within the timeout specified.uploadPackageVersion
SplusDataResult eval(java.lang.String functionName, java.lang.String packageName, SplusDataRequest dataSet, boolean isAsync) throws NotAuthenticatedException
functionName
- The name of the function that you want to run. For more information,
see the Open-source R language reference or TIBCO Enterprise Runtime for R Language Reference. Required. Cannot be null
or empty.packageName
- The name of the package containing the function.dataSet
- A data set object containing a list of objects to be used as arguments. Optional.isAsync
- Set to true
to run the job asynchronously; otherwise set to false
.NotAuthenticatedException
- if the user or password cannot be authenticated.eval(String, String, SplusDataRequest, JobStartup)
SplusDataResult eval(java.lang.String functionName, java.lang.String packageName, java.util.Map<java.lang.String,java.lang.String[]> args, java.util.Date startTime) throws NotAuthenticatedException
TIBCO Spotfire Statistics Services evaluates only one function at a time, and that function must exist on the server. If your evaluation requires a complex set of instructions (for example, cleaning data, modeling data, and graphing results), wrap your code in one function and save it to a library that you can deploy on the server. See your server administrator for more information.
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 any problems, 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.
functionName
- The name of the function that you want to run. For more information,
see language reference. Required. Cannot be null
or empty.packageName
- The name of the package containing the function.args
- The function arguments. Optional.startTime
- The time to start the job.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 user or password cannot be authenticated.BridgeException
- if the client is unable to communicate with the server.java.lang.IllegalArgumentException
- if the functionName
is null
or empty.SplusDataResult eval(java.lang.String functionName, java.lang.String packageName, SplusDataRequest dataSet, java.util.Date startTime) throws NotAuthenticatedException
TIBCO Spotfire Statistics Services evaluates only one function at a time, and that function must exist on the server. If your evaluation requires a complex set of instructions (for example, cleaning data, modeling data, and graphing results), wrap your code in one function and save it to a library that you can deploy on the server. See your server administrator for more information.
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 any problems, 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.
functionName
- The name of the function that you want to run. For more information,
see the library reference. Required. Cannot be null
or empty.packageName
- The name of the package containing the function.dataSet
- a data set object containing a list of objects to be used as arguments. Optional.startTime
- The time to start the job.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 the functionName
is null
or empty.SplusDataResult eval(java.lang.String functionName, java.lang.String packageName, JobStartup jobStartup, BinaryDataRequest inputData) throws NotAuthenticatedException, ServerTimeoutException
eval
that manages
sending and receiving binary objects.)functionName
- The name of the S function that you want to run. Required. Cannot be null
or empty.packageName
- The name of the package containing the function.jobStartup
- The Job Startup specification. Can be either ImmediateJobStartup
,
which can be either synchronous or asynchronous or ScheduledJobStartup
, which causes a job
to be scheduled at a specified time in the future.inputData
- BinaryDataRequest
object containing zero or more serialized arguments.SplusDataResult
object containing the SplusDataResult
plus
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.