Package com.teracloud.streams.rest
Class StreamsConnection
java.lang.Object
com.teracloud.streams.rest.StreamsConnection
Connection to Streams.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanallowInsecureHosts(boolean allowInsecure) This function is used to disable checking the trusted certificate chain and should never be used in production environmentsstatic StreamsConnectioncreateInstance(String userName, String authToken, String url) Create a connection to Streams REST API.getInstance(String instanceId) Gets a specificinstanceidentified by the instanceId at this Streams connectionGets a list ofinstancesthat are available to this IBM Streams connectionfinal booleanisVerify()static StreamsConnectionofAuthenticator(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. Ifnulluser name defaults to value of the environment variableSTREAMS_USERNAMEif set, else the value of the Java system propertyuser.name.authToken- String representing the password to connect to the instance. Ifnullpassword defaults to value of the environment variableSTREAMS_PASSWORDif set.url- String representing the root url to the REST API. Ifnullurl defaults to value of the environment variableSTREAMS_REST_URLif 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 specificinstanceidentified 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 ofinstancesthat are available to this IBM Streams connection- Returns:
- List of
Streams Instancesavailable to this connection - Throws:
IOException
-