Interface ITunnel

  • All Superinterfaces:
    AutoCloseable

    public interface ITunnel
    extends AutoCloseable
    The support class to open SSH tunnel. Tinnel is mainly useful for passing through firewalls, though it can also be used to provide a secure endpoint into other network.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Closes tunnel.
      URL getUrl()
      Returns opened tunnel URL that client may call to get tunnelled target URL.
      URL open​(URL url, int port)
      Opens tunnel to the provided URL and the provided application port.
      URL open​(URL url, int port, TunnelOptions options)
      Opens tunnel to the provided URL and the provided application port.
    • Method Detail

      • open

        URL open​(URL url,
                 int port)
          throws TunnelException
        Opens tunnel to the provided URL and the provided application port.
        Parameters:
        url - the URL to open tunnel on, cannot be null
        port - the port to tunnel to, must be positive
        Returns:
        a URL that client may call to get tunnelled target URL, never null
        Throws:
        TunnelException - if tunnel open failed
      • open

        URL open​(URL url,
                 int port,
                 TunnelOptions options)
          throws TunnelException
        Opens tunnel to the provided URL and the provided application port.
        Parameters:
        url - the URL to open tunnel on, cannot be null
        port - the port to tunnel to, must be positive
        options - a tunnel options to open with, cannot be null
        Returns:
        a URL that client may call to get tunnelled target URL, never null
        Throws:
        TunnelException - if tunnel open failed
      • getUrl

        URL getUrl()
            throws TunnelException
        Returns opened tunnel URL that client may call to get tunnelled target URL.
        Returns:
        a URL that client may call to get tunnelled target URL, never null
        Throws:
        TunnelException - if tunnel is not opened