Class ProxySocket

java.lang.Object
ecmwf.common.technical.ProxySocket
All Implemented Interfaces:
Closeable, Serializable, AutoCloseable

public final class ProxySocket extends Object implements Serializable, Closeable
The Class ProxySocket.
See Also:
  • Constructor Details

    • ProxySocket

      public ProxySocket(String source, long ticket)
      Instantiates a new proxy socket.
      Parameters:
      source - the source
      ticket - the ticket
    • ProxySocket

      public ProxySocket(String source, String target) throws IOException
      Instantiates a new proxy socket.
      Parameters:
      source - the source
      target - the target
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • ProxySocket

      public ProxySocket(SocketConfig socketConfig, String source, String target) throws IOException
      Instantiates a new proxy socket.
      Parameters:
      socketConfig - the socket config
      source - the source
      target - the target
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • ProxySocket

      public ProxySocket(long ticket, String dataHost, int dataPort, boolean isDirect)
      Instantiates a new proxy socket.
      Parameters:
      ticket - the ticket
      dataHost - the data host
      dataPort - the data port
      isDirect - the is direct
  • Method Details

    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object
    • setMaxBytesPerSec

      public void setMaxBytesPerSec(long maxBytesPerSec)
      Sets the maximum bytes per seconds.
      Parameters:
      maxBytesPerSec - the new max bytes per sec
    • getSocketConfig

      public SocketConfig getSocketConfig()
      Gets the socket config.
      Returns:
      the socket config
    • setSocketConfig

      public void setSocketConfig(SocketConfig socketConfig)
      Sets the socket config.
      Parameters:
      socketConfig - the new socket config
    • getDataSocket

      public Socket getDataSocket() throws IOException
      Gets the data socket.
      Returns:
      the data socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getDataSocket

      public Socket getDataSocket(SocketConfig socketConfig) throws IOException
      Gets the data socket.
      Parameters:
      socketConfig - the socket config
      Returns:
      the data socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • close

      public void close()
      Close.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getDataInputStream

      public static InputStream getDataInputStream(long ticket) throws IOException
      Gets the data input stream.
      Parameters:
      ticket - the ticket
      Returns:
      the data input stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getDataInputStream

      public InputStream getDataInputStream() throws IOException
      Gets the data input stream.
      Returns:
      the data input stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getDataOutputStream

      public static OutputStream getDataOutputStream(long ticket) throws IOException
      Gets the data output stream.
      Parameters:
      ticket - the ticket
      Returns:
      the data output stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getDataOutputStream

      public OutputStream getDataOutputStream() throws IOException
      Gets the data output stream.
      Returns:
      the data output stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getName

      public String getName()
      Gets the name.
      Returns:
      the name
    • getSocket

      public Socket getSocket() throws IOException
      Gets the socket.
      Returns:
      the socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getSource

      public String getSource()
      Gets the source.
      Returns:
      the source
    • getTarget

      public String getTarget()
      Gets the target.
      Returns:
      the target
    • getTicket

      public long getTicket()
      Gets the ticket.
      Returns:
      the ticket
    • open

      public void open() throws IOException
      Open.
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • open

      public void open(SocketConfig socketConfig) throws IOException
      Open.
      Parameters:
      socketConfig - the socket config
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • tunnel

      public void tunnel(String aHost, int aPort) throws IOException
      Tunnel.
      Parameters:
      aHost - the a host
      aPort - the a port
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • tunnel

      public void tunnel(SocketConfig socketConfig, String aHost, int aPort) throws IOException
      Tunnel.
      Parameters:
      socketConfig - the socket config
      aHost - the a host
      aPort - the a port
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getDataHost

      public String getDataHost()
      Gets the data host.
      Returns:
      the data host
    • getDataPort

      public int getDataPort()
      Gets the data port.
      Returns:
      the data port
    • addObject

      public void addObject(String key, Object object)
      Adds the object.
      Parameters:
      key - the key
      object - the object
    • getObject

      public Object getObject(String key)
      Gets the object.
      Parameters:
      key - the key
      Returns:
      the object