com.ibm.rational.test.lt.execution.socket.custom

Interface ISckConnectionHolder



  • public interface ISckConnectionHolder
    ISckConnectionHolder is the interface to the underlying connection.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      byte[] getCurrentlyReceivedBytes()
      Only available before the receive action is terminated by a call to receiveSuccess() or handleException().
      int getCurrentlyReceivedBytesCount()
      Only available before the receive action is terminated by a call to receiveSuccess() or handleException().
      byte[] getFinallyReceivedBytes()
      Only available after the receive action is terminated by a call to receiveSuccess() or handleException().
      int getFinallyReceivedBytesCount()
      Only available after the receive action is terminated by a call to receiveSuccess() or handleException().
      String getHostName() 
      long getLastConnectOrSendTimeStamp()
      As a result of a call to System.currentTimeMillis(), timestamps are collected by the connection holder when the Connection and the Send actions are actually done.
      byte[] getLastSentBytes() 
      int getLastSentBytesCount() 
      int getPort() 
      int getResponseTime() 
      boolean isConnected() 
      boolean isEndOfStream() 
      void rewind(int extraLength)
      Only useful before the receive action is terminated by a call to receiveSuccess() or handleException().
      void setHostName(String newHostName)
      Change the host name or IP v4 or IP v6 address of the remote peer of the underlying connection.
      void setPort(int newPort)
      Change the port number of the remote peer of the underlying connection.
      void setResponseTime(int responseTime)
      Sets the response time to be reported.
    • Method Detail

      • getHostName

        String getHostName()
        Returns:
        the host name or IP v4 or IP v6 address of the remote peer of the underlying connection.
      • getPort

        int getPort()
        Returns:
        the port number of the remote peer of the underlying connection.
      • setHostName

        void setHostName(String newHostName)
        Change the host name or IP v4 or IP v6 address of the remote peer of the underlying connection.
        Calling this method after the connection is established has no effect.
        Parameters:
        newHostName - the new value to be used for this connection
      • setPort

        void setPort(int newPort)
        Change the port number of the remote peer of the underlying connection.
        Calling this method after the connection is established has no effect.
        Parameters:
        newPort - the new value to be used for this connection
      • isConnected

        boolean isConnected()
        Returns:
        true if the underlying connection is connected.
      • isEndOfStream

        boolean isEndOfStream()
        Returns:
        true if the underlying connection has reached end of stream (i.e. has been closed by the remote peer).
      • getResponseTime

        int getResponseTime()
        Returns:
        the time elapsed between the last Send or Connect action and the first byte of the response has been received
        . This is the response time reported by default.
      • setResponseTime

        void setResponseTime(int responseTime)
        Sets the response time to be reported.
        Overrides the default value that can be retrieved by a call to getResponseTime().
        See getResponseTime for the explanation about the default value.
        Make use of getLastConnectOrSendTimeStamp() to get the timestamp of the starting event.
        Parameters:
        responseTime - the new response time value to report
      • getLastConnectOrSendTimeStamp

        long getLastConnectOrSendTimeStamp()
        As a result of a call to System.currentTimeMillis(), timestamps are collected by the connection holder when the Connection and the Send actions are actually done.
        Returns:
        the timestamp of the starting event needed to compute a customized response time.
      • getLastSentBytesCount

        int getLastSentBytesCount()
        Returns:
        the number of bytes sent on last Send action
      • getLastSentBytes

        byte[] getLastSentBytes()
        Returns:
        the last sent bytes on last Send action
      • getCurrentlyReceivedBytesCount

        int getCurrentlyReceivedBytesCount()
        Only available before the receive action is terminated by a call to receiveSuccess() or handleException().
        Otherwise, make use of getFinallyReceivedBytes().
        Returns:
        the number of bytes received since this action has started
      • getCurrentlyReceivedBytes

        byte[] getCurrentlyReceivedBytes()
        Only available before the receive action is terminated by a call to receiveSuccess() or handleException().
        Otherwise, make use of getFinallyReceivedBytes().
        Returns:
        the bytes received since this action has started
      • rewind

        void rewind(int extraLength)
                    throws IOException
        Only useful before the receive action is terminated by a call to receiveSuccess() or handleException().
        Allows to rewind read pointer for extraLength bytes. If extraLength is greater than the number of bytes consumed by the current read action, then that last number is used as extraLength.
        Parameters:
        extraLength - the number of bytes that have been read and that must be made available to next read action
        Throws:
        IOException - if something gets wrong during the rewind operation
        Since:
        8.2.1
      • getFinallyReceivedBytesCount

        int getFinallyReceivedBytesCount()
        Only available after the receive action is terminated by a call to receiveSuccess() or handleException().
        Otherwise, make use of getCurrentlyReceivedBytesCount().
        Returns:
        the number of bytes received by this action
      • getFinallyReceivedBytes

        byte[] getFinallyReceivedBytes()
        Only available after the receive action is terminated by a call to receiveSuccess() or handleException().
        Otherwise, make use of getCurrentlyReceivedBytes().
        Returns:
        the bytes received by this action
IBM Rational Performance Tester Socket SDK

© Copyright IBM Corp. 2013. All rights reserved.