Package com.teracloud.streams.rest
Class StreamsConnection
java.lang.Object
com.teracloud.streams.rest.StreamsConnection
Connection to Streams.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
allowInsecureHosts
(boolean allowInsecure) This function is used to disable checking the trusted certificate chain and should never be used in production environmentsstatic StreamsConnection
createInstance
(String userName, String authToken, String url) Create a connection to Streams REST API.getInstance
(String instanceId) Gets a specificinstance
identified by the instanceId at this Streams connectionGets a list ofinstances
that are available to this IBM Streams connectionfinal boolean
isVerify()
static StreamsConnection
ofAuthenticator
(String url, Function<org.apache.http.client.fluent.Executor, String> authenticator)
-
Method Details
-
createInstance
Create a connection to 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 Streams
-
ofAuthenticator
public static StreamsConnection ofAuthenticator(String url, Function<org.apache.http.client.fluent.Executor, String> authenticator) -
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
Gets a specificinstance
identified by the instanceId at this Streams connection- Parameters:
instanceId
- name of the instance to be retrieved- Returns:
- a single
Instance
- Throws:
IOException
-
getInstances
Gets a list ofinstances
that are available to this IBM Streams connection- Returns:
- List of
Streams Instances
available to this connection - Throws:
IOException
-