com.ibm.streamsx.rest
Class StreamsConnection
- java.lang.Object
-
- com.ibm.streamsx.rest.StreamsConnection
-
public class StreamsConnection extends java.lang.Object
Connection to IBM Streams.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
allowInsecureHosts(boolean allowInsecure)
This function is used to disable checking the trusted certificate chain and should never be used in production environmentsstatic StreamsConnection
createInstance(java.lang.String userName, java.lang.String authToken, java.lang.String url)
Create a connection to IBM Streams REST API.java.util.function.Function<org.apache.http.client.fluent.Executor,java.lang.String>
getAuthenticator()
Instance
getInstance(java.lang.String instanceId)
Gets a specificinstance
identified by the instanceId at this IBM Streams connectionjava.util.List<Instance>
getInstances()
Gets a list ofinstances
that are available to this IBM Streams connectionboolean
isVerify()
static StreamsConnection
ofAuthenticator(java.lang.String url, java.util.function.Function<org.apache.http.client.fluent.Executor,java.lang.String> authenticator)
-
-
-
Method Detail
-
createInstance
public static StreamsConnection createInstance(java.lang.String userName, java.lang.String authToken, java.lang.String url)
Create a connection to IBM Streams REST API.- Parameters:
userName
- String representing the user name to connect to the instance. Ifnull
user name defaults to value of the environment variableSTREAMS_USERNAME
if set, else the value of the Java system propertyuser.name
.authToken
- String representing the password to connect to the instance. Ifnull
password defaults to value of the environment variableSTREAMS_PASSWORD
if set.url
- String representing the root url to the REST API. Ifnull
url defaults to value of the environment variableSTREAMS_REST_URL
if set.- Returns:
- a connection to IBM Streams
-
ofAuthenticator
public static StreamsConnection ofAuthenticator(java.lang.String url, java.util.function.Function<org.apache.http.client.fluent.Executor,java.lang.String> authenticator)
-
getAuthenticator
public java.util.function.Function<org.apache.http.client.fluent.Executor,java.lang.String> getAuthenticator()
-
allowInsecureHosts
public boolean allowInsecureHosts(boolean allowInsecure)
This function is used to disable checking the trusted certificate chain and should never be used in production environments- Parameters:
allowInsecure
-- true - disables checking
- false - enables checking (default)
- Returns:
- a boolean indicating the state of the connection after this
method was called.
- true - if checking is disabled
- false - if checking is enabled
-
isVerify
public final boolean isVerify()
-
getInstance
public Instance getInstance(java.lang.String instanceId) throws java.io.IOException
Gets a specificinstance
identified by the instanceId at this IBM Streams connection- Parameters:
instanceId
- name of the instance to be retrieved- Returns:
- a single
Instance
- Throws:
java.io.IOException
-
getInstances
public java.util.List<Instance> getInstances() throws java.io.IOException
Gets a list ofinstances
that are available to this IBM Streams connection- Returns:
- List of
IBM Streams Instances
available to this connection - Throws:
java.io.IOException
-
-