Class ExecDumpClient


  • public class ExecDumpClient
    extends java.lang.Object
    A client for remote execution data dumps.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean dump  
      private boolean reset  
      private int retryCount  
      private long retryDelay  
    • Constructor Summary

      Constructors 
      Constructor Description
      ExecDumpClient()
      New instance with the defaults dump==true, reset==false, retryCount==0 and retryDelay=1000.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ExecFileLoader dump​(java.lang.String address, int port)
      Requests a dump from the given end-point.
      ExecFileLoader dump​(java.net.InetAddress address, int port)
      Requests a dump from the given end-point.
      protected void onConnecting​(java.net.InetAddress address, int port)
      This method can be overwritten to get an event just before a connection is made.
      protected void onConnectionFailure​(java.io.IOException exception)
      This method can be overwritten to get an event for connection failures when another retry will be attempted.
      void setDump​(boolean dump)
      Specifies whether a dump should be requested
      void setReset​(boolean reset)
      Specifies whether execution data should be reset.
      void setRetryCount​(int retryCount)
      Sets the number of retry attempts to connect to the target socket.
      void setRetryDelay​(long retryDelay)
      Sets the delay time before between connection attempts.
      private void sleep()  
      private java.net.Socket tryConnect​(java.net.InetAddress address, int port)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • dump

        private boolean dump
      • reset

        private boolean reset
      • retryCount

        private int retryCount
      • retryDelay

        private long retryDelay
    • Constructor Detail

      • ExecDumpClient

        public ExecDumpClient()
        New instance with the defaults dump==true, reset==false, retryCount==0 and retryDelay=1000.
    • Method Detail

      • setDump

        public void setDump​(boolean dump)
        Specifies whether a dump should be requested
        Parameters:
        dump - true if a dump should be requested
      • setReset

        public void setReset​(boolean reset)
        Specifies whether execution data should be reset.
        Parameters:
        reset - true if execution data should be reset
      • setRetryCount

        public void setRetryCount​(int retryCount)
        Sets the number of retry attempts to connect to the target socket. This allows to wait for a certain time until the target agent has initialized.
        Parameters:
        retryCount - number of retries
      • setRetryDelay

        public void setRetryDelay​(long retryDelay)
        Sets the delay time before between connection attempts.
        Parameters:
        retryDelay - delay in milliseconds
      • dump

        public ExecFileLoader dump​(java.lang.String address,
                                   int port)
                            throws java.io.IOException
        Requests a dump from the given end-point.
        Parameters:
        address - IP-Address to connect to
        port - port to connect to
        Returns:
        container for the dumped data
        Throws:
        java.io.IOException - in case the dump can not be requested
      • dump

        public ExecFileLoader dump​(java.net.InetAddress address,
                                   int port)
                            throws java.io.IOException
        Requests a dump from the given end-point.
        Parameters:
        address - host name or IP-Address to connect to
        port - port to connect to
        Returns:
        container for the dumped data
        Throws:
        java.io.IOException - in case the dump can not be requested
      • tryConnect

        private java.net.Socket tryConnect​(java.net.InetAddress address,
                                           int port)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • sleep

        private void sleep()
                    throws java.io.InterruptedIOException
        Throws:
        java.io.InterruptedIOException
      • onConnecting

        protected void onConnecting​(java.net.InetAddress address,
                                    int port)
        This method can be overwritten to get an event just before a connection is made.
        Parameters:
        address - target address
        port - target port
      • onConnectionFailure

        protected void onConnectionFailure​(java.io.IOException exception)
        This method can be overwritten to get an event for connection failures when another retry will be attempted.
        Parameters:
        exception - connection error