Class StreamsConnection

java.lang.Object
com.teracloud.streams.rest.StreamsConnection

public class StreamsConnection extends Object
Connection to Streams.
  • Method Details

    • createInstance

      public static StreamsConnection createInstance(String userName, String authToken, String url)
      Create a connection to Streams REST API.
      Parameters:
      userName - String representing the user name to connect to the instance. If null user name defaults to value of the environment variable STREAMS_USERNAME if set, else the value of the Java system property user.name.
      authToken - String representing the password to connect to the instance. If null password defaults to value of the environment variable STREAMS_PASSWORD if set.
      url - String representing the root url to the REST API. If null url defaults to value of the environment variable STREAMS_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

      public Function<org.apache.http.client.fluent.Executor,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(String instanceId) throws IOException
      Gets a specific instance identified by the instanceId at this Streams connection
      Parameters:
      instanceId - name of the instance to be retrieved
      Returns:
      a single Instance
      Throws:
      IOException
    • getInstances

      public List<Instance> getInstances() throws IOException
      Gets a list of instances that are available to this IBM Streams connection
      Returns:
      List of Streams Instances available to this connection
      Throws:
      IOException