Class HTTPConduit.WrappedOutputStream

    • Field Detail

      • cachingForRetransmission

        protected boolean cachingForRetransmission
        This boolean is true if the request must be cached.
      • chunking

        protected final boolean chunking
        If we are going to be chunking, we won't flush till close which causes new chunks, small network packets, etc..
      • cachedStream

        protected CacheAndWriteOutputStream cachedStream
        This field contains the output stream with which we cache the request. It maybe null if we are not caching.
      • outMessage

        protected Message outMessage
      • conduitName

        protected String conduitName
      • url

        protected URI url
    • Constructor Detail

      • WrappedOutputStream

        protected WrappedOutputStream​(Message outMessage,
                                      boolean possibleRetransmit,
                                      boolean isChunking,
                                      int chunkThreshold,
                                      String conduitName,
                                      URI url)
    • Method Detail

      • setFixedLengthStreamingMode

        protected abstract void setFixedLengthStreamingMode​(int i)
      • usingProxy

        protected abstract boolean usingProxy()
      • updateCookiesBeforeRetransmit

        protected abstract void updateCookiesBeforeRetransmit()
                                                       throws IOException
        Throws:
        IOException
      • handleResponseOnWorkqueue

        protected void handleResponseOnWorkqueue​(boolean allowCurrentThread,
                                                 boolean forceWQ)
                                          throws IOException
        Throws:
        IOException
      • getMethod

        protected String getMethod()
      • handleHeadersTrustCaching

        protected void handleHeadersTrustCaching()
                                          throws IOException
        Throws:
        IOException
      • getExceptionMessage

        protected String getExceptionMessage​(Throwable t)
      • handleRetransmits

        protected void handleRetransmits()
                                  throws IOException
        This procedure handles all retransmits, if any.
        Throws:
        IOException
      • processRetransmit

        protected boolean processRetransmit()
                                     throws IOException
        This function processes any retransmits at the direction of redirections or "unauthorized" responses.
        Returns:
        true if there was a retransmit
        Throws:
        IOException
      • authorizationRetransmit

        protected boolean authorizationRetransmit()
                                           throws IOException
        This method performs a retransmit for authorization information.
        Returns:
        true if there was a retransmit
        Throws:
        IOException
      • handleResponse

        protected void handleResponse()
                               throws IOException
        This procedure is called on the close of the output stream so we are ready to handle the response from the connection. We may retransmit until we finally get a response.
        Throws:
        IOException
      • propagateConduit

        protected void propagateConduit​(Exchange exchange,
                                        Message in)
      • makeTrustDecision

        protected void makeTrustDecision()
                                  throws IOException
        This call must take place before anything is written to the URLConnection. The URLConnection.connect() will be called in order to get the connection information. This method is invoked just after setURLRequestHeaders() from the WrappedOutputStream before it writes data to the URLConnection. If trust cannot be established the Trust Decider implemenation throws an IOException.
        Throws:
        IOException - This exception is thrown if trust cannot be established by the configured MessageTrustDecider.
        See Also:
        MessageTrustDecider