Apache CXF API

org.apache.cxf.transport.http.asyncclient
Class AsyncHTTPConduit.AsyncWrappedOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.apache.cxf.io.AbstractWrappedOutputStream
          extended by org.apache.cxf.io.AbstractThresholdOutputStream
              extended by org.apache.cxf.transport.http.HTTPConduit.WrappedOutputStream
                  extended by org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduit.AsyncWrappedOutputStream
All Implemented Interfaces:
Closeable, Flushable, Channel, WritableByteChannel, CopyingOutputStream
Enclosing class:
AsyncHTTPConduit

public class AsyncHTTPConduit.AsyncWrappedOutputStream
extends HTTPConduit.WrappedOutputStream
implements CopyingOutputStream, WritableByteChannel


Field Summary
 
Fields inherited from class org.apache.cxf.transport.http.HTTPConduit.WrappedOutputStream
cachedStream, cachingForRetransmission, chunking, conduitName, outMessage, url
 
Fields inherited from class org.apache.cxf.io.AbstractThresholdOutputStream
buffer, threshold
 
Fields inherited from class org.apache.cxf.io.AbstractWrappedOutputStream
allowFlush, wrappedStream, written
 
Constructor Summary
AsyncHTTPConduit.AsyncWrappedOutputStream(Message message, boolean needToCacheRequest, boolean isChunking, int chunkThreshold, String conduitName, URI uri)
           
 
Method Summary
protected  boolean authorizationRetransmit()
          This method performs a retransmit for authorization information.
 void close()
          Perform any actions required on stream closure (handle response etc.)
protected  void closeInputStream()
           
protected  void connect(boolean output)
           
 int copyFrom(InputStream in)
           
 CachedOutputStream getCachedStream()
           
protected  org.apache.http.HttpResponse getHttpResponse()
           
protected  HttpsURLConnectionInfo getHttpsURLConnectionInfo()
           
protected  InputStream getInputStream()
           
protected  InputStream getPartialResponse()
           
protected  int getResponseCode()
           
protected  String getResponseMessage()
           
protected  void handleNoOutput()
           
protected  void handleResponseAsync()
           
 boolean isOpen()
           
protected  void onFirstWrite()
          Perform any actions required on stream flush (freeze headers, reset output stream ...
 boolean retransmitable()
           
protected  void retransmitStream()
           
protected  void retrySetHttpResponse(org.apache.http.HttpResponse r)
           
protected  void setException(Exception ex)
           
protected  void setFixedLengthStreamingMode(int i)
           
protected  void setHttpResponse(org.apache.http.HttpResponse r)
           
protected  void setProtocolHeaders()
           
 void setSSLSession(SSLSession sslsession)
           
protected  void setupNewConnection(String newURL)
           
protected  void setupWrappedStream()
           
 void thresholdReached()
           
protected  void updateCookiesBeforeRetransmit()
           
protected  void updateResponseHeaders(Message inMessage)
           
protected  boolean usingProxy()
           
 int write(ByteBuffer src)
           
 
Methods inherited from class org.apache.cxf.transport.http.HTTPConduit.WrappedOutputStream
getMethod, handleHeadersTrustCaching, handleHttpRetryException, handleResponse, handleResponseInternal, handleResponseOnWorkqueue, handleRetransmits, makeTrustDecision, processRetransmit, redirectRetransmit, retransmit, thresholdNotReached
 
Methods inherited from class org.apache.cxf.io.AbstractThresholdOutputStream
unBuffer, write, write
 
Methods inherited from class org.apache.cxf.io.AbstractWrappedOutputStream
allowFlush, flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncHTTPConduit.AsyncWrappedOutputStream

public AsyncHTTPConduit.AsyncWrappedOutputStream(Message message,
                                                 boolean needToCacheRequest,
                                                 boolean isChunking,
                                                 int chunkThreshold,
                                                 String conduitName,
                                                 URI uri)
Method Detail

retransmitable

public boolean retransmitable()

getCachedStream

public CachedOutputStream getCachedStream()

setProtocolHeaders

protected void setProtocolHeaders()
                           throws IOException
Specified by:
setProtocolHeaders in class HTTPConduit.WrappedOutputStream
Throws:
IOException

setFixedLengthStreamingMode

protected void setFixedLengthStreamingMode(int i)
Specified by:
setFixedLengthStreamingMode in class HTTPConduit.WrappedOutputStream

thresholdReached

public void thresholdReached()
                      throws IOException
Specified by:
thresholdReached in class AbstractThresholdOutputStream
Throws:
IOException

handleNoOutput

protected void handleNoOutput()
                       throws IOException
Overrides:
handleNoOutput in class HTTPConduit.WrappedOutputStream
Throws:
IOException

isOpen

public boolean isOpen()
Specified by:
isOpen in interface Channel

write

public int write(ByteBuffer src)
          throws IOException
Specified by:
write in interface WritableByteChannel
Throws:
IOException

copyFrom

public int copyFrom(InputStream in)
             throws IOException
Specified by:
copyFrom in interface CopyingOutputStream
Throws:
IOException

close

public void close()
           throws IOException
Description copied from class: HTTPConduit.WrappedOutputStream
Perform any actions required on stream closure (handle response etc.)

Specified by:
close in interface Closeable
Specified by:
close in interface Channel
Overrides:
close in class HTTPConduit.WrappedOutputStream
Throws:
IOException

onFirstWrite

protected void onFirstWrite()
                     throws IOException
Description copied from class: HTTPConduit.WrappedOutputStream
Perform any actions required on stream flush (freeze headers, reset output stream ... etc.)

Overrides:
onFirstWrite in class HTTPConduit.WrappedOutputStream
Throws:
IOException

setupWrappedStream

protected void setupWrappedStream()
                           throws IOException
Specified by:
setupWrappedStream in class HTTPConduit.WrappedOutputStream
Throws:
IOException

connect

protected void connect(boolean output)
                throws IOException
Throws:
IOException

retrySetHttpResponse

protected void retrySetHttpResponse(org.apache.http.HttpResponse r)

setHttpResponse

protected void setHttpResponse(org.apache.http.HttpResponse r)

setException

protected void setException(Exception ex)

getHttpResponse

protected org.apache.http.HttpResponse getHttpResponse()
                                                throws IOException
Throws:
IOException

handleResponseAsync

protected void handleResponseAsync()
                            throws IOException
Specified by:
handleResponseAsync in class HTTPConduit.WrappedOutputStream
Throws:
IOException

closeInputStream

protected void closeInputStream()
                         throws IOException
Specified by:
closeInputStream in class HTTPConduit.WrappedOutputStream
Throws:
IOException

getInputStream

protected InputStream getInputStream()
                              throws IOException
Specified by:
getInputStream in class HTTPConduit.WrappedOutputStream
Throws:
IOException

usingProxy

protected boolean usingProxy()
Specified by:
usingProxy in class HTTPConduit.WrappedOutputStream

getHttpsURLConnectionInfo

protected HttpsURLConnectionInfo getHttpsURLConnectionInfo()
                                                    throws IOException
Specified by:
getHttpsURLConnectionInfo in class HTTPConduit.WrappedOutputStream
Throws:
IOException

getResponseCode

protected int getResponseCode()
                       throws IOException
Specified by:
getResponseCode in class HTTPConduit.WrappedOutputStream
Throws:
IOException

getResponseMessage

protected String getResponseMessage()
                             throws IOException
Specified by:
getResponseMessage in class HTTPConduit.WrappedOutputStream
Throws:
IOException

updateResponseHeaders

protected void updateResponseHeaders(Message inMessage)
                              throws IOException
Specified by:
updateResponseHeaders in class HTTPConduit.WrappedOutputStream
Throws:
IOException

getPartialResponse

protected InputStream getPartialResponse()
                                  throws IOException
Specified by:
getPartialResponse in class HTTPConduit.WrappedOutputStream
Throws:
IOException

updateCookiesBeforeRetransmit

protected void updateCookiesBeforeRetransmit()
                                      throws IOException
Specified by:
updateCookiesBeforeRetransmit in class HTTPConduit.WrappedOutputStream
Throws:
IOException

authorizationRetransmit

protected boolean authorizationRetransmit()
                                   throws IOException
Description copied from class: HTTPConduit.WrappedOutputStream
This method performs a retransmit for authorization information.

Overrides:
authorizationRetransmit in class HTTPConduit.WrappedOutputStream
Returns:
A new connection if retransmitted. If not retransmitted then this method returns the same connection.
Throws:
IOException

retransmitStream

protected void retransmitStream()
                         throws IOException
Specified by:
retransmitStream in class HTTPConduit.WrappedOutputStream
Throws:
IOException

setupNewConnection

protected void setupNewConnection(String newURL)
                           throws IOException
Specified by:
setupNewConnection in class HTTPConduit.WrappedOutputStream
Throws:
IOException

setSSLSession

public void setSSLSession(SSLSession sslsession)

Apache CXF API

Apache CXF