Class DefaultClientConnection

    • Constructor Detail

      • DefaultClientConnection

        public DefaultClientConnection()
        Deprecated.
    • Method Detail

      • getTargetHost

        public final HttpHost getTargetHost()
        Deprecated.
        Description copied from interface: OperatedClientConnection
        Obtains the target host for this connection. If the connection is to a proxy but not tunnelled, this is the proxy. If the connection is tunnelled through a proxy, this is the target of the tunnel.

        The return value is well-defined only while the connection is open. It may change even while the connection is open, because of an update.

        Specified by:
        getTargetHost in interface OperatedClientConnection
        Returns:
        the host to which this connection is opened
      • isSecure

        public final boolean isSecure()
        Deprecated.
        Description copied from interface: OperatedClientConnection
        Indicates whether this connection is secure. The return value is well-defined only while the connection is open. It may change even while the connection is open, because of an update.
        Specified by:
        isSecure in interface OperatedClientConnection
        Returns:
        true if this connection is secure, false otherwise
      • getSSLSession

        public javax.net.ssl.SSLSession getSSLSession()
        Deprecated.
        Description copied from interface: ManagedHttpClientConnection
        Obtains the SSL session of the underlying connection, if any. If this connection is open, and the underlying socket is an SSLSocket, the SSL session of that socket is obtained. This is a potentially blocking operation.
        Specified by:
        getSSLSession in interface ManagedHttpClientConnection
        Returns:
        the underlying SSL session if available, null otherwise
      • opening

        public void opening​(java.net.Socket sock,
                            HttpHost target)
                     throws java.io.IOException
        Deprecated.
        Description copied from interface: OperatedClientConnection
        Signals that this connection is in the process of being open.

        By calling this method, the connection can be re-initialized with a new Socket instance before OperatedClientConnection.openCompleted(boolean, org.apache.http.params.HttpParams) is called. This enabled the connection to close that socket if shutdown is called before it is fully open. Closing an unconnected socket will interrupt a thread that is blocked on the connect. Otherwise, that thread will either time out on the connect, or it returns successfully and then opens this connection which was just shut down.

        This method can be called multiple times if the connection is layered over another protocol. Note: This method will not close the previously used socket. It is the caller's responsibility to close that socket if it is no longer required.

        The caller must invoke OperatedClientConnection.openCompleted(boolean, org.apache.http.params.HttpParams) in order to complete the process.

        Specified by:
        opening in interface OperatedClientConnection
        Parameters:
        sock - the unconnected socket which is about to be connected.
        target - the target host of this connection
        Throws:
        java.io.IOException
      • openCompleted

        public void openCompleted​(boolean secure,
                                  HttpParams params)
                           throws java.io.IOException
        Deprecated.
        Description copied from interface: OperatedClientConnection
        Signals that the connection has been successfully open. An attempt to call this method on an open connection will cause an exception.
        Specified by:
        openCompleted in interface OperatedClientConnection
        Parameters:
        secure - true if this connection is secure, for example if an SSLSocket is used, or false if it is not secure
        params - parameters for this connection. The parameters will be used when creating dependent objects, for example to determine buffer sizes.
        Throws:
        java.io.IOException
      • shutdown

        public void shutdown()
                      throws java.io.IOException
        Deprecated.
        Force-closes this connection. If the connection is still in the process of being open (the method opening was already called but openCompleted was not), the associated socket that is being connected to a remote address will be closed. That will interrupt a thread that is blocked on connecting the socket. If the connection is not yet open, this will prevent the connection from being opened.
        Specified by:
        shutdown in interface HttpConnection
        Overrides:
        shutdown in class SocketHttpClientConnection
        Throws:
        java.io.IOException - in case of a problem
      • close

        public void close()
                   throws java.io.IOException
        Deprecated.
        Description copied from interface: HttpConnection
        Closes this connection gracefully. This method will attempt to flush the internal output buffer prior to closing the underlying socket. This method MUST NOT be called from a different thread to force shutdown of the connection. Use shutdown instead.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface HttpConnection
        Overrides:
        close in class SocketHttpClientConnection
        Throws:
        java.io.IOException
      • bind

        public void bind​(java.net.Socket socket)
                  throws java.io.IOException
        Deprecated.
        Description copied from interface: ManagedHttpClientConnection
        Binds this connection to the given socket. The connection is considered open if it is bound and the underlying socket is connection to a remote host.
        Specified by:
        bind in interface ManagedHttpClientConnection
        Parameters:
        socket - the socket to bind the connection to.
        Throws:
        java.io.IOException
      • update

        public void update​(java.net.Socket sock,
                           HttpHost target,
                           boolean secure,
                           HttpParams params)
                    throws java.io.IOException
        Deprecated.
        Description copied from interface: OperatedClientConnection
        Updates this connection. A connection can be updated only while it is open. Updates are used for example when a tunnel has been established, or when a TLS/SSL connection has been layered on top of a plain socket connection.

        Note: Updating the connection will not close the previously used socket. It is the caller's responsibility to close that socket if it is no longer required.

        Specified by:
        update in interface OperatedClientConnection
        Parameters:
        sock - the new socket for communicating with the target host, or null to continue using the old socket. If null is passed, helper objects that depend on the socket should be re-used. In that case, some changes in the parameters will not take effect.
        target - the new target host of this connection
        secure - true if this connection is now secure, false if it is not secure
        params - new parameters for this connection
        Throws:
        java.io.IOException
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String id)
        Deprecated.
        Description copied from interface: HttpContext
        Obtains attribute with the given name.
        Specified by:
        getAttribute in interface HttpContext
        Parameters:
        id - the attribute name.
        Returns:
        attribute value, or null if not set.
      • removeAttribute

        public java.lang.Object removeAttribute​(java.lang.String id)
        Deprecated.
        Description copied from interface: HttpContext
        Removes attribute with the given name from the context.
        Specified by:
        removeAttribute in interface HttpContext
        Parameters:
        id - the attribute name.
        Returns:
        attribute value, or null if not set.
      • setAttribute

        public void setAttribute​(java.lang.String id,
                                 java.lang.Object obj)
        Deprecated.
        Description copied from interface: HttpContext
        Sets value of the attribute with the given name.
        Specified by:
        setAttribute in interface HttpContext
        Parameters:
        id - the attribute name.
        obj - the attribute value.