Module omix.api

Interface URLConnectionHandlerInterface


public interface URLConnectionHandlerInterface
This interface allows to realize network communication for Omix. A derived class must create an instance of URLConnectionInterface managing the communication for a certain URL protocol like sftp, smb, ssh, ... etc.
Since:
Omix 1.3.11
Author:
Dr. Peter Droste, Omix Visualization
  • Method Summary

    Modifier and Type Method Description
    int getDefaultPort​(String protocol)
    Returns the default port for a URL protocol.
    URLConnectionInterface openConnection​(URL u, Proxy proxy, Authenticator authenticator)
    Opens a connection to the given URL.
    boolean supports​(String protocol)
    Determines if the ConnectionHandler supports a specific URL protocol (ftp, http, nntp, ... etc.).
    Omix iterates the list of installed URLConnectionHandlers ordered by time of installation.
  • Method Details

    • getDefaultPort

      int getDefaultPort​(String protocol)
      Returns the default port for a URL protocol.
      Returns:
      the default port for a URL protocol.
    • supports

      boolean supports​(String protocol)
      Determines if the ConnectionHandler supports a specific URL protocol (ftp, http, nntp, ... etc.).
      Omix iterates the list of installed URLConnectionHandlers ordered by time of installation. The first handler supporting the specific URL protocol is used for network communication. All other supporting handlers are skipped.
      Parameters:
      protocol - ftp, http, nntp, ... etc.
      Returns:
      supported?
    • openConnection

      URLConnectionInterface openConnection​(URL u, Proxy proxy, Authenticator authenticator) throws Exception
      Opens a connection to the given URL.
      Parameters:
      u - the URL that this connects to.
      proxy - the URL proxy server.
      authenticator - an authenticator managing the user interaction when login information is required.
      Returns:
      a URLConnectionInterface object for the URL.
      Throws:
      Exception - if an error occurs while opening the connection.