Class HTTPConduit.WrappedOutputStream

java.lang.Object
java.io.OutputStream
org.apache.cxf.io.AbstractWrappedOutputStream
org.apache.cxf.io.AbstractThresholdOutputStream
org.apache.cxf.transport.http.HTTPConduit.WrappedOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
Enclosing class:
HTTPConduit

protected abstract class HTTPConduit.WrappedOutputStream extends org.apache.cxf.io.AbstractThresholdOutputStream
Wrapper output stream responsible for flushing headers and handling the incoming HTTP-level response (not necessarily the MEP response).
  • Field Details

    • 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 org.apache.cxf.io.CacheAndWriteOutputStream cachedStream
      This field contains the output stream with which we cache the request. It maybe null if we are not caching.
    • outMessage

      protected org.apache.cxf.message.Message outMessage
    • conduitName

      protected String conduitName
    • url

      protected URI url
  • Constructor Details

    • WrappedOutputStream

      protected WrappedOutputStream(org.apache.cxf.message.Message outMessage, boolean possibleRetransmit, boolean isChunking, int chunkThreshold, String conduitName, URI url)
    • WrappedOutputStream

      protected WrappedOutputStream(HTTPConduit.WrappedOutputStream wos)
  • Method Details

    • thresholdNotReached

      public void thresholdNotReached()
      Specified by:
      thresholdNotReached in class org.apache.cxf.io.AbstractThresholdOutputStream
    • setupWrappedStream

      protected abstract void setupWrappedStream() throws IOException
      Throws:
      IOException
    • getHttpsURLConnectionInfo

      protected abstract HttpsURLConnectionInfo getHttpsURLConnectionInfo() throws IOException
      Throws:
      IOException
    • setProtocolHeaders

      protected abstract void setProtocolHeaders() throws IOException
      Throws:
      IOException
    • setFixedLengthStreamingMode

      protected abstract void setFixedLengthStreamingMode(int i)
    • getResponseCode

      protected abstract int getResponseCode() throws IOException
      Throws:
      IOException
    • getResponseMessage

      protected abstract String getResponseMessage() throws IOException
      Throws:
      IOException
    • updateResponseHeaders

      protected abstract void updateResponseHeaders(org.apache.cxf.message.Message inMessage) throws IOException
      Throws:
      IOException
    • handleResponseAsync

      protected abstract void handleResponseAsync() throws IOException
      Throws:
      IOException
    • closeInputStream

      protected abstract void closeInputStream() throws IOException
      Throws:
      IOException
    • usingProxy

      protected abstract boolean usingProxy()
    • getInputStream

      protected abstract InputStream getInputStream() throws IOException
      Throws:
      IOException
    • getPartialResponse

      protected abstract InputStream getPartialResponse() throws IOException
      Throws:
      IOException
    • setupNewConnection

      protected abstract void setupNewConnection(String newURL) throws IOException
      Throws:
      IOException
    • retransmitStream

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

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

      protected void handleNoOutput() throws IOException
      Throws:
      IOException
    • handleResponseOnWorkqueue

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

      protected void retransmit(String newURL) throws IOException
      Throws:
      IOException
    • onFirstWrite

      protected void onFirstWrite() throws IOException
      Perform any actions required on stream flush (freeze headers, reset output stream ... etc.)
      Overrides:
      onFirstWrite in class org.apache.cxf.io.AbstractWrappedOutputStream
      Throws:
      IOException
    • getMethod

      protected String getMethod()
    • handleHeadersTrustCaching

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

      public void close() throws IOException
      Perform any actions required on stream closure (handle response etc.)
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class org.apache.cxf.io.AbstractThresholdOutputStream
      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
    • redirectRetransmit

      protected boolean redirectRetransmit() throws IOException
      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
    • doProcessResponseCode

      protected int doProcessResponseCode() throws IOException
      Throws:
      IOException
    • handleResponseInternal

      protected void handleResponseInternal() throws IOException
      Throws:
      IOException
    • propagateConduit

      protected void propagateConduit(org.apache.cxf.message.Exchange exchange, org.apache.cxf.message.Message in)
    • handleHttpRetryException

      protected void handleHttpRetryException(HttpRetryException e) throws IOException
      Throws:
      IOException
    • 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: