Interface IoTSecureTunnelingAsyncClient

    • Method Detail

      • closeTunnel

        default CompletableFuture<CloseTunnelResponse> closeTunnel​(CloseTunnelRequest closeTunnelRequest)

        Closes a tunnel identified by the unique tunnel id. When a CloseTunnel request is received, we close the WebSocket connections between the client and proxy server so no data can be transmitted.

        Requires permission to access the CloseTunnel action.

        Parameters:
        closeTunnelRequest -
        Returns:
        A Java Future containing the result of the CloseTunnel operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • closeTunnel

        default CompletableFuture<CloseTunnelResponse> closeTunnel​(Consumer<CloseTunnelRequest.Builder> closeTunnelRequest)

        Closes a tunnel identified by the unique tunnel id. When a CloseTunnel request is received, we close the WebSocket connections between the client and proxy server so no data can be transmitted.

        Requires permission to access the CloseTunnel action.


        This is a convenience which creates an instance of the CloseTunnelRequest.Builder avoiding the need to create one manually via CloseTunnelRequest.builder()

        Parameters:
        closeTunnelRequest - A Consumer that will call methods on CloseTunnelRequest.Builder to create a request.
        Returns:
        A Java Future containing the result of the CloseTunnel operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • describeTunnel

        default CompletableFuture<DescribeTunnelResponse> describeTunnel​(DescribeTunnelRequest describeTunnelRequest)

        Gets information about a tunnel identified by the unique tunnel id.

        Requires permission to access the DescribeTunnel action.

        Parameters:
        describeTunnelRequest -
        Returns:
        A Java Future containing the result of the DescribeTunnel operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • describeTunnel

        default CompletableFuture<DescribeTunnelResponse> describeTunnel​(Consumer<DescribeTunnelRequest.Builder> describeTunnelRequest)

        Gets information about a tunnel identified by the unique tunnel id.

        Requires permission to access the DescribeTunnel action.


        This is a convenience which creates an instance of the DescribeTunnelRequest.Builder avoiding the need to create one manually via DescribeTunnelRequest.builder()

        Parameters:
        describeTunnelRequest - A Consumer that will call methods on DescribeTunnelRequest.Builder to create a request.
        Returns:
        A Java Future containing the result of the DescribeTunnel operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • listTagsForResource

        default CompletableFuture<ListTagsForResourceResponse> listTagsForResource​(ListTagsForResourceRequest listTagsForResourceRequest)

        Lists the tags for the specified resource.

        Parameters:
        listTagsForResourceRequest -
        Returns:
        A Java Future containing the result of the ListTagsForResource operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • listTagsForResource

        default CompletableFuture<ListTagsForResourceResponse> listTagsForResource​(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest)

        Lists the tags for the specified resource.


        This is a convenience which creates an instance of the ListTagsForResourceRequest.Builder avoiding the need to create one manually via ListTagsForResourceRequest.builder()

        Parameters:
        listTagsForResourceRequest - A Consumer that will call methods on ListTagsForResourceRequest.Builder to create a request.
        Returns:
        A Java Future containing the result of the ListTagsForResource operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • listTunnels

        default CompletableFuture<ListTunnelsResponse> listTunnels​(ListTunnelsRequest listTunnelsRequest)

        List all tunnels for an Amazon Web Services account. Tunnels are listed by creation time in descending order, newer tunnels will be listed before older tunnels.

        Requires permission to access the ListTunnels action.

        Parameters:
        listTunnelsRequest -
        Returns:
        A Java Future containing the result of the ListTunnels operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • listTunnels

        default CompletableFuture<ListTunnelsResponse> listTunnels​(Consumer<ListTunnelsRequest.Builder> listTunnelsRequest)

        List all tunnels for an Amazon Web Services account. Tunnels are listed by creation time in descending order, newer tunnels will be listed before older tunnels.

        Requires permission to access the ListTunnels action.


        This is a convenience which creates an instance of the ListTunnelsRequest.Builder avoiding the need to create one manually via ListTunnelsRequest.builder()

        Parameters:
        listTunnelsRequest - A Consumer that will call methods on ListTunnelsRequest.Builder to create a request.
        Returns:
        A Java Future containing the result of the ListTunnels operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • listTunnelsPaginator

        default ListTunnelsPublisher listTunnelsPaginator​(ListTunnelsRequest listTunnelsRequest)

        List all tunnels for an Amazon Web Services account. Tunnels are listed by creation time in descending order, newer tunnels will be listed before older tunnels.

        Requires permission to access the ListTunnels action.


        This is a variant of listTunnels(software.amazon.awssdk.services.iotsecuretunneling.model.ListTunnelsRequest) operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.

        When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a new Subscription i.e., a new contract to stream data from the starting request.

        The following are few ways to use the response class:

        1) Using the subscribe helper method
         
         software.amazon.awssdk.services.iotsecuretunneling.paginators.ListTunnelsPublisher publisher = client.listTunnelsPaginator(request);
         CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
         future.get();
         
         
        2) Using a custom subscriber
         
         software.amazon.awssdk.services.iotsecuretunneling.paginators.ListTunnelsPublisher publisher = client.listTunnelsPaginator(request);
         publisher.subscribe(new Subscriber<software.amazon.awssdk.services.iotsecuretunneling.model.ListTunnelsResponse>() {
         
         public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
         
         
         public void onNext(software.amazon.awssdk.services.iotsecuretunneling.model.ListTunnelsResponse response) { //... };
         });
         
        As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

        Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.

        Note: If you prefer to have control on service calls, use the listTunnels(software.amazon.awssdk.services.iotsecuretunneling.model.ListTunnelsRequest) operation.

        Parameters:
        listTunnelsRequest -
        Returns:
        A custom publisher that can be subscribed to request a stream of response pages.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • listTunnelsPaginator

        default ListTunnelsPublisher listTunnelsPaginator​(Consumer<ListTunnelsRequest.Builder> listTunnelsRequest)

        List all tunnels for an Amazon Web Services account. Tunnels are listed by creation time in descending order, newer tunnels will be listed before older tunnels.

        Requires permission to access the ListTunnels action.


        This is a variant of listTunnels(software.amazon.awssdk.services.iotsecuretunneling.model.ListTunnelsRequest) operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.

        When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a new Subscription i.e., a new contract to stream data from the starting request.

        The following are few ways to use the response class:

        1) Using the subscribe helper method
         
         software.amazon.awssdk.services.iotsecuretunneling.paginators.ListTunnelsPublisher publisher = client.listTunnelsPaginator(request);
         CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
         future.get();
         
         
        2) Using a custom subscriber
         
         software.amazon.awssdk.services.iotsecuretunneling.paginators.ListTunnelsPublisher publisher = client.listTunnelsPaginator(request);
         publisher.subscribe(new Subscriber<software.amazon.awssdk.services.iotsecuretunneling.model.ListTunnelsResponse>() {
         
         public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
         
         
         public void onNext(software.amazon.awssdk.services.iotsecuretunneling.model.ListTunnelsResponse response) { //... };
         });
         
        As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

        Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.

        Note: If you prefer to have control on service calls, use the listTunnels(software.amazon.awssdk.services.iotsecuretunneling.model.ListTunnelsRequest) operation.

        This is a convenience which creates an instance of the ListTunnelsRequest.Builder avoiding the need to create one manually via ListTunnelsRequest.builder()

        Parameters:
        listTunnelsRequest - A Consumer that will call methods on ListTunnelsRequest.Builder to create a request.
        Returns:
        A custom publisher that can be subscribed to request a stream of response pages.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • openTunnel

        default CompletableFuture<OpenTunnelResponse> openTunnel​(OpenTunnelRequest openTunnelRequest)

        Creates a new tunnel, and returns two client access tokens for clients to use to connect to the IoT Secure Tunneling proxy server.

        Requires permission to access the OpenTunnel action.

        Parameters:
        openTunnelRequest -
        Returns:
        A Java Future containing the result of the OpenTunnel operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • LimitExceededException Thrown when a tunnel limit is exceeded.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • openTunnel

        default CompletableFuture<OpenTunnelResponse> openTunnel​(Consumer<OpenTunnelRequest.Builder> openTunnelRequest)

        Creates a new tunnel, and returns two client access tokens for clients to use to connect to the IoT Secure Tunneling proxy server.

        Requires permission to access the OpenTunnel action.


        This is a convenience which creates an instance of the OpenTunnelRequest.Builder avoiding the need to create one manually via OpenTunnelRequest.builder()

        Parameters:
        openTunnelRequest - A Consumer that will call methods on OpenTunnelRequest.Builder to create a request.
        Returns:
        A Java Future containing the result of the OpenTunnel operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • LimitExceededException Thrown when a tunnel limit is exceeded.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • rotateTunnelAccessToken

        default CompletableFuture<RotateTunnelAccessTokenResponse> rotateTunnelAccessToken​(RotateTunnelAccessTokenRequest rotateTunnelAccessTokenRequest)

        Revokes the current client access token (CAT) and returns new CAT for clients to use when reconnecting to secure tunneling to access the same tunnel.

        Requires permission to access the RotateTunnelAccessToken action.

        Rotating the CAT doesn't extend the tunnel duration. For example, say the tunnel duration is 12 hours and the tunnel has already been open for 4 hours. When you rotate the access tokens, the new tokens that are generated can only be used for the remaining 8 hours.

        Parameters:
        rotateTunnelAccessTokenRequest -
        Returns:
        A Java Future containing the result of the RotateTunnelAccessToken operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • rotateTunnelAccessToken

        default CompletableFuture<RotateTunnelAccessTokenResponse> rotateTunnelAccessToken​(Consumer<RotateTunnelAccessTokenRequest.Builder> rotateTunnelAccessTokenRequest)

        Revokes the current client access token (CAT) and returns new CAT for clients to use when reconnecting to secure tunneling to access the same tunnel.

        Requires permission to access the RotateTunnelAccessToken action.

        Rotating the CAT doesn't extend the tunnel duration. For example, say the tunnel duration is 12 hours and the tunnel has already been open for 4 hours. When you rotate the access tokens, the new tokens that are generated can only be used for the remaining 8 hours.


        This is a convenience which creates an instance of the RotateTunnelAccessTokenRequest.Builder avoiding the need to create one manually via RotateTunnelAccessTokenRequest.builder()

        Parameters:
        rotateTunnelAccessTokenRequest - A Consumer that will call methods on RotateTunnelAccessTokenRequest.Builder to create a request.
        Returns:
        A Java Future containing the result of the RotateTunnelAccessToken operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • tagResource

        default CompletableFuture<TagResourceResponse> tagResource​(TagResourceRequest tagResourceRequest)

        A resource tag.

        Parameters:
        tagResourceRequest -
        Returns:
        A Java Future containing the result of the TagResource operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • tagResource

        default CompletableFuture<TagResourceResponse> tagResource​(Consumer<TagResourceRequest.Builder> tagResourceRequest)

        A resource tag.


        This is a convenience which creates an instance of the TagResourceRequest.Builder avoiding the need to create one manually via TagResourceRequest.builder()

        Parameters:
        tagResourceRequest - A Consumer that will call methods on TagResourceRequest.Builder to create a request.
        Returns:
        A Java Future containing the result of the TagResource operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • untagResource

        default CompletableFuture<UntagResourceResponse> untagResource​(UntagResourceRequest untagResourceRequest)

        Removes a tag from a resource.

        Parameters:
        untagResourceRequest -
        Returns:
        A Java Future containing the result of the UntagResource operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation
      • untagResource

        default CompletableFuture<UntagResourceResponse> untagResource​(Consumer<UntagResourceRequest.Builder> untagResourceRequest)

        Removes a tag from a resource.


        This is a convenience which creates an instance of the UntagResourceRequest.Builder avoiding the need to create one manually via UntagResourceRequest.builder()

        Parameters:
        untagResourceRequest - A Consumer that will call methods on UntagResourceRequest.Builder to create a request.
        Returns:
        A Java Future containing the result of the UntagResource operation returned by the service.
        The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
        • ResourceNotFoundException Thrown when an operation is attempted on a resource that does not exist.
        • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
        • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
        • IoTSecureTunnelingException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
        See Also:
        AWS API Documentation