public interface StreamingAnalyticsService
Modifier and Type | Method and Description |
---|---|
Result<java.util.List<java.io.File>,com.google.gson.JsonObject> |
build(java.io.File archive,
java.lang.String buildName,
com.google.gson.JsonObject buildConfig)
Submit an archive to build against Streaming Analytics service.
|
Result<Job,com.google.gson.JsonObject> |
buildAndSubmitJob(java.io.File archive,
com.google.gson.JsonObject jco,
java.lang.String buildName,
com.google.gson.JsonObject buildConfig)
Submit an archive to build and run on the Streaming Analytics service.
|
Result<Job,com.google.gson.JsonObject> |
buildAndSubmitJob(java.io.File archive,
com.google.gson.JsonObject jco,
java.lang.String buildName)
Submit an archive to build and run on the Streaming Analytics service.
|
Result<StreamingAnalyticsService,com.google.gson.JsonObject> |
checkStatus(boolean requireRunning)
Check the status of this Streaming Analytics Service.
|
Instance |
getInstance()
Gets the
IBM Streams Instance object for the Streaming
Analytics service. |
java.lang.String |
getName()
Get the service name.
|
static StreamingAnalyticsService |
of(com.google.gson.JsonElement vcapServices,
java.lang.String serviceName)
Access to a Streaming Analytics service from service name and VCAP services.
|
static StreamingAnalyticsService |
of(com.google.gson.JsonObject serviceDefinition)
Access to a Streaming Analytics service from a service definition.
|
Result<Job,com.google.gson.JsonObject> |
submitJob(java.io.File bundle,
com.google.gson.JsonObject jco)
Submit a Streams bundle to run on the Streaming Analytics Service.
|
static StreamingAnalyticsService of(com.google.gson.JsonElement vcapServices, java.lang.String serviceName) throws java.io.IOException
vcapServices
may be one of:
vcapServices
is null
then the environment
variable VCAP_SERVICES
must either contain the valid service
definitions and credentials or point to a file containing the definitions
and credentials.
serviceName
is null
then the environment
variable STREAMING_ANALYTICS_SERVICE_NAME
must contain the name of
the required service.
serviceName
must exist in the
defined VCAP services.vcapServices
- JSON representation of VCAP service definitions.serviceName
- Name of the Streaming Analytics service to access.StreamingAnalyticsService
for serviceName
.java.io.IOException
- Error connecting to the service.static StreamingAnalyticsService of(com.google.gson.JsonObject serviceDefinition) throws java.io.IOException
{ "type": "streaming-analytics", "name": "
service-name": "credentials": { ... } }
with the service credentials as the value of the credentials
key.
serviceDefinition
- Definition of the service to access.java.io.IOException
- Error connecting to the service.java.lang.String getName()
service
is returned.service
if it is unknown.Result<StreamingAnalyticsService,com.google.gson.JsonObject> checkStatus(boolean requireRunning) throws java.io.IOException
The returned Result
instance has:
Result.getId()
returning null
.Result.getElement()
returning this
.Result.getRawResult()
return the raw JSON response.Result.isOk()
returns true
if the service is running otherwise false
.requireRunning
- If true
and the service is not running then an IllegalStateException
is thrown, otherwise the return indicates the status of the service.java.io.IOException
- Error communicating with the service.java.lang.IllegalStateException
- requireRunning
is true
and the service is not running.Result<Job,com.google.gson.JsonObject> submitJob(java.io.File bundle, com.google.gson.JsonObject jco) throws java.io.IOException
The returned Result
instance has:
Result.getId()
returning the job identifier or null
if
a job was not created..Result.getElement()
returning a Job
instance for the submitted job or null
if
a job was not created.Result.getRawResult()
return the raw JSON response.bundle
- A streams application bundlejco
- Job configuration overlay in JSON format.java.io.IOException
- Error communicating with the service.Result<Job,com.google.gson.JsonObject> buildAndSubmitJob(java.io.File archive, com.google.gson.JsonObject jco, java.lang.String buildName, com.google.gson.JsonObject buildConfig) throws java.io.IOException
The returned Result
instance has:
Result.getId()
returning the job identifier or null
if
a job was not created..Result.getElement()
returning a Job
instance for the submitted job or null
if
a job was not created.Result.getRawResult()
return the raw JSON response.archive
- The application archive to build.jco
- Job configuration overlay in JSON format.buildName
- A name for the build, or null.buildConfig
- Build configuration, or null.java.io.IOException
- Error communicating with the service.Result<java.util.List<java.io.File>,com.google.gson.JsonObject> build(java.io.File archive, java.lang.String buildName, com.google.gson.JsonObject buildConfig) throws java.io.IOException
The returned Result
instance has:
Result.getId()
returning the build identifier.Result.getElement()
returning a list of the created sab files.Result.getRawResult()
return the JSON build information.Only supported for Streaming Analytics with v2 REST api.
archive
- The application archive to build.buildName
- A name for the build, or null.buildConfig
- Build configuration, or null.java.io.IOException
- Error communicating with the service.Result<Job,com.google.gson.JsonObject> buildAndSubmitJob(java.io.File archive, com.google.gson.JsonObject jco, java.lang.String buildName) throws java.io.IOException
buildAndSubmitJob(File, JsonObject, String, JsonObject)
passing null
for build configuration.archive
- The application archive to build.jco
- Job configuration overlay in JSON format.buildName
- A name for the build, or null.java.io.IOException
- Error communicating with the service.Instance getInstance() throws java.io.IOException
IBM Streams Instance
object for the Streaming
Analytics service.IBM Streams Instance
associated with this
service.java.io.IOException